diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ab60527..dcb435e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -12,6 +12,7 @@ api_usage.go api_webhook.go client.go configuration.go +docs/AWSRoleConfig.md docs/AddDeviceToFleetsRequest.md docs/Alert.md docs/AlertAPI.md @@ -69,6 +70,10 @@ docs/FirmwareInfo.md docs/Fleet.md docs/FleetConnectivityAssurance.md docs/GetAlerts200Response.md +docs/GetBillingAccount200Response.md +docs/GetBillingAccount200ResponsePlan.md +docs/GetBillingAccountBalanceHistory200Response.md +docs/GetBillingAccountBalanceHistory200ResponseDataInner.md docs/GetBillingAccounts200Response.md docs/GetDataUsage200Response.md docs/GetDataUsage200ResponseDataInner.md @@ -109,6 +114,7 @@ docs/Notefile.md docs/NotefileSchema.md docs/NotehubRoute.md docs/NotehubRouteSummary.md +docs/OAuth2ClientCredentialsRequest.md docs/OAuth2Error.md docs/OAuth2TokenResponse.md docs/PersonalAccessToken.md @@ -129,6 +135,7 @@ docs/RouteAPI.md docs/RouteLog.md docs/RouteTransformSettings.md docs/S3ArchiveRoute.md +docs/SatelliteDataUsage.md docs/SatellitePlan.md docs/SchemaProperty.md docs/SignalDevice200Response.md @@ -161,6 +168,7 @@ model_add_device_to_fleets_request.go model_alert.go model_alert_data_inner.go model_alert_notifications_inner.go +model_aws_role_config.go model_aws_route.go model_azure_route.go model_billing_account.go @@ -208,6 +216,10 @@ model_firmware_info.go model_fleet.go model_fleet_connectivity_assurance.go model_get_alerts_200_response.go +model_get_billing_account_200_response.go +model_get_billing_account_200_response_plan.go +model_get_billing_account_balance_history_200_response.go +model_get_billing_account_balance_history_200_response_data_inner.go model_get_billing_accounts_200_response.go model_get_data_usage_200_response.go model_get_data_usage_200_response_data_inner.go @@ -247,6 +259,7 @@ model_notefile.go model_notefile_schema.go model_notehub_route.go model_notehub_route_summary.go +model_o_auth2_client_credentials_request.go model_o_auth2_error.go model_o_auth2_token_response.go model_personal_access_token.go @@ -265,6 +278,7 @@ model_role.go model_route_log.go model_route_transform_settings.go model_s3_archive_route.go +model_satellite_data_usage.go model_satellite_plan.go model_schema_property.go model_signal_device_200_response.go @@ -289,4 +303,15 @@ model_user_dfu_state_machine_status.go model_user_firmware_info.go model_webhook_settings.go response.go +test/api_alert_test.go +test/api_authorization_test.go +test/api_billing_account_test.go +test/api_device_test.go +test/api_event_test.go +test/api_external_devices_test.go +test/api_monitor_test.go +test/api_project_test.go +test/api_route_test.go +test/api_usage_test.go +test/api_webhook_test.go utils.go diff --git a/api_billing_account.go b/api_billing_account.go index cccb7ba..a265818 100644 --- a/api_billing_account.go +++ b/api_billing_account.go @@ -17,11 +17,256 @@ import ( "io" "net/http" "net/url" + "strings" ) // BillingAccountAPIService BillingAccountAPI service type BillingAccountAPIService service +type ApiGetBillingAccountRequest struct { + ctx context.Context + ApiService *BillingAccountAPIService + billingAccountUID string +} + +func (r ApiGetBillingAccountRequest) Execute() (*GetBillingAccount200Response, *http.Response, error) { + return r.ApiService.GetBillingAccountExecute(r) +} + +/* +GetBillingAccount Method for GetBillingAccount + +Get Billing Account Information + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param billingAccountUID + @return ApiGetBillingAccountRequest +*/ +func (a *BillingAccountAPIService) GetBillingAccount(ctx context.Context, billingAccountUID string) ApiGetBillingAccountRequest { + return ApiGetBillingAccountRequest{ + ApiService: a, + ctx: ctx, + billingAccountUID: billingAccountUID, + } +} + +// Execute executes the request +// +// @return GetBillingAccount200Response +func (a *BillingAccountAPIService) GetBillingAccountExecute(r ApiGetBillingAccountRequest) (*GetBillingAccount200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBillingAccount200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BillingAccountAPIService.GetBillingAccount") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/billing-accounts/{billingAccountUID}" + localVarPath = strings.Replace(localVarPath, "{"+"billingAccountUID"+"}", url.PathEscape(parameterValueToString(r.billingAccountUID, "billingAccountUID")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBillingAccountBalanceHistoryRequest struct { + ctx context.Context + ApiService *BillingAccountAPIService + billingAccountUID string + startDate *int32 + endDate *int32 +} + +// Start date for filtering results, specified as a Unix timestamp +func (r ApiGetBillingAccountBalanceHistoryRequest) StartDate(startDate int32) ApiGetBillingAccountBalanceHistoryRequest { + r.startDate = &startDate + return r +} + +// End date for filtering results, specified as a Unix timestamp +func (r ApiGetBillingAccountBalanceHistoryRequest) EndDate(endDate int32) ApiGetBillingAccountBalanceHistoryRequest { + r.endDate = &endDate + return r +} + +func (r ApiGetBillingAccountBalanceHistoryRequest) Execute() (*GetBillingAccountBalanceHistory200Response, *http.Response, error) { + return r.ApiService.GetBillingAccountBalanceHistoryExecute(r) +} + +/* +GetBillingAccountBalanceHistory Method for GetBillingAccountBalanceHistory + +Get Billing Account Balance history, only enterprise supported + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param billingAccountUID + @return ApiGetBillingAccountBalanceHistoryRequest +*/ +func (a *BillingAccountAPIService) GetBillingAccountBalanceHistory(ctx context.Context, billingAccountUID string) ApiGetBillingAccountBalanceHistoryRequest { + return ApiGetBillingAccountBalanceHistoryRequest{ + ApiService: a, + ctx: ctx, + billingAccountUID: billingAccountUID, + } +} + +// Execute executes the request +// +// @return GetBillingAccountBalanceHistory200Response +func (a *BillingAccountAPIService) GetBillingAccountBalanceHistoryExecute(r ApiGetBillingAccountBalanceHistoryRequest) (*GetBillingAccountBalanceHistory200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBillingAccountBalanceHistory200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BillingAccountAPIService.GetBillingAccountBalanceHistory") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/billing-accounts/{billingAccountUID}/balance-history" + localVarPath = strings.Replace(localVarPath, "{"+"billingAccountUID"+"}", url.PathEscape(parameterValueToString(r.billingAccountUID, "billingAccountUID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.startDate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "form", "") + } + if r.endDate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "form", "") + } + // 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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetBillingAccountsRequest struct { ctx context.Context ApiService *BillingAccountAPIService diff --git a/api_device.go b/api_device.go index 78a35c2..0a84d11 100644 --- a/api_device.go +++ b/api_device.go @@ -268,6 +268,114 @@ func (a *DeviceAPIService) AddQiNoteExecute(r ApiAddQiNoteRequest) (*http.Respon return localVarHTTPResponse, nil } +type ApiCreateNotefileRequest struct { + ctx context.Context + ApiService *DeviceAPIService + projectOrProductUID string + deviceUID string + notefileID string +} + +func (r ApiCreateNotefileRequest) Execute() (*http.Response, error) { + return r.ApiService.CreateNotefileExecute(r) +} + +/* +CreateNotefile Method for CreateNotefile + +Creates an empty Notefile on the device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectOrProductUID + @param deviceUID + @param notefileID + @return ApiCreateNotefileRequest +*/ +func (a *DeviceAPIService) CreateNotefile(ctx context.Context, projectOrProductUID string, deviceUID string, notefileID string) ApiCreateNotefileRequest { + return ApiCreateNotefileRequest{ + ApiService: a, + ctx: ctx, + projectOrProductUID: projectOrProductUID, + deviceUID: deviceUID, + notefileID: notefileID, + } +} + +// Execute executes the request +func (a *DeviceAPIService) CreateNotefileExecute(r ApiCreateNotefileRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeviceAPIService.CreateNotefile") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}" + localVarPath = strings.Replace(localVarPath, "{"+"projectOrProductUID"+"}", url.PathEscape(parameterValueToString(r.projectOrProductUID, "projectOrProductUID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"deviceUID"+"}", url.PathEscape(parameterValueToString(r.deviceUID, "deviceUID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"notefileID"+"}", url.PathEscape(parameterValueToString(r.notefileID, "notefileID")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiDeleteDeviceRequest struct { ctx context.Context ApiService *DeviceAPIService @@ -823,110 +931,6 @@ func (a *DeviceAPIService) DisableDeviceExecute(r ApiDisableDeviceRequest) (*htt return localVarHTTPResponse, nil } -type ApiDisableDeviceConnectivityAssuranceRequest struct { - ctx context.Context - ApiService *DeviceAPIService - projectOrProductUID string - deviceUID string -} - -func (r ApiDisableDeviceConnectivityAssuranceRequest) Execute() (*http.Response, error) { - return r.ApiService.DisableDeviceConnectivityAssuranceExecute(r) -} - -/* -DisableDeviceConnectivityAssurance Method for DisableDeviceConnectivityAssurance - -Disable Connectivity Assurance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectOrProductUID - @param deviceUID - @return ApiDisableDeviceConnectivityAssuranceRequest -*/ -func (a *DeviceAPIService) DisableDeviceConnectivityAssurance(ctx context.Context, projectOrProductUID string, deviceUID string) ApiDisableDeviceConnectivityAssuranceRequest { - return ApiDisableDeviceConnectivityAssuranceRequest{ - ApiService: a, - ctx: ctx, - projectOrProductUID: projectOrProductUID, - deviceUID: deviceUID, - } -} - -// Execute executes the request -func (a *DeviceAPIService) DisableDeviceConnectivityAssuranceExecute(r ApiDisableDeviceConnectivityAssuranceRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeviceAPIService.DisableDeviceConnectivityAssurance") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable-connectivity-assurance" - localVarPath = strings.Replace(localVarPath, "{"+"projectOrProductUID"+"}", url.PathEscape(parameterValueToString(r.projectOrProductUID, "projectOrProductUID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"deviceUID"+"}", url.PathEscape(parameterValueToString(r.deviceUID, "deviceUID")), -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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - type ApiEnableDeviceRequest struct { ctx context.Context ApiService *DeviceAPIService @@ -1031,110 +1035,6 @@ func (a *DeviceAPIService) EnableDeviceExecute(r ApiEnableDeviceRequest) (*http. return localVarHTTPResponse, nil } -type ApiEnableDeviceConnectivityAssuranceRequest struct { - ctx context.Context - ApiService *DeviceAPIService - projectOrProductUID string - deviceUID string -} - -func (r ApiEnableDeviceConnectivityAssuranceRequest) Execute() (*http.Response, error) { - return r.ApiService.EnableDeviceConnectivityAssuranceExecute(r) -} - -/* -EnableDeviceConnectivityAssurance Method for EnableDeviceConnectivityAssurance - -Enable Connectivity Assurance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectOrProductUID - @param deviceUID - @return ApiEnableDeviceConnectivityAssuranceRequest -*/ -func (a *DeviceAPIService) EnableDeviceConnectivityAssurance(ctx context.Context, projectOrProductUID string, deviceUID string) ApiEnableDeviceConnectivityAssuranceRequest { - return ApiEnableDeviceConnectivityAssuranceRequest{ - ApiService: a, - ctx: ctx, - projectOrProductUID: projectOrProductUID, - deviceUID: deviceUID, - } -} - -// Execute executes the request -func (a *DeviceAPIService) EnableDeviceConnectivityAssuranceExecute(r ApiEnableDeviceConnectivityAssuranceRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeviceAPIService.EnableDeviceConnectivityAssurance") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable-connectivity-assurance" - localVarPath = strings.Replace(localVarPath, "{"+"projectOrProductUID"+"}", url.PathEscape(parameterValueToString(r.projectOrProductUID, "projectOrProductUID")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"deviceUID"+"}", url.PathEscape(parameterValueToString(r.deviceUID, "deviceUID")), -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 - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - type ApiGetDbNoteRequest struct { ctx context.Context ApiService *DeviceAPIService @@ -2393,6 +2293,7 @@ type ApiGetDeviceSessionsRequest struct { pageNum *int32 startDate *int32 endDate *int32 + firstSync *bool } func (r ApiGetDeviceSessionsRequest) PageSize(pageSize int32) ApiGetDeviceSessionsRequest { @@ -2417,6 +2318,12 @@ func (r ApiGetDeviceSessionsRequest) EndDate(endDate int32) ApiGetDeviceSessions return r } +// When true, filters results to only show first sync sessions +func (r ApiGetDeviceSessionsRequest) FirstSync(firstSync bool) ApiGetDeviceSessionsRequest { + r.firstSync = &firstSync + return r +} + func (r ApiGetDeviceSessionsRequest) Execute() (*GetDeviceSessions200Response, *http.Response, error) { return r.ApiService.GetDeviceSessionsExecute(r) } @@ -2484,6 +2391,13 @@ func (a *DeviceAPIService) GetDeviceSessionsExecute(r ApiGetDeviceSessionsReques if r.endDate != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "form", "") } + if r.firstSync != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "firstSync", r.firstSync, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "firstSync", defaultValue, "form", "") + r.firstSync = &defaultValue + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/api_project.go b/api_project.go index 1dcea00..494a4b1 100644 --- a/api_project.go +++ b/api_project.go @@ -1417,6 +1417,126 @@ func (a *ProjectAPIService) DisableGlobalEventTransformationExecute(r ApiDisable return localVarHTTPResponse, nil } +type ApiDownloadFirmwareRequest struct { + ctx context.Context + ApiService *ProjectAPIService + projectOrProductUID string + firmwareType string + filename string +} + +func (r ApiDownloadFirmwareRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.DownloadFirmwareExecute(r) +} + +/* +DownloadFirmware Method for DownloadFirmware + +Download firmware binary + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectOrProductUID + @param firmwareType + @param filename + @return ApiDownloadFirmwareRequest +*/ +func (a *ProjectAPIService) DownloadFirmware(ctx context.Context, projectOrProductUID string, firmwareType string, filename string) ApiDownloadFirmwareRequest { + return ApiDownloadFirmwareRequest{ + ApiService: a, + ctx: ctx, + projectOrProductUID: projectOrProductUID, + firmwareType: firmwareType, + filename: filename, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *ProjectAPIService) DownloadFirmwareExecute(r ApiDownloadFirmwareRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectAPIService.DownloadFirmware") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}" + localVarPath = strings.Replace(localVarPath, "{"+"projectOrProductUID"+"}", url.PathEscape(parameterValueToString(r.projectOrProductUID, "projectOrProductUID")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"firmwareType"+"}", url.PathEscape(parameterValueToString(r.firmwareType, "firmwareType")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"filename"+"}", url.PathEscape(parameterValueToString(r.filename, "filename")), -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/octet-stream", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiEnableGlobalEventTransformationRequest struct { ctx context.Context ApiService *ProjectAPIService @@ -1517,6 +1637,119 @@ func (a *ProjectAPIService) EnableGlobalEventTransformationExecute(r ApiEnableGl return localVarHTTPResponse, nil } +type ApiGetAWSRoleConfigRequest struct { + ctx context.Context + ApiService *ProjectAPIService + projectOrProductUID string +} + +func (r ApiGetAWSRoleConfigRequest) Execute() (*AWSRoleConfig, *http.Response, error) { + return r.ApiService.GetAWSRoleConfigExecute(r) +} + +/* +GetAWSRoleConfig Get AWS role configuration for role-based authentication + +Returns the AWS Account ID and External ID needed to configure an IAM role +trust policy for role-based authentication on AWS routes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectOrProductUID + @return ApiGetAWSRoleConfigRequest +*/ +func (a *ProjectAPIService) GetAWSRoleConfig(ctx context.Context, projectOrProductUID string) ApiGetAWSRoleConfigRequest { + return ApiGetAWSRoleConfigRequest{ + ApiService: a, + ctx: ctx, + projectOrProductUID: projectOrProductUID, + } +} + +// Execute executes the request +// +// @return AWSRoleConfig +func (a *ProjectAPIService) GetAWSRoleConfigExecute(r ApiGetAWSRoleConfigRequest) (*AWSRoleConfig, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AWSRoleConfig + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectAPIService.GetAWSRoleConfig") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectOrProductUID}/aws-role-config" + localVarPath = strings.Replace(localVarPath, "{"+"projectOrProductUID"+"}", url.PathEscape(parameterValueToString(r.projectOrProductUID, "projectOrProductUID")), -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 + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetDeviceDfuHistoryRequest struct { ctx context.Context ApiService *ProjectAPIService @@ -2524,6 +2757,8 @@ type ApiGetFirmwareInfoRequest struct { filename *string md5 *string unpublished *bool + sortBy *string + sortOrder *string } func (r ApiGetFirmwareInfoRequest) Product(product string) ApiGetFirmwareInfoRequest { @@ -2561,6 +2796,18 @@ func (r ApiGetFirmwareInfoRequest) Unpublished(unpublished bool) ApiGetFirmwareI return r } +// Field to sort by +func (r ApiGetFirmwareInfoRequest) SortBy(sortBy string) ApiGetFirmwareInfoRequest { + r.sortBy = &sortBy + return r +} + +// Sort order (asc for ascending, desc for descending) +func (r ApiGetFirmwareInfoRequest) SortOrder(sortOrder string) ApiGetFirmwareInfoRequest { + r.sortOrder = &sortOrder + return r +} + func (r ApiGetFirmwareInfoRequest) Execute() ([]FirmwareInfo, *http.Response, error) { return r.ApiService.GetFirmwareInfoExecute(r) } @@ -2626,6 +2873,20 @@ func (a *ProjectAPIService) GetFirmwareInfoExecute(r ApiGetFirmwareInfoRequest) if r.unpublished != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "unpublished", r.unpublished, "form", "") } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "created" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } else { + var defaultValue string = "desc" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", defaultValue, "form", "") + r.sortOrder = &defaultValue + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/api_route.go b/api_route.go index a49c7a8..2e2c217 100644 --- a/api_route.go +++ b/api_route.go @@ -383,6 +383,8 @@ type ApiGetRouteLogsByRouteRequest struct { systemFilesOnly *bool mostRecentOnly *bool files *string + routingStatus *[]string + responseStatus *[]string } func (r ApiGetRouteLogsByRouteRequest) PageSize(pageSize int32) ApiGetRouteLogsByRouteRequest { @@ -438,6 +440,16 @@ func (r ApiGetRouteLogsByRouteRequest) Files(files string) ApiGetRouteLogsByRout return r } +func (r ApiGetRouteLogsByRouteRequest) RoutingStatus(routingStatus []string) ApiGetRouteLogsByRouteRequest { + r.routingStatus = &routingStatus + return r +} + +func (r ApiGetRouteLogsByRouteRequest) ResponseStatus(responseStatus []string) ApiGetRouteLogsByRouteRequest { + r.responseStatus = &responseStatus + return r +} + func (r ApiGetRouteLogsByRouteRequest) Execute() ([]RouteLog, *http.Response, error) { return r.ApiService.GetRouteLogsByRouteExecute(r) } @@ -539,6 +551,28 @@ func (a *RouteAPIService) GetRouteLogsByRouteExecute(r ApiGetRouteLogsByRouteReq if r.files != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "files", r.files, "form", "") } + if r.routingStatus != nil { + t := *r.routingStatus + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "routingStatus", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "routingStatus", t, "form", "multi") + } + } + if r.responseStatus != nil { + t := *r.responseStatus + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "responseStatus", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "responseStatus", t, "form", "multi") + } + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/api_usage.go b/api_usage.go index 9891678..f665bd5 100644 --- a/api_usage.go +++ b/api_usage.go @@ -33,6 +33,7 @@ type ApiGetDataUsageRequest struct { endDate *int32 deviceUID *[]string fleetUID *[]string + limit *int32 aggregate *string } @@ -66,6 +67,12 @@ func (r ApiGetDataUsageRequest) FleetUID(fleetUID []string) ApiGetDataUsageReque return r } +// Limit the number of data points returned +func (r ApiGetDataUsageRequest) Limit(limit int32) ApiGetDataUsageRequest { + r.limit = &limit + return r +} + // Aggregation level for results func (r ApiGetDataUsageRequest) Aggregate(aggregate string) ApiGetDataUsageRequest { r.aggregate = &aggregate @@ -147,6 +154,13 @@ func (a *UsageAPIService) GetDataUsageExecute(r ApiGetDataUsageRequest) (*GetDat parameterAddToHeaderOrQuery(localVarQueryParams, "fleetUID", t, "form", "multi") } } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 200000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") if r.aggregate != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "aggregate", r.aggregate, "form", "") @@ -226,6 +240,7 @@ type ApiGetEventsUsageRequest struct { endDate *int32 deviceUID *[]string fleetUID *[]string + limit *int32 aggregate *string notefile *[]string skipRecentData *bool @@ -262,6 +277,12 @@ func (r ApiGetEventsUsageRequest) FleetUID(fleetUID []string) ApiGetEventsUsageR return r } +// Limit the number of data points returned +func (r ApiGetEventsUsageRequest) Limit(limit int32) ApiGetEventsUsageRequest { + r.limit = &limit + return r +} + // Aggregation level for results func (r ApiGetEventsUsageRequest) Aggregate(aggregate string) ApiGetEventsUsageRequest { r.aggregate = &aggregate @@ -361,6 +382,13 @@ func (a *UsageAPIService) GetEventsUsageExecute(r ApiGetEventsUsageRequest) (*Us parameterAddToHeaderOrQuery(localVarQueryParams, "fleetUID", t, "form", "multi") } } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 200000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") if r.aggregate != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "aggregate", r.aggregate, "form", "") @@ -464,6 +492,7 @@ type ApiGetRouteLogsUsageRequest struct { startDate *int32 endDate *int32 routeUID *[]string + limit *int32 aggregate *string skipRecentData *bool } @@ -492,6 +521,12 @@ func (r ApiGetRouteLogsUsageRequest) RouteUID(routeUID []string) ApiGetRouteLogs return r } +// Limit the number of data points returned +func (r ApiGetRouteLogsUsageRequest) Limit(limit int32) ApiGetRouteLogsUsageRequest { + r.limit = &limit + return r +} + // Aggregation level for results func (r ApiGetRouteLogsUsageRequest) Aggregate(aggregate string) ApiGetRouteLogsUsageRequest { r.aggregate = &aggregate @@ -568,6 +603,13 @@ func (a *UsageAPIService) GetRouteLogsUsageExecute(r ApiGetRouteLogsUsageRequest parameterAddToHeaderOrQuery(localVarQueryParams, "routeUID", t, "form", "multi") } } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 200000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") if r.aggregate != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "aggregate", r.aggregate, "form", "") @@ -654,6 +696,7 @@ type ApiGetSessionsUsageRequest struct { endDate *int32 deviceUID *[]string fleetUID *[]string + limit *int32 aggregate *string skipRecentData *bool } @@ -688,6 +731,12 @@ func (r ApiGetSessionsUsageRequest) FleetUID(fleetUID []string) ApiGetSessionsUs return r } +// Limit the number of data points returned +func (r ApiGetSessionsUsageRequest) Limit(limit int32) ApiGetSessionsUsageRequest { + r.limit = &limit + return r +} + // Aggregation level for results func (r ApiGetSessionsUsageRequest) Aggregate(aggregate string) ApiGetSessionsUsageRequest { r.aggregate = &aggregate @@ -775,6 +824,13 @@ func (a *UsageAPIService) GetSessionsUsageExecute(r ApiGetSessionsUsageRequest) parameterAddToHeaderOrQuery(localVarQueryParams, "fleetUID", t, "form", "multi") } } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 200000 + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", defaultValue, "form", "") + r.limit = &defaultValue + } parameterAddToHeaderOrQuery(localVarQueryParams, "period", r.period, "form", "") if r.aggregate != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "aggregate", r.aggregate, "form", "") diff --git a/docs/AWSRoleConfig.md b/docs/AWSRoleConfig.md new file mode 100644 index 0000000..52ddf38 --- /dev/null +++ b/docs/AWSRoleConfig.md @@ -0,0 +1,67 @@ +# AWSRoleConfig + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | ---------- | --------------------------------------------------------------------- | ----- | +| **AwsAccountId** | **string** | The Blues AWS Account ID to trust in your IAM role's trust policy | +| **ExternalId** | **string** | The External ID to use in your IAM role's trust policy condition | + +## Methods + +### NewAWSRoleConfig + +`func NewAWSRoleConfig(awsAccountId string, externalId string, ) *AWSRoleConfig` + +NewAWSRoleConfig instantiates a new AWSRoleConfig object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAWSRoleConfigWithDefaults + +`func NewAWSRoleConfigWithDefaults() *AWSRoleConfig` + +NewAWSRoleConfigWithDefaults instantiates a new AWSRoleConfig object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAwsAccountId + +`func (o *AWSRoleConfig) GetAwsAccountId() string` + +GetAwsAccountId returns the AwsAccountId field if non-nil, zero value otherwise. + +### GetAwsAccountIdOk + +`func (o *AWSRoleConfig) GetAwsAccountIdOk() (*string, bool)` + +GetAwsAccountIdOk returns a tuple with the AwsAccountId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAwsAccountId + +`func (o *AWSRoleConfig) SetAwsAccountId(v string)` + +SetAwsAccountId sets AwsAccountId field to given value. + +### GetExternalId + +`func (o *AWSRoleConfig) GetExternalId() string` + +GetExternalId returns the ExternalId field if non-nil, zero value otherwise. + +### GetExternalIdOk + +`func (o *AWSRoleConfig) GetExternalIdOk() (*string, bool)` + +GetExternalIdOk returns a tuple with the ExternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalId + +`func (o *AWSRoleConfig) SetExternalId(v string)` + +SetExternalId sets ExternalId field to given value. + +[[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/AwsRoute.md b/docs/AwsRoute.md index b93924b..6199e5a 100644 --- a/docs/AwsRoute.md +++ b/docs/AwsRoute.md @@ -2,22 +2,23 @@ ## Properties -| Name | Type | Description | Notes | -| -------------------------- | ------------------------------------------------------------------ | ----------- | ---------- | -| **AccessKeyId** | Pointer to **string** | | [optional] | -| **AccessKeySecret** | Pointer to **string** | | [optional] | -| **Channel** | Pointer to **string** | | [optional] | -| **DisableHttpHeaders** | Pointer to **bool** | | [optional] | -| **Filter** | Pointer to [**Filter**](Filter.md) | | [optional] | -| **Fleets** | Pointer to **[]string** | | [optional] | -| **HttpHeaders** | Pointer to **map[string]string** | | [optional] | -| **MessageDeduplicationId** | Pointer to **string** | | [optional] | -| **MessageGroupId** | Pointer to **string** | | [optional] | -| **Region** | Pointer to **string** | | [optional] | -| **ThrottleMs** | Pointer to **int32** | | [optional] | -| **Timeout** | Pointer to **int32** | | [optional] | -| **Transform** | Pointer to [**RouteTransformSettings**](RouteTransformSettings.md) | | [optional] | -| **Url** | Pointer to **string** | | [optional] | +| Name | Type | Description | Notes | +| -------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------- | ---------- | +| **AccessKeyId** | Pointer to **string** | | [optional] | +| **AccessKeySecret** | Pointer to **string** | | [optional] | +| **Channel** | Pointer to **string** | | [optional] | +| **DisableHttpHeaders** | Pointer to **bool** | | [optional] | +| **Filter** | Pointer to [**Filter**](Filter.md) | | [optional] | +| **Fleets** | Pointer to **[]string** | | [optional] | +| **HttpHeaders** | Pointer to **map[string]string** | | [optional] | +| **MessageDeduplicationId** | Pointer to **string** | | [optional] | +| **MessageGroupId** | Pointer to **string** | | [optional] | +| **Region** | Pointer to **string** | | [optional] | +| **RoleArn** | Pointer to **string** | IAM Role ARN for role-based authentication via STS AssumeRole | [optional] | +| **ThrottleMs** | Pointer to **int32** | | [optional] | +| **Timeout** | Pointer to **int32** | | [optional] | +| **Transform** | Pointer to [**RouteTransformSettings**](RouteTransformSettings.md) | | [optional] | +| **Url** | Pointer to **string** | | [optional] | ## Methods @@ -288,6 +289,31 @@ SetRegion sets Region field to given value. HasRegion returns a boolean if a field has been set. +### GetRoleArn + +`func (o *AwsRoute) GetRoleArn() string` + +GetRoleArn returns the RoleArn field if non-nil, zero value otherwise. + +### GetRoleArnOk + +`func (o *AwsRoute) GetRoleArnOk() (*string, bool)` + +GetRoleArnOk returns a tuple with the RoleArn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoleArn + +`func (o *AwsRoute) SetRoleArn(v string)` + +SetRoleArn sets RoleArn field to given value. + +### HasRoleArn + +`func (o *AwsRoute) HasRoleArn() bool` + +HasRoleArn returns a boolean if a field has been set. + ### GetThrottleMs `func (o *AwsRoute) GetThrottleMs() int32` diff --git a/docs/BillingAccountAPI.md b/docs/BillingAccountAPI.md index 579927f..e08bab1 100644 --- a/docs/BillingAccountAPI.md +++ b/docs/BillingAccountAPI.md @@ -2,9 +2,140 @@ All URIs are relative to *https://api.notefile.net* -| Method | HTTP request | Description | -| ----------------------------------------------------------------- | ---------------------------- | ----------- | -| [**GetBillingAccounts**](BillingAccountAPI.md#GetBillingAccounts) | **Get** /v1/billing-accounts | +| Method | HTTP request | Description | +| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ----------- | +| [**GetBillingAccount**](BillingAccountAPI.md#GetBillingAccount) | **Get** /v1/billing-accounts/{billingAccountUID} | +| [**GetBillingAccountBalanceHistory**](BillingAccountAPI.md#GetBillingAccountBalanceHistory) | **Get** /v1/billing-accounts/{billingAccountUID}/balance-history | +| [**GetBillingAccounts**](BillingAccountAPI.md#GetBillingAccounts) | **Get** /v1/billing-accounts | + +## GetBillingAccount + +> GetBillingAccount200Response GetBillingAccount(ctx, billingAccountUID).Execute() + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/blues/notehub-go" +) + +func main() { + billingAccountUID := "00000000-0000-0000-000000000001" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BillingAccountAPI.GetBillingAccount(context.Background(), billingAccountUID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BillingAccountAPI.GetBillingAccount``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBillingAccount`: GetBillingAccount200Response + fmt.Fprintf(os.Stdout, "Response from `BillingAccountAPI.GetBillingAccount`: %v\n", resp) +} +``` + +### Path Parameters + +| Name | Type | Description | Notes | +| --------------------- | ------------------- | --------------------------------------------------------------------------- | ----- | +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | +| **billingAccountUID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBillingAccountRequest struct via the builder pattern + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +### Return type + +[**GetBillingAccount200Response**](GetBillingAccount200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### 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) + +## GetBillingAccountBalanceHistory + +> GetBillingAccountBalanceHistory200Response GetBillingAccountBalanceHistory(ctx, billingAccountUID).StartDate(startDate).EndDate(endDate).Execute() + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/blues/notehub-go" +) + +func main() { + billingAccountUID := "00000000-0000-0000-000000000001" // string | + startDate := int32(1628631763) // int32 | Start date for filtering results, specified as a Unix timestamp (optional) + endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BillingAccountAPI.GetBillingAccountBalanceHistory(context.Background(), billingAccountUID).StartDate(startDate).EndDate(endDate).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BillingAccountAPI.GetBillingAccountBalanceHistory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBillingAccountBalanceHistory`: GetBillingAccountBalanceHistory200Response + fmt.Fprintf(os.Stdout, "Response from `BillingAccountAPI.GetBillingAccountBalanceHistory`: %v\n", resp) +} +``` + +### Path Parameters + +| Name | Type | Description | Notes | +| --------------------- | ------------------- | --------------------------------------------------------------------------- | ----- | +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | +| **billingAccountUID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBillingAccountBalanceHistoryRequest struct via the builder pattern + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +**startDate** | **int32** | Start date for filtering results, specified as a Unix timestamp | +**endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | + +### Return type + +[**GetBillingAccountBalanceHistory200Response**](GetBillingAccountBalanceHistory200Response.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### 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) ## GetBillingAccounts diff --git a/docs/DeviceAPI.md b/docs/DeviceAPI.md index c8322ad..3094c1a 100644 --- a/docs/DeviceAPI.md +++ b/docs/DeviceAPI.md @@ -2,38 +2,37 @@ All URIs are relative to *https://api.notefile.net* -| Method | HTTP request | Description | -| ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------------------------- | -| [**AddDbNote**](DeviceAPI.md#AddDbNote) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | -| [**AddQiNote**](DeviceAPI.md#AddQiNote) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | -| [**DeleteDevice**](DeviceAPI.md#DeleteDevice) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID} | -| [**DeleteDeviceEnvironmentVariable**](DeviceAPI.md#DeleteDeviceEnvironmentVariable) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key} | -| [**DeleteNote**](DeviceAPI.md#DeleteNote) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | -| [**DeleteNotefiles**](DeviceAPI.md#DeleteNotefiles) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | -| [**DisableDevice**](DeviceAPI.md#DisableDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable | -| [**DisableDeviceConnectivityAssurance**](DeviceAPI.md#DisableDeviceConnectivityAssurance) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable-connectivity-assurance | -| [**EnableDevice**](DeviceAPI.md#EnableDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable | -| [**EnableDeviceConnectivityAssurance**](DeviceAPI.md#EnableDeviceConnectivityAssurance) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable-connectivity-assurance | -| [**GetDbNote**](DeviceAPI.md#GetDbNote) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | -| [**GetDevice**](DeviceAPI.md#GetDevice) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID} | -| [**GetDeviceEnvironmentHierarchy**](DeviceAPI.md#GetDeviceEnvironmentHierarchy) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy | Get environment variable hierarchy for a device | -| [**GetDeviceEnvironmentVariables**](DeviceAPI.md#GetDeviceEnvironmentVariables) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | -| [**GetDeviceEnvironmentVariablesByPin**](DeviceAPI.md#GetDeviceEnvironmentVariablesByPin) | **Get** /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | -| [**GetDeviceHealthLog**](DeviceAPI.md#GetDeviceHealthLog) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log | -| [**GetDeviceLatestEvents**](DeviceAPI.md#GetDeviceLatestEvents) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest | -| [**GetDevicePlans**](DeviceAPI.md#GetDevicePlans) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans | -| [**GetDevicePublicKey**](DeviceAPI.md#GetDevicePublicKey) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key | -| [**GetDevicePublicKeys**](DeviceAPI.md#GetDevicePublicKeys) | **Get** /v1/projects/{projectOrProductUID}/devices/public-keys | -| [**GetDeviceSessions**](DeviceAPI.md#GetDeviceSessions) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions | -| [**GetDevices**](DeviceAPI.md#GetDevices) | **Get** /v1/projects/{projectOrProductUID}/devices | -| [**GetFleetDevices**](DeviceAPI.md#GetFleetDevices) | **Get** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices | -| [**GetNotefile**](DeviceAPI.md#GetNotefile) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | -| [**ListNotefiles**](DeviceAPI.md#ListNotefiles) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | -| [**ProvisionDevice**](DeviceAPI.md#ProvisionDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision | -| [**SetDeviceEnvironmentVariables**](DeviceAPI.md#SetDeviceEnvironmentVariables) | **Put** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | -| [**SetDeviceEnvironmentVariablesByPin**](DeviceAPI.md#SetDeviceEnvironmentVariablesByPin) | **Put** /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | -| [**SignalDevice**](DeviceAPI.md#SignalDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal | -| [**UpdateDbNote**](DeviceAPI.md#UpdateDbNote) | **Put** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | +| Method | HTTP request | Description | +| ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ----------------------------------------------- | +| [**AddDbNote**](DeviceAPI.md#AddDbNote) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | +| [**AddQiNote**](DeviceAPI.md#AddQiNote) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | +| [**CreateNotefile**](DeviceAPI.md#CreateNotefile) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID} | +| [**DeleteDevice**](DeviceAPI.md#DeleteDevice) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID} | +| [**DeleteDeviceEnvironmentVariable**](DeviceAPI.md#DeleteDeviceEnvironmentVariable) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key} | +| [**DeleteNote**](DeviceAPI.md#DeleteNote) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | +| [**DeleteNotefiles**](DeviceAPI.md#DeleteNotefiles) | **Delete** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | +| [**DisableDevice**](DeviceAPI.md#DisableDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable | +| [**EnableDevice**](DeviceAPI.md#EnableDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable | +| [**GetDbNote**](DeviceAPI.md#GetDbNote) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | +| [**GetDevice**](DeviceAPI.md#GetDevice) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID} | +| [**GetDeviceEnvironmentHierarchy**](DeviceAPI.md#GetDeviceEnvironmentHierarchy) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy | Get environment variable hierarchy for a device | +| [**GetDeviceEnvironmentVariables**](DeviceAPI.md#GetDeviceEnvironmentVariables) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | +| [**GetDeviceEnvironmentVariablesByPin**](DeviceAPI.md#GetDeviceEnvironmentVariablesByPin) | **Get** /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | +| [**GetDeviceHealthLog**](DeviceAPI.md#GetDeviceHealthLog) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log | +| [**GetDeviceLatestEvents**](DeviceAPI.md#GetDeviceLatestEvents) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest | +| [**GetDevicePlans**](DeviceAPI.md#GetDevicePlans) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans | +| [**GetDevicePublicKey**](DeviceAPI.md#GetDevicePublicKey) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key | +| [**GetDevicePublicKeys**](DeviceAPI.md#GetDevicePublicKeys) | **Get** /v1/projects/{projectOrProductUID}/devices/public-keys | +| [**GetDeviceSessions**](DeviceAPI.md#GetDeviceSessions) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions | +| [**GetDevices**](DeviceAPI.md#GetDevices) | **Get** /v1/projects/{projectOrProductUID}/devices | +| [**GetFleetDevices**](DeviceAPI.md#GetFleetDevices) | **Get** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices | +| [**GetNotefile**](DeviceAPI.md#GetNotefile) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | +| [**ListNotefiles**](DeviceAPI.md#ListNotefiles) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | +| [**ProvisionDevice**](DeviceAPI.md#ProvisionDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision | +| [**SetDeviceEnvironmentVariables**](DeviceAPI.md#SetDeviceEnvironmentVariables) | **Put** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | +| [**SetDeviceEnvironmentVariablesByPin**](DeviceAPI.md#SetDeviceEnvironmentVariablesByPin) | **Put** /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | +| [**SignalDevice**](DeviceAPI.md#SignalDevice) | **Post** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal | +| [**UpdateDbNote**](DeviceAPI.md#UpdateDbNote) | **Put** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | ## AddDbNote @@ -171,9 +170,9 @@ Other parameters are passed through a pointer to a apiAddQiNoteRequest struct vi [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## DeleteDevice +## CreateNotefile -> DeleteDevice(ctx, projectOrProductUID, deviceUID).Execute() +> CreateNotefile(ctx, projectOrProductUID, deviceUID, notefileID).Execute() ### Example @@ -190,12 +189,13 @@ import ( func main() { projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | deviceUID := "dev:000000000000000" // string | + notefileID := "notefileID_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), projectOrProductUID, deviceUID).Execute() + r, err := apiClient.DeviceAPI.CreateNotefile(context.Background(), projectOrProductUID, deviceUID, notefileID).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDevice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.CreateNotefile``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -208,10 +208,11 @@ func main() { | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | | **projectOrProductUID** | **string** | | | **deviceUID** | **string** | | +| **notefileID** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateNotefileRequest struct via the builder pattern | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | @@ -233,9 +234,9 @@ Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## DeleteDeviceEnvironmentVariable +## DeleteDevice -> EnvironmentVariables DeleteDeviceEnvironmentVariable(ctx, projectOrProductUID, deviceUID, key).Execute() +> DeleteDevice(ctx, projectOrProductUID, deviceUID).Execute() ### Example @@ -252,17 +253,14 @@ import ( func main() { projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | deviceUID := "dev:000000000000000" // string | - key := "key_example" // string | The environment variable key to delete. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DeviceAPI.DeleteDeviceEnvironmentVariable(context.Background(), projectOrProductUID, deviceUID, key).Execute() + r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), projectOrProductUID, deviceUID).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDeviceEnvironmentVariable``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `DeleteDeviceEnvironmentVariable`: EnvironmentVariables - fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.DeleteDeviceEnvironmentVariable`: %v\n", resp) } ``` @@ -273,18 +271,17 @@ func main() { | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | | **projectOrProductUID** | **string** | | | **deviceUID** | **string** | | -| **key** | **string** | The environment variable key to delete. | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteDeviceEnvironmentVariableRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct via the builder pattern | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | ### Return type -[**EnvironmentVariables**](EnvironmentVariables.md) +(empty response body) ### Authorization @@ -299,9 +296,9 @@ Other parameters are passed through a pointer to a apiDeleteDeviceEnvironmentVar [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## DeleteNote +## DeleteDeviceEnvironmentVariable -> DeleteNote(ctx, projectOrProductUID, deviceUID, notefileID, noteID).Execute() +> EnvironmentVariables DeleteDeviceEnvironmentVariable(ctx, projectOrProductUID, deviceUID, key).Execute() ### Example @@ -318,16 +315,17 @@ import ( func main() { projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | deviceUID := "dev:000000000000000" // string | - notefileID := "notefileID_example" // string | - noteID := "noteID_example" // string | + key := "key_example" // string | The environment variable key to delete. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.DeleteNote(context.Background(), projectOrProductUID, deviceUID, notefileID, noteID).Execute() + resp, r, err := apiClient.DeviceAPI.DeleteDeviceEnvironmentVariable(context.Background(), projectOrProductUID, deviceUID, key).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteNote``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDeviceEnvironmentVariable``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `DeleteDeviceEnvironmentVariable`: EnvironmentVariables + fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.DeleteDeviceEnvironmentVariable`: %v\n", resp) } ``` @@ -338,19 +336,18 @@ func main() { | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | | **projectOrProductUID** | **string** | | | **deviceUID** | **string** | | -| **notefileID** | **string** | | -| **noteID** | **string** | | +| **key** | **string** | The environment variable key to delete. | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteNoteRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteDeviceEnvironmentVariableRequest struct via the builder pattern | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | ### Return type -(empty response body) +[**EnvironmentVariables**](EnvironmentVariables.md) ### Authorization @@ -365,9 +362,9 @@ Other parameters are passed through a pointer to a apiDeleteNoteRequest struct v [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## DeleteNotefiles +## DeleteNote -> DeleteNotefiles(ctx, projectOrProductUID, deviceUID).DeleteNotefilesRequest(deleteNotefilesRequest).Execute() +> DeleteNote(ctx, projectOrProductUID, deviceUID, notefileID, noteID).Execute() ### Example @@ -384,13 +381,14 @@ import ( func main() { projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | deviceUID := "dev:000000000000000" // string | - deleteNotefilesRequest := *openapiclient.NewDeleteNotefilesRequest() // DeleteNotefilesRequest | + notefileID := "notefileID_example" // string | + noteID := "noteID_example" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.DeleteNotefiles(context.Background(), projectOrProductUID, deviceUID).DeleteNotefilesRequest(deleteNotefilesRequest).Execute() + r, err := apiClient.DeviceAPI.DeleteNote(context.Background(), projectOrProductUID, deviceUID, notefileID, noteID).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteNotefiles``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteNote``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -403,16 +401,16 @@ func main() { | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | | **projectOrProductUID** | **string** | | | **deviceUID** | **string** | | +| **notefileID** | **string** | | +| **noteID** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteNotefilesRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteNoteRequest struct via the builder pattern | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -**deleteNotefilesRequest** | [**DeleteNotefilesRequest**](DeleteNotefilesRequest.md) | | - ### Return type (empty response body) @@ -423,16 +421,16 @@ Other parameters are passed through a pointer to a apiDeleteNotefilesRequest str ### HTTP request headers -- **Content-Type**: application/json +- **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) -## DisableDevice +## DeleteNotefiles -> DisableDevice(ctx, projectOrProductUID, deviceUID).Execute() +> DeleteNotefiles(ctx, projectOrProductUID, deviceUID).DeleteNotefilesRequest(deleteNotefilesRequest).Execute() ### Example @@ -449,12 +447,13 @@ import ( func main() { projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | deviceUID := "dev:000000000000000" // string | + deleteNotefilesRequest := *openapiclient.NewDeleteNotefilesRequest() // DeleteNotefilesRequest | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.DisableDevice(context.Background(), projectOrProductUID, deviceUID).Execute() + r, err := apiClient.DeviceAPI.DeleteNotefiles(context.Background(), projectOrProductUID, deviceUID).DeleteNotefilesRequest(deleteNotefilesRequest).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DisableDevice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteNotefiles``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -470,11 +469,13 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiDisableDeviceRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteNotefilesRequest struct via the builder pattern | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +**deleteNotefilesRequest** | [**DeleteNotefilesRequest**](DeleteNotefilesRequest.md) | | + ### Return type (empty response body) @@ -485,16 +486,16 @@ Other parameters are passed through a pointer to a apiDisableDeviceRequest struc ### HTTP request headers -- **Content-Type**: Not defined +- **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) -## DisableDeviceConnectivityAssurance +## DisableDevice -> DisableDeviceConnectivityAssurance(ctx, projectOrProductUID, deviceUID).Execute() +> DisableDevice(ctx, projectOrProductUID, deviceUID).Execute() ### Example @@ -514,9 +515,9 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.DisableDeviceConnectivityAssurance(context.Background(), projectOrProductUID, deviceUID).Execute() + r, err := apiClient.DeviceAPI.DisableDevice(context.Background(), projectOrProductUID, deviceUID).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DisableDeviceConnectivityAssurance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DisableDevice``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -532,7 +533,7 @@ func main() { ### Other Parameters -Other parameters are passed through a pointer to a apiDisableDeviceConnectivityAssuranceRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDisableDeviceRequest struct via the builder pattern | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | @@ -616,68 +617,6 @@ Other parameters are passed through a pointer to a apiEnableDeviceRequest struct [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## EnableDeviceConnectivityAssurance - -> EnableDeviceConnectivityAssurance(ctx, projectOrProductUID, deviceUID).Execute() - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/blues/notehub-go" -) - -func main() { - projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | - deviceUID := "dev:000000000000000" // string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DeviceAPI.EnableDeviceConnectivityAssurance(context.Background(), projectOrProductUID, deviceUID).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.EnableDeviceConnectivityAssurance``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - -| Name | Type | Description | Notes | -| ----------------------- | ------------------- | --------------------------------------------------------------------------- | ----- | -| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | -| **projectOrProductUID** | **string** | | -| **deviceUID** | **string** | | - -### Other Parameters - -Other parameters are passed through a pointer to a apiEnableDeviceConnectivityAssuranceRequest struct via the builder pattern - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | - -### Return type - -(empty response body) - -### Authorization - -[personalAccessToken](../README.md#personalAccessToken) - -### 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) - ## GetDbNote > GetDbNote200Response GetDbNote(ctx, projectOrProductUID, deviceUID, notefileID, noteID).Delete(delete).Deleted(deleted).Execute() @@ -1344,7 +1283,7 @@ Other parameters are passed through a pointer to a apiGetDevicePublicKeysRequest ## GetDeviceSessions -> GetDeviceSessions200Response GetDeviceSessions(ctx, projectOrProductUID, deviceUID).PageSize(pageSize).PageNum(pageNum).StartDate(startDate).EndDate(endDate).Execute() +> GetDeviceSessions200Response GetDeviceSessions(ctx, projectOrProductUID, deviceUID).PageSize(pageSize).PageNum(pageNum).StartDate(startDate).EndDate(endDate).FirstSync(firstSync).Execute() ### Example @@ -1365,10 +1304,11 @@ func main() { pageNum := int32(56) // int32 | (optional) (default to 1) startDate := int32(1628631763) // int32 | Start date for filtering results, specified as a Unix timestamp (optional) endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) + firstSync := true // bool | When true, filters results to only show first sync sessions (optional) (default to false) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DeviceAPI.GetDeviceSessions(context.Background(), projectOrProductUID, deviceUID).PageSize(pageSize).PageNum(pageNum).StartDate(startDate).EndDate(endDate).Execute() + resp, r, err := apiClient.DeviceAPI.GetDeviceSessions(context.Background(), projectOrProductUID, deviceUID).PageSize(pageSize).PageNum(pageNum).StartDate(startDate).EndDate(endDate).FirstSync(firstSync).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDeviceSessions``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1397,6 +1337,7 @@ Other parameters are passed through a pointer to a apiGetDeviceSessionsRequest s **pageNum** | **int32** | | [default to 1] **startDate** | **int32** | Start date for filtering results, specified as a Unix timestamp | **endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | +**firstSync** | **bool** | When true, filters results to only show first sync sessions | [default to false] ### Return type diff --git a/docs/GetBillingAccount200Response.md b/docs/GetBillingAccount200Response.md new file mode 100644 index 0000000..88b3e22 --- /dev/null +++ b/docs/GetBillingAccount200Response.md @@ -0,0 +1,157 @@ +# GetBillingAccount200Response + +## Properties + +| Name | Type | Description | Notes | +| ------------- | -------------------------------------------------------------------------------------- | ----------- | ---------- | +| **Name** | Pointer to **string** | | [optional] | +| **Owner** | Pointer to **string** | | [optional] | +| **Plan** | Pointer to [**GetBillingAccount200ResponsePlan**](GetBillingAccount200ResponsePlan.md) | | [optional] | +| **Suspended** | Pointer to **bool** | | [optional] | +| **Uid** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetBillingAccount200Response + +`func NewGetBillingAccount200Response() *GetBillingAccount200Response` + +NewGetBillingAccount200Response instantiates a new GetBillingAccount200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetBillingAccount200ResponseWithDefaults + +`func NewGetBillingAccount200ResponseWithDefaults() *GetBillingAccount200Response` + +NewGetBillingAccount200ResponseWithDefaults instantiates a new GetBillingAccount200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *GetBillingAccount200Response) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *GetBillingAccount200Response) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *GetBillingAccount200Response) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *GetBillingAccount200Response) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOwner + +`func (o *GetBillingAccount200Response) GetOwner() string` + +GetOwner returns the Owner field if non-nil, zero value otherwise. + +### GetOwnerOk + +`func (o *GetBillingAccount200Response) GetOwnerOk() (*string, bool)` + +GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOwner + +`func (o *GetBillingAccount200Response) SetOwner(v string)` + +SetOwner sets Owner field to given value. + +### HasOwner + +`func (o *GetBillingAccount200Response) HasOwner() bool` + +HasOwner returns a boolean if a field has been set. + +### GetPlan + +`func (o *GetBillingAccount200Response) GetPlan() GetBillingAccount200ResponsePlan` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *GetBillingAccount200Response) GetPlanOk() (*GetBillingAccount200ResponsePlan, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *GetBillingAccount200Response) SetPlan(v GetBillingAccount200ResponsePlan)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *GetBillingAccount200Response) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetSuspended + +`func (o *GetBillingAccount200Response) GetSuspended() bool` + +GetSuspended returns the Suspended field if non-nil, zero value otherwise. + +### GetSuspendedOk + +`func (o *GetBillingAccount200Response) GetSuspendedOk() (*bool, bool)` + +GetSuspendedOk returns a tuple with the Suspended field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuspended + +`func (o *GetBillingAccount200Response) SetSuspended(v bool)` + +SetSuspended sets Suspended field to given value. + +### HasSuspended + +`func (o *GetBillingAccount200Response) HasSuspended() bool` + +HasSuspended returns a boolean if a field has been set. + +### GetUid + +`func (o *GetBillingAccount200Response) GetUid() string` + +GetUid returns the Uid field if non-nil, zero value otherwise. + +### GetUidOk + +`func (o *GetBillingAccount200Response) GetUidOk() (*string, bool)` + +GetUidOk returns a tuple with the Uid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUid + +`func (o *GetBillingAccount200Response) SetUid(v string)` + +SetUid sets Uid field to given value. + +### HasUid + +`func (o *GetBillingAccount200Response) HasUid() bool` + +HasUid returns a boolean if a field has been set. + +[[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/GetBillingAccount200ResponsePlan.md b/docs/GetBillingAccount200ResponsePlan.md new file mode 100644 index 0000000..bda843e --- /dev/null +++ b/docs/GetBillingAccount200ResponsePlan.md @@ -0,0 +1,157 @@ +# GetBillingAccount200ResponsePlan + +## Properties + +| Name | Type | Description | Notes | +| ------------------ | ------------------------ | ----------- | ---------- | +| **CurrentBalance** | Pointer to **int64** | | [optional] | +| **EndDate** | Pointer to **time.Time** | | [optional] | +| **EventCapacity** | Pointer to **int64** | | [optional] | +| **StartDate** | Pointer to **time.Time** | | [optional] | +| **Type** | Pointer to **string** | | [optional] | + +## Methods + +### NewGetBillingAccount200ResponsePlan + +`func NewGetBillingAccount200ResponsePlan() *GetBillingAccount200ResponsePlan` + +NewGetBillingAccount200ResponsePlan instantiates a new GetBillingAccount200ResponsePlan object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetBillingAccount200ResponsePlanWithDefaults + +`func NewGetBillingAccount200ResponsePlanWithDefaults() *GetBillingAccount200ResponsePlan` + +NewGetBillingAccount200ResponsePlanWithDefaults instantiates a new GetBillingAccount200ResponsePlan object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrentBalance + +`func (o *GetBillingAccount200ResponsePlan) GetCurrentBalance() int64` + +GetCurrentBalance returns the CurrentBalance field if non-nil, zero value otherwise. + +### GetCurrentBalanceOk + +`func (o *GetBillingAccount200ResponsePlan) GetCurrentBalanceOk() (*int64, bool)` + +GetCurrentBalanceOk returns a tuple with the CurrentBalance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrentBalance + +`func (o *GetBillingAccount200ResponsePlan) SetCurrentBalance(v int64)` + +SetCurrentBalance sets CurrentBalance field to given value. + +### HasCurrentBalance + +`func (o *GetBillingAccount200ResponsePlan) HasCurrentBalance() bool` + +HasCurrentBalance returns a boolean if a field has been set. + +### GetEndDate + +`func (o *GetBillingAccount200ResponsePlan) GetEndDate() time.Time` + +GetEndDate returns the EndDate field if non-nil, zero value otherwise. + +### GetEndDateOk + +`func (o *GetBillingAccount200ResponsePlan) GetEndDateOk() (*time.Time, bool)` + +GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndDate + +`func (o *GetBillingAccount200ResponsePlan) SetEndDate(v time.Time)` + +SetEndDate sets EndDate field to given value. + +### HasEndDate + +`func (o *GetBillingAccount200ResponsePlan) HasEndDate() bool` + +HasEndDate returns a boolean if a field has been set. + +### GetEventCapacity + +`func (o *GetBillingAccount200ResponsePlan) GetEventCapacity() int64` + +GetEventCapacity returns the EventCapacity field if non-nil, zero value otherwise. + +### GetEventCapacityOk + +`func (o *GetBillingAccount200ResponsePlan) GetEventCapacityOk() (*int64, bool)` + +GetEventCapacityOk returns a tuple with the EventCapacity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEventCapacity + +`func (o *GetBillingAccount200ResponsePlan) SetEventCapacity(v int64)` + +SetEventCapacity sets EventCapacity field to given value. + +### HasEventCapacity + +`func (o *GetBillingAccount200ResponsePlan) HasEventCapacity() bool` + +HasEventCapacity returns a boolean if a field has been set. + +### GetStartDate + +`func (o *GetBillingAccount200ResponsePlan) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *GetBillingAccount200ResponsePlan) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *GetBillingAccount200ResponsePlan) SetStartDate(v time.Time)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *GetBillingAccount200ResponsePlan) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### GetType + +`func (o *GetBillingAccount200ResponsePlan) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *GetBillingAccount200ResponsePlan) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *GetBillingAccount200ResponsePlan) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *GetBillingAccount200ResponsePlan) HasType() bool` + +HasType returns a boolean if a field has been set. + +[[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/GetBillingAccountBalanceHistory200Response.md b/docs/GetBillingAccountBalanceHistory200Response.md new file mode 100644 index 0000000..825c2cb --- /dev/null +++ b/docs/GetBillingAccountBalanceHistory200Response.md @@ -0,0 +1,53 @@ +# GetBillingAccountBalanceHistory200Response + +## Properties + +| Name | Type | Description | Notes | +| -------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | ---------- | +| **Data** | Pointer to [**[]GetBillingAccountBalanceHistory200ResponseDataInner**](GetBillingAccountBalanceHistory200ResponseDataInner.md) | | [optional] | + +## Methods + +### NewGetBillingAccountBalanceHistory200Response + +`func NewGetBillingAccountBalanceHistory200Response() *GetBillingAccountBalanceHistory200Response` + +NewGetBillingAccountBalanceHistory200Response instantiates a new GetBillingAccountBalanceHistory200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetBillingAccountBalanceHistory200ResponseWithDefaults + +`func NewGetBillingAccountBalanceHistory200ResponseWithDefaults() *GetBillingAccountBalanceHistory200Response` + +NewGetBillingAccountBalanceHistory200ResponseWithDefaults instantiates a new GetBillingAccountBalanceHistory200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *GetBillingAccountBalanceHistory200Response) GetData() []GetBillingAccountBalanceHistory200ResponseDataInner` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *GetBillingAccountBalanceHistory200Response) GetDataOk() (*[]GetBillingAccountBalanceHistory200ResponseDataInner, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *GetBillingAccountBalanceHistory200Response) SetData(v []GetBillingAccountBalanceHistory200ResponseDataInner)` + +SetData sets Data field to given value. + +### HasData + +`func (o *GetBillingAccountBalanceHistory200Response) HasData() bool` + +HasData returns a boolean if a field has been set. + +[[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/GetBillingAccountBalanceHistory200ResponseDataInner.md b/docs/GetBillingAccountBalanceHistory200ResponseDataInner.md new file mode 100644 index 0000000..5cb7724 --- /dev/null +++ b/docs/GetBillingAccountBalanceHistory200ResponseDataInner.md @@ -0,0 +1,67 @@ +# GetBillingAccountBalanceHistory200ResponseDataInner + +## Properties + +| Name | Type | Description | Notes | +| -------------------------- | ------------- | ----------- | ----- | +| **Period** | **time.Time** | | +| **RemainingEventCapacity** | **int64** | | + +## Methods + +### NewGetBillingAccountBalanceHistory200ResponseDataInner + +`func NewGetBillingAccountBalanceHistory200ResponseDataInner(period time.Time, remainingEventCapacity int64, ) *GetBillingAccountBalanceHistory200ResponseDataInner` + +NewGetBillingAccountBalanceHistory200ResponseDataInner instantiates a new GetBillingAccountBalanceHistory200ResponseDataInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetBillingAccountBalanceHistory200ResponseDataInnerWithDefaults + +`func NewGetBillingAccountBalanceHistory200ResponseDataInnerWithDefaults() *GetBillingAccountBalanceHistory200ResponseDataInner` + +NewGetBillingAccountBalanceHistory200ResponseDataInnerWithDefaults instantiates a new GetBillingAccountBalanceHistory200ResponseDataInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPeriod + +`func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetPeriod() time.Time` + +GetPeriod returns the Period field if non-nil, zero value otherwise. + +### GetPeriodOk + +`func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetPeriodOk() (*time.Time, bool)` + +GetPeriodOk returns a tuple with the Period field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeriod + +`func (o *GetBillingAccountBalanceHistory200ResponseDataInner) SetPeriod(v time.Time)` + +SetPeriod sets Period field to given value. + +### GetRemainingEventCapacity + +`func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetRemainingEventCapacity() int64` + +GetRemainingEventCapacity returns the RemainingEventCapacity field if non-nil, zero value otherwise. + +### GetRemainingEventCapacityOk + +`func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetRemainingEventCapacityOk() (*int64, bool)` + +GetRemainingEventCapacityOk returns a tuple with the RemainingEventCapacity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRemainingEventCapacity + +`func (o *GetBillingAccountBalanceHistory200ResponseDataInner) SetRemainingEventCapacity(v int64)` + +SetRemainingEventCapacity sets RemainingEventCapacity field to given value. + +[[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/GetDataUsage200Response.md b/docs/GetDataUsage200Response.md index 333de36..978488f 100644 --- a/docs/GetDataUsage200Response.md +++ b/docs/GetDataUsage200Response.md @@ -2,9 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| -------- | ---------------------------------------------------------------------------------------- | ----------- | ---------- | -| **Data** | Pointer to [**[]GetDataUsage200ResponseDataInner**](GetDataUsage200ResponseDataInner.md) | | [optional] | +| Name | Type | Description | Notes | +| ------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------- | +| **Data** | Pointer to [**[]GetDataUsage200ResponseDataInner**](GetDataUsage200ResponseDataInner.md) | | [optional] | +| **Truncated** | Pointer to **bool** | If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure | [optional] | ## Methods @@ -50,4 +51,29 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### GetTruncated + +`func (o *GetDataUsage200Response) GetTruncated() bool` + +GetTruncated returns the Truncated field if non-nil, zero value otherwise. + +### GetTruncatedOk + +`func (o *GetDataUsage200Response) GetTruncatedOk() (*bool, bool)` + +GetTruncatedOk returns a tuple with the Truncated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTruncated + +`func (o *GetDataUsage200Response) SetTruncated(v bool)` + +SetTruncated sets Truncated field to given value. + +### HasTruncated + +`func (o *GetDataUsage200Response) HasTruncated() bool` + +HasTruncated returns a boolean if a field has been set. + [[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/GetDataUsage200ResponseDataInner.md b/docs/GetDataUsage200ResponseDataInner.md index a81783e..5614b49 100644 --- a/docs/GetDataUsage200ResponseDataInner.md +++ b/docs/GetDataUsage200ResponseDataInner.md @@ -9,7 +9,7 @@ | **DeviceCount** | Pointer to **int32** | the number of devices represented by this data point | [optional] | | **Fleet** | Pointer to **string** | The fleet UID this usage data belongs to (only present when aggregate is 'fleet') | [optional] | | **Iccid** | Pointer to **string** | The ICCID of the cellular SIM card (only present when type is 'cellular') | [optional] | -| **Imsi** | Pointer to **string** | The IMSI of the satellite device (only present when type is 'satellite') | [optional] | +| **Psid** | Pointer to **string** | The PSID (Packet Service ID) of the satellite (or other packet-based device) | [optional] | | **Type** | **string** | The type of connectivity | ## Methods @@ -150,30 +150,30 @@ SetIccid sets Iccid field to given value. HasIccid returns a boolean if a field has been set. -### GetImsi +### GetPsid -`func (o *GetDataUsage200ResponseDataInner) GetImsi() string` +`func (o *GetDataUsage200ResponseDataInner) GetPsid() string` -GetImsi returns the Imsi field if non-nil, zero value otherwise. +GetPsid returns the Psid field if non-nil, zero value otherwise. -### GetImsiOk +### GetPsidOk -`func (o *GetDataUsage200ResponseDataInner) GetImsiOk() (*string, bool)` +`func (o *GetDataUsage200ResponseDataInner) GetPsidOk() (*string, bool)` -GetImsiOk returns a tuple with the Imsi field if it's non-nil, zero value otherwise +GetPsidOk returns a tuple with the Psid field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetImsi +### SetPsid -`func (o *GetDataUsage200ResponseDataInner) SetImsi(v string)` +`func (o *GetDataUsage200ResponseDataInner) SetPsid(v string)` -SetImsi sets Imsi field to given value. +SetPsid sets Psid field to given value. -### HasImsi +### HasPsid -`func (o *GetDataUsage200ResponseDataInner) HasImsi() bool` +`func (o *GetDataUsage200ResponseDataInner) HasPsid() bool` -HasImsi returns a boolean if a field has been set. +HasPsid returns a boolean if a field has been set. ### GetType diff --git a/docs/GetRouteLogsUsage200Response.md b/docs/GetRouteLogsUsage200Response.md index d202936..d9b1b62 100644 --- a/docs/GetRouteLogsUsage200Response.md +++ b/docs/GetRouteLogsUsage200Response.md @@ -2,9 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| ------------- | ------------------------------------------------- | ----------- | ----- | -| **RouteLogs** | [**[]UsageRouteLogsData**](UsageRouteLogsData.md) | | +| Name | Type | Description | Notes | +| ------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------- | +| **RouteLogs** | [**[]UsageRouteLogsData**](UsageRouteLogsData.md) | | +| **Truncated** | Pointer to **bool** | If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure | [optional] | ## Methods @@ -44,4 +45,29 @@ and a boolean to check if the value has been set. SetRouteLogs sets RouteLogs field to given value. +### GetTruncated + +`func (o *GetRouteLogsUsage200Response) GetTruncated() bool` + +GetTruncated returns the Truncated field if non-nil, zero value otherwise. + +### GetTruncatedOk + +`func (o *GetRouteLogsUsage200Response) GetTruncatedOk() (*bool, bool)` + +GetTruncatedOk returns a tuple with the Truncated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTruncated + +`func (o *GetRouteLogsUsage200Response) SetTruncated(v bool)` + +SetTruncated sets Truncated field to given value. + +### HasTruncated + +`func (o *GetRouteLogsUsage200Response) HasTruncated() bool` + +HasTruncated returns a boolean if a field has been set. + [[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/GetSessionsUsage200Response.md b/docs/GetSessionsUsage200Response.md index 9858ea1..99a09db 100644 --- a/docs/GetSessionsUsage200Response.md +++ b/docs/GetSessionsUsage200Response.md @@ -2,15 +2,16 @@ ## Properties -| Name | Type | Description | Notes | -| ------------ | ----------------------------------------------- | ----------- | ----- | -| **Sessions** | [**[]UsageSessionsData**](UsageSessionsData.md) | | +| Name | Type | Description | Notes | +| ------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ | +| **Sessions** | [**[]UsageSessionsData**](UsageSessionsData.md) | | +| **Truncated** | **bool** | If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure | ## Methods ### NewGetSessionsUsage200Response -`func NewGetSessionsUsage200Response(sessions []UsageSessionsData, ) *GetSessionsUsage200Response` +`func NewGetSessionsUsage200Response(sessions []UsageSessionsData, truncated bool, ) *GetSessionsUsage200Response` NewGetSessionsUsage200Response instantiates a new GetSessionsUsage200Response object This constructor will assign default values to properties that have it defined, @@ -44,4 +45,23 @@ and a boolean to check if the value has been set. SetSessions sets Sessions field to given value. +### GetTruncated + +`func (o *GetSessionsUsage200Response) GetTruncated() bool` + +GetTruncated returns the Truncated field if non-nil, zero value otherwise. + +### GetTruncatedOk + +`func (o *GetSessionsUsage200Response) GetTruncatedOk() (*bool, bool)` + +GetTruncatedOk returns a tuple with the Truncated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTruncated + +`func (o *GetSessionsUsage200Response) SetTruncated(v bool)` + +SetTruncated sets Truncated field to given value. + [[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/OAuth2ClientCredentialsRequest.md b/docs/OAuth2ClientCredentialsRequest.md new file mode 100644 index 0000000..34202ac --- /dev/null +++ b/docs/OAuth2ClientCredentialsRequest.md @@ -0,0 +1,113 @@ +# OAuth2ClientCredentialsRequest + +## Properties + +| Name | Type | Description | Notes | +| ---------------- | --------------------- | ----------------------- | ---------- | +| **ClientId** | **string** | | +| **ClientSecret** | **string** | | +| **GrantType** | **string** | | +| **Scope** | Pointer to **string** | Space-delimited scopes. | [optional] | + +## Methods + +### NewOAuth2ClientCredentialsRequest + +`func NewOAuth2ClientCredentialsRequest(clientId string, clientSecret string, grantType string, ) *OAuth2ClientCredentialsRequest` + +NewOAuth2ClientCredentialsRequest instantiates a new OAuth2ClientCredentialsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOAuth2ClientCredentialsRequestWithDefaults + +`func NewOAuth2ClientCredentialsRequestWithDefaults() *OAuth2ClientCredentialsRequest` + +NewOAuth2ClientCredentialsRequestWithDefaults instantiates a new OAuth2ClientCredentialsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *OAuth2ClientCredentialsRequest) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *OAuth2ClientCredentialsRequest) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *OAuth2ClientCredentialsRequest) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + +### GetClientSecret + +`func (o *OAuth2ClientCredentialsRequest) GetClientSecret() string` + +GetClientSecret returns the ClientSecret field if non-nil, zero value otherwise. + +### GetClientSecretOk + +`func (o *OAuth2ClientCredentialsRequest) GetClientSecretOk() (*string, bool)` + +GetClientSecretOk returns a tuple with the ClientSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientSecret + +`func (o *OAuth2ClientCredentialsRequest) SetClientSecret(v string)` + +SetClientSecret sets ClientSecret field to given value. + +### GetGrantType + +`func (o *OAuth2ClientCredentialsRequest) GetGrantType() string` + +GetGrantType returns the GrantType field if non-nil, zero value otherwise. + +### GetGrantTypeOk + +`func (o *OAuth2ClientCredentialsRequest) GetGrantTypeOk() (*string, bool)` + +GetGrantTypeOk returns a tuple with the GrantType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrantType + +`func (o *OAuth2ClientCredentialsRequest) SetGrantType(v string)` + +SetGrantType sets GrantType field to given value. + +### GetScope + +`func (o *OAuth2ClientCredentialsRequest) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *OAuth2ClientCredentialsRequest) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *OAuth2ClientCredentialsRequest) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *OAuth2ClientCredentialsRequest) HasScope() bool` + +HasScope returns a boolean if a field has been set. + +[[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/ProjectAPI.md b/docs/ProjectAPI.md index 110cb6b..b3d0576 100644 --- a/docs/ProjectAPI.md +++ b/docs/ProjectAPI.md @@ -2,8 +2,8 @@ All URIs are relative to *https://api.notefile.net* -| Method | HTTP request | Description | -| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------- | +| Method | HTTP request | Description | +| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------- | | [**AddDeviceToFleets**](ProjectAPI.md#AddDeviceToFleets) | **Put** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | | [**CloneProject**](ProjectAPI.md#CloneProject) | **Post** /v1/projects/{projectOrProductUID}/clone | | [**CreateFleet**](ProjectAPI.md#CreateFleet) | **Post** /v1/projects/{projectOrProductUID}/fleets | @@ -16,7 +16,9 @@ All URIs are relative to *https://api.notefile.net* | [**DeleteProject**](ProjectAPI.md#DeleteProject) | **Delete** /v1/projects/{projectOrProductUID} | | [**DeleteProjectEnvironmentVariable**](ProjectAPI.md#DeleteProjectEnvironmentVariable) | **Delete** /v1/projects/{projectOrProductUID}/environment_variables/{key} | | [**DisableGlobalEventTransformation**](ProjectAPI.md#DisableGlobalEventTransformation) | **Post** /v1/projects/{projectOrProductUID}/global-transformation/disable | +| [**DownloadFirmware**](ProjectAPI.md#DownloadFirmware) | **Get** /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | | [**EnableGlobalEventTransformation**](ProjectAPI.md#EnableGlobalEventTransformation) | **Post** /v1/projects/{projectOrProductUID}/global-transformation/enable | +| [**GetAWSRoleConfig**](ProjectAPI.md#GetAWSRoleConfig) | **Get** /v1/projects/{projectOrProductUID}/aws-role-config | Get AWS role configuration for role-based authentication | | [**GetDeviceDfuHistory**](ProjectAPI.md#GetDeviceDfuHistory) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history | | [**GetDeviceDfuStatus**](ProjectAPI.md#GetDeviceDfuStatus) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status | | [**GetDeviceFleets**](ProjectAPI.md#GetDeviceFleets) | **Get** /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | @@ -24,14 +26,14 @@ All URIs are relative to *https://api.notefile.net* | [**GetDevicesDfuStatus**](ProjectAPI.md#GetDevicesDfuStatus) | **Get** /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status | | [**GetFirmwareInfo**](ProjectAPI.md#GetFirmwareInfo) | **Get** /v1/projects/{projectOrProductUID}/firmware | | [**GetFleet**](ProjectAPI.md#GetFleet) | **Get** /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | -| [**GetFleetEnvironmentHierarchy**](ProjectAPI.md#GetFleetEnvironmentHierarchy) | **Get** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy | Get environment variable hierarchy for a device | +| [**GetFleetEnvironmentHierarchy**](ProjectAPI.md#GetFleetEnvironmentHierarchy) | **Get** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy | Get environment variable hierarchy for a device | | [**GetFleetEnvironmentVariables**](ProjectAPI.md#GetFleetEnvironmentVariables) | **Get** /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | | [**GetFleets**](ProjectAPI.md#GetFleets) | **Get** /v1/projects/{projectOrProductUID}/fleets | -| [**GetNotefileSchemas**](ProjectAPI.md#GetNotefileSchemas) | **Get** /v1/projects/{projectOrProductUID}/schemas | Get variable format for a notefile | +| [**GetNotefileSchemas**](ProjectAPI.md#GetNotefileSchemas) | **Get** /v1/projects/{projectOrProductUID}/schemas | Get variable format for a notefile | | [**GetProducts**](ProjectAPI.md#GetProducts) | **Get** /v1/projects/{projectOrProductUID}/products | | [**GetProject**](ProjectAPI.md#GetProject) | **Get** /v1/projects/{projectOrProductUID} | | [**GetProjectByProduct**](ProjectAPI.md#GetProjectByProduct) | **Get** /v1/products/{productUID}/project | -| [**GetProjectEnvironmentHierarchy**](ProjectAPI.md#GetProjectEnvironmentHierarchy) | **Get** /v1/projects/{projectOrProductUID}/environment_hierarchy | Get environment variable hierarchy for a device | +| [**GetProjectEnvironmentHierarchy**](ProjectAPI.md#GetProjectEnvironmentHierarchy) | **Get** /v1/projects/{projectOrProductUID}/environment_hierarchy | Get environment variable hierarchy for a device | | [**GetProjectEnvironmentVariables**](ProjectAPI.md#GetProjectEnvironmentVariables) | **Get** /v1/projects/{projectOrProductUID}/environment_variables | | [**GetProjectMembers**](ProjectAPI.md#GetProjectMembers) | **Get** /v1/projects/{projectOrProductUID}/members | | [**GetProjects**](ProjectAPI.md#GetProjects) | **Get** /v1/projects | @@ -803,6 +805,72 @@ Other parameters are passed through a pointer to a apiDisableGlobalEventTransfor [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## DownloadFirmware + +> \*os.File DownloadFirmware(ctx, projectOrProductUID, firmwareType, filename).Execute() + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/blues/notehub-go" +) + +func main() { + projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | + firmwareType := "firmwareType_example" // string | + filename := "filename_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectAPI.DownloadFirmware(context.Background(), projectOrProductUID, firmwareType, filename).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.DownloadFirmware``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DownloadFirmware`: *os.File + fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.DownloadFirmware`: %v\n", resp) +} +``` + +### Path Parameters + +| Name | Type | Description | Notes | +| ----------------------- | ------------------- | --------------------------------------------------------------------------- | ----- | +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | +| **projectOrProductUID** | **string** | | +| **firmwareType** | **string** | | +| **filename** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDownloadFirmwareRequest struct via the builder pattern + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +### Return type + +[**\*os.File**](*os.File.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream, 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) + ## EnableGlobalEventTransformation > EnableGlobalEventTransformation(ctx, projectOrProductUID).Execute() @@ -863,6 +931,70 @@ Other parameters are passed through a pointer to a apiEnableGlobalEventTransform [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## GetAWSRoleConfig + +> AWSRoleConfig GetAWSRoleConfig(ctx, projectOrProductUID).Execute() + +Get AWS role configuration for role-based authentication + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/blues/notehub-go" +) + +func main() { + projectOrProductUID := "app:2606f411-dea6-44a0-9743-1130f57d77d8" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectAPI.GetAWSRoleConfig(context.Background(), projectOrProductUID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.GetAWSRoleConfig``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAWSRoleConfig`: AWSRoleConfig + fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.GetAWSRoleConfig`: %v\n", resp) +} +``` + +### Path Parameters + +| Name | Type | Description | Notes | +| ----------------------- | ------------------- | --------------------------------------------------------------------------- | ----- | +| **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. | +| **projectOrProductUID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAWSRoleConfigRequest struct via the builder pattern + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +### Return type + +[**AWSRoleConfig**](AWSRoleConfig.md) + +### Authorization + +[personalAccessToken](../README.md#personalAccessToken) + +### 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) + ## GetDeviceDfuHistory > DeviceDfuHistory GetDeviceDfuHistory(ctx, projectOrProductUID, deviceUID, firmwareType).Execute() @@ -1243,7 +1375,7 @@ Other parameters are passed through a pointer to a apiGetDevicesDfuStatusRequest ## GetFirmwareInfo -> []FirmwareInfo GetFirmwareInfo(ctx, projectOrProductUID).Product(product).FirmwareType(firmwareType).Version(version).Target(target).Filename(filename).Md5(md5).Unpublished(unpublished).Execute() +> []FirmwareInfo GetFirmwareInfo(ctx, projectOrProductUID).Product(product).FirmwareType(firmwareType).Version(version).Target(target).Filename(filename).Md5(md5).Unpublished(unpublished).SortBy(sortBy).SortOrder(sortOrder).Execute() ### Example @@ -1266,10 +1398,12 @@ func main() { filename := "notecard-7.2.2.16518$20240410043100.bin" // string | (optional) md5 := "md5_example" // string | (optional) unpublished := true // bool | (optional) + sortBy := "sortBy_example" // string | Field to sort by (optional) (default to "created") + sortOrder := "sortOrder_example" // string | Sort order (asc for ascending, desc for descending) (optional) (default to "desc") configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ProjectAPI.GetFirmwareInfo(context.Background(), projectOrProductUID).Product(product).FirmwareType(firmwareType).Version(version).Target(target).Filename(filename).Md5(md5).Unpublished(unpublished).Execute() + resp, r, err := apiClient.ProjectAPI.GetFirmwareInfo(context.Background(), projectOrProductUID).Product(product).FirmwareType(firmwareType).Version(version).Target(target).Filename(filename).Md5(md5).Unpublished(unpublished).SortBy(sortBy).SortOrder(sortOrder).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.GetFirmwareInfo``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -1300,6 +1434,8 @@ Other parameters are passed through a pointer to a apiGetFirmwareInfoRequest str **filename** | **string** | | **md5** | **string** | | **unpublished** | **bool** | | +**sortBy** | **string** | Field to sort by | [default to "created"] +**sortOrder** | **string** | Sort order (asc for ascending, desc for descending) | [default to "desc"] ### Return type diff --git a/docs/RouteAPI.md b/docs/RouteAPI.md index e7d64b6..a935932 100644 --- a/docs/RouteAPI.md +++ b/docs/RouteAPI.md @@ -204,7 +204,7 @@ Other parameters are passed through a pointer to a apiGetRouteRequest struct via ## GetRouteLogsByRoute -> []RouteLog GetRouteLogsByRoute(ctx, projectOrProductUID, routeUID).PageSize(pageSize).PageNum(pageNum).DeviceUID(deviceUID).SortBy(sortBy).SortOrder(sortOrder).StartDate(startDate).EndDate(endDate).SystemFilesOnly(systemFilesOnly).MostRecentOnly(mostRecentOnly).Files(files).Execute() +> []RouteLog GetRouteLogsByRoute(ctx, projectOrProductUID, routeUID).PageSize(pageSize).PageNum(pageNum).DeviceUID(deviceUID).SortBy(sortBy).SortOrder(sortOrder).StartDate(startDate).EndDate(endDate).SystemFilesOnly(systemFilesOnly).MostRecentOnly(mostRecentOnly).Files(files).RoutingStatus(routingStatus).ResponseStatus(responseStatus).Execute() ### Example @@ -231,10 +231,12 @@ func main() { systemFilesOnly := true // bool | (optional) mostRecentOnly := true // bool | (optional) files := "_health.qo, data.qo" // string | (optional) + routingStatus := []string{"RoutingStatus_example"} // []string | (optional) + responseStatus := []string{"Inner_example"} // []string | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.RouteAPI.GetRouteLogsByRoute(context.Background(), projectOrProductUID, routeUID).PageSize(pageSize).PageNum(pageNum).DeviceUID(deviceUID).SortBy(sortBy).SortOrder(sortOrder).StartDate(startDate).EndDate(endDate).SystemFilesOnly(systemFilesOnly).MostRecentOnly(mostRecentOnly).Files(files).Execute() + resp, r, err := apiClient.RouteAPI.GetRouteLogsByRoute(context.Background(), projectOrProductUID, routeUID).PageSize(pageSize).PageNum(pageNum).DeviceUID(deviceUID).SortBy(sortBy).SortOrder(sortOrder).StartDate(startDate).EndDate(endDate).SystemFilesOnly(systemFilesOnly).MostRecentOnly(mostRecentOnly).Files(files).RoutingStatus(routingStatus).ResponseStatus(responseStatus).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `RouteAPI.GetRouteLogsByRoute``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -269,6 +271,8 @@ Other parameters are passed through a pointer to a apiGetRouteLogsByRouteRequest **systemFilesOnly** | **bool** | | **mostRecentOnly** | **bool** | | **files** | **string** | | +**routingStatus** | **[]string** | | +**responseStatus** | **[]string** | | ### Return type diff --git a/docs/SatelliteDataUsage.md b/docs/SatelliteDataUsage.md new file mode 100644 index 0000000..a90ebcd --- /dev/null +++ b/docs/SatelliteDataUsage.md @@ -0,0 +1,107 @@ +# SatelliteDataUsage + +## Properties + +| Name | Type | Description | Notes | +| --------------------- | --------- | -------------------------------- | ----- | +| **BytesRemaining** | **int64** | Bytes remaining in the plan | +| **BytesTotal** | **int64** | Total bytes included in the plan | +| **BytesUsed** | **int64** | Bytes used to date | +| **BytesUsedBillable** | **int64** | Billable bytes used to date | + +## Methods + +### NewSatelliteDataUsage + +`func NewSatelliteDataUsage(bytesRemaining int64, bytesTotal int64, bytesUsed int64, bytesUsedBillable int64, ) *SatelliteDataUsage` + +NewSatelliteDataUsage instantiates a new SatelliteDataUsage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSatelliteDataUsageWithDefaults + +`func NewSatelliteDataUsageWithDefaults() *SatelliteDataUsage` + +NewSatelliteDataUsageWithDefaults instantiates a new SatelliteDataUsage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBytesRemaining + +`func (o *SatelliteDataUsage) GetBytesRemaining() int64` + +GetBytesRemaining returns the BytesRemaining field if non-nil, zero value otherwise. + +### GetBytesRemainingOk + +`func (o *SatelliteDataUsage) GetBytesRemainingOk() (*int64, bool)` + +GetBytesRemainingOk returns a tuple with the BytesRemaining field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBytesRemaining + +`func (o *SatelliteDataUsage) SetBytesRemaining(v int64)` + +SetBytesRemaining sets BytesRemaining field to given value. + +### GetBytesTotal + +`func (o *SatelliteDataUsage) GetBytesTotal() int64` + +GetBytesTotal returns the BytesTotal field if non-nil, zero value otherwise. + +### GetBytesTotalOk + +`func (o *SatelliteDataUsage) GetBytesTotalOk() (*int64, bool)` + +GetBytesTotalOk returns a tuple with the BytesTotal field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBytesTotal + +`func (o *SatelliteDataUsage) SetBytesTotal(v int64)` + +SetBytesTotal sets BytesTotal field to given value. + +### GetBytesUsed + +`func (o *SatelliteDataUsage) GetBytesUsed() int64` + +GetBytesUsed returns the BytesUsed field if non-nil, zero value otherwise. + +### GetBytesUsedOk + +`func (o *SatelliteDataUsage) GetBytesUsedOk() (*int64, bool)` + +GetBytesUsedOk returns a tuple with the BytesUsed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBytesUsed + +`func (o *SatelliteDataUsage) SetBytesUsed(v int64)` + +SetBytesUsed sets BytesUsed field to given value. + +### GetBytesUsedBillable + +`func (o *SatelliteDataUsage) GetBytesUsedBillable() int64` + +GetBytesUsedBillable returns the BytesUsedBillable field if non-nil, zero value otherwise. + +### GetBytesUsedBillableOk + +`func (o *SatelliteDataUsage) GetBytesUsedBillableOk() (*int64, bool)` + +GetBytesUsedBillableOk returns a tuple with the BytesUsedBillable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBytesUsedBillable + +`func (o *SatelliteDataUsage) SetBytesUsedBillable(v int64)` + +SetBytesUsedBillable sets BytesUsedBillable field to given value. + +[[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/SatellitePlan.md b/docs/SatellitePlan.md index 82d7de7..5803bfa 100644 --- a/docs/SatellitePlan.md +++ b/docs/SatellitePlan.md @@ -2,13 +2,14 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | ---------------------------------------- | ----------------------------------------------------------- | ---------- | -| **Activated** | **int64** | Activation date of the satellite plan as Unix timestamp | -| **BillableBytes** | Pointer to [**DataUsage**](DataUsage.md) | | [optional] | -| **LastUpdated** | Pointer to **int64** | Time this plan information was last updated | [optional] | -| **NtnProvider** | **string** | Non-Terrestrial Network provider name | -| **Psid** | **string** | Provider-specific identifier for the satellite subscription | +| Name | Type | Description | Notes | +| ------------------------ | ---------------------------------------------------------- | ----------------------------------------------------------- | ---------- | +| **Activated** | **int64** | Activation date of the satellite plan as Unix timestamp | +| **LastSessionAt** | Pointer to **int64** | When this Starnote last had a session | [optional] | +| **MinimumBillableBytes** | Pointer to **int64** | Minimum billable bytes | [optional] | +| **NtnProvider** | **string** | Non-Terrestrial Network provider name | +| **Psid** | **string** | Provider-specific identifier for the satellite subscription | +| **SatelliteDataUsage** | Pointer to [**SatelliteDataUsage**](SatelliteDataUsage.md) | | [optional] | ## Methods @@ -48,55 +49,55 @@ and a boolean to check if the value has been set. SetActivated sets Activated field to given value. -### GetBillableBytes +### GetLastSessionAt -`func (o *SatellitePlan) GetBillableBytes() DataUsage` +`func (o *SatellitePlan) GetLastSessionAt() int64` -GetBillableBytes returns the BillableBytes field if non-nil, zero value otherwise. +GetLastSessionAt returns the LastSessionAt field if non-nil, zero value otherwise. -### GetBillableBytesOk +### GetLastSessionAtOk -`func (o *SatellitePlan) GetBillableBytesOk() (*DataUsage, bool)` +`func (o *SatellitePlan) GetLastSessionAtOk() (*int64, bool)` -GetBillableBytesOk returns a tuple with the BillableBytes field if it's non-nil, zero value otherwise +GetLastSessionAtOk returns a tuple with the LastSessionAt field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetBillableBytes +### SetLastSessionAt -`func (o *SatellitePlan) SetBillableBytes(v DataUsage)` +`func (o *SatellitePlan) SetLastSessionAt(v int64)` -SetBillableBytes sets BillableBytes field to given value. +SetLastSessionAt sets LastSessionAt field to given value. -### HasBillableBytes +### HasLastSessionAt -`func (o *SatellitePlan) HasBillableBytes() bool` +`func (o *SatellitePlan) HasLastSessionAt() bool` -HasBillableBytes returns a boolean if a field has been set. +HasLastSessionAt returns a boolean if a field has been set. -### GetLastUpdated +### GetMinimumBillableBytes -`func (o *SatellitePlan) GetLastUpdated() int64` +`func (o *SatellitePlan) GetMinimumBillableBytes() int64` -GetLastUpdated returns the LastUpdated field if non-nil, zero value otherwise. +GetMinimumBillableBytes returns the MinimumBillableBytes field if non-nil, zero value otherwise. -### GetLastUpdatedOk +### GetMinimumBillableBytesOk -`func (o *SatellitePlan) GetLastUpdatedOk() (*int64, bool)` +`func (o *SatellitePlan) GetMinimumBillableBytesOk() (*int64, bool)` -GetLastUpdatedOk returns a tuple with the LastUpdated field if it's non-nil, zero value otherwise +GetMinimumBillableBytesOk returns a tuple with the MinimumBillableBytes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastUpdated +### SetMinimumBillableBytes -`func (o *SatellitePlan) SetLastUpdated(v int64)` +`func (o *SatellitePlan) SetMinimumBillableBytes(v int64)` -SetLastUpdated sets LastUpdated field to given value. +SetMinimumBillableBytes sets MinimumBillableBytes field to given value. -### HasLastUpdated +### HasMinimumBillableBytes -`func (o *SatellitePlan) HasLastUpdated() bool` +`func (o *SatellitePlan) HasMinimumBillableBytes() bool` -HasLastUpdated returns a boolean if a field has been set. +HasMinimumBillableBytes returns a boolean if a field has been set. ### GetNtnProvider @@ -136,4 +137,29 @@ and a boolean to check if the value has been set. SetPsid sets Psid field to given value. +### GetSatelliteDataUsage + +`func (o *SatellitePlan) GetSatelliteDataUsage() SatelliteDataUsage` + +GetSatelliteDataUsage returns the SatelliteDataUsage field if non-nil, zero value otherwise. + +### GetSatelliteDataUsageOk + +`func (o *SatellitePlan) GetSatelliteDataUsageOk() (*SatelliteDataUsage, bool)` + +GetSatelliteDataUsageOk returns a tuple with the SatelliteDataUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSatelliteDataUsage + +`func (o *SatellitePlan) SetSatelliteDataUsage(v SatelliteDataUsage)` + +SetSatelliteDataUsage sets SatelliteDataUsage field to given value. + +### HasSatelliteDataUsage + +`func (o *SatellitePlan) HasSatelliteDataUsage() bool` + +HasSatelliteDataUsage returns a boolean if a field has been set. + [[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/UsageAPI.md b/docs/UsageAPI.md index f69942a..e24835d 100644 --- a/docs/UsageAPI.md +++ b/docs/UsageAPI.md @@ -11,7 +11,7 @@ All URIs are relative to *https://api.notefile.net* ## GetDataUsage -> GetDataUsage200Response GetDataUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Aggregate(aggregate).Execute() +> GetDataUsage200Response GetDataUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Limit(limit).Aggregate(aggregate).Execute() ### Example @@ -32,11 +32,12 @@ func main() { endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) deviceUID := []string{"Inner_example"} // []string | A Device UID. (optional) fleetUID := []string{"Inner_example"} // []string | Filter by Fleet UID (optional) + limit := int32(56) // int32 | Limit the number of data points returned (optional) (default to 200000) aggregate := "aggregate_example" // string | Aggregation level for results (optional) (default to "device") configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.GetDataUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Aggregate(aggregate).Execute() + resp, r, err := apiClient.UsageAPI.GetDataUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Limit(limit).Aggregate(aggregate).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.GetDataUsage``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -65,6 +66,7 @@ Other parameters are passed through a pointer to a apiGetDataUsageRequest struct **endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | **deviceUID** | **[]string** | A Device UID. | **fleetUID** | **[]string** | Filter by Fleet UID | +**limit** | **int32** | Limit the number of data points returned | [default to 200000] **aggregate** | **string** | Aggregation level for results | [default to "device"] ### Return type @@ -86,7 +88,7 @@ Other parameters are passed through a pointer to a apiGetDataUsageRequest struct ## GetEventsUsage -> UsageEventsResponse GetEventsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Aggregate(aggregate).Notefile(notefile).SkipRecentData(skipRecentData).IncludeNotefiles(includeNotefiles).Execute() +> UsageEventsResponse GetEventsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Limit(limit).Aggregate(aggregate).Notefile(notefile).SkipRecentData(skipRecentData).IncludeNotefiles(includeNotefiles).Execute() ### Example @@ -107,6 +109,7 @@ func main() { endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) deviceUID := []string{"Inner_example"} // []string | A Device UID. (optional) fleetUID := []string{"Inner_example"} // []string | Filter by Fleet UID (optional) + limit := int32(56) // int32 | Limit the number of data points returned (optional) (default to 200000) aggregate := "aggregate_example" // string | Aggregation level for results (optional) (default to "device") notefile := []string{"Inner_example"} // []string | Filter to specific notefiles (optional) skipRecentData := true // bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to false) @@ -114,7 +117,7 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.GetEventsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Aggregate(aggregate).Notefile(notefile).SkipRecentData(skipRecentData).IncludeNotefiles(includeNotefiles).Execute() + resp, r, err := apiClient.UsageAPI.GetEventsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Limit(limit).Aggregate(aggregate).Notefile(notefile).SkipRecentData(skipRecentData).IncludeNotefiles(includeNotefiles).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.GetEventsUsage``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -143,6 +146,7 @@ Other parameters are passed through a pointer to a apiGetEventsUsageRequest stru **endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | **deviceUID** | **[]string** | A Device UID. | **fleetUID** | **[]string** | Filter by Fleet UID | +**limit** | **int32** | Limit the number of data points returned | [default to 200000] **aggregate** | **string** | Aggregation level for results | [default to "device"] **notefile** | **[]string** | Filter to specific notefiles | **skipRecentData** | **bool** | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [default to false] @@ -167,7 +171,7 @@ Other parameters are passed through a pointer to a apiGetEventsUsageRequest stru ## GetRouteLogsUsage -> GetRouteLogsUsage200Response GetRouteLogsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() +> GetRouteLogsUsage200Response GetRouteLogsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Limit(limit).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() ### Example @@ -187,12 +191,13 @@ func main() { startDate := int32(1628631763) // int32 | Start date for filtering results, specified as a Unix timestamp (optional) endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) routeUID := []string{"Inner_example"} // []string | A Route UID. (optional) + limit := int32(56) // int32 | Limit the number of data points returned (optional) (default to 200000) aggregate := "aggregate_example" // string | Aggregation level for results (optional) (default to "route") skipRecentData := true // bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to false) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.GetRouteLogsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() + resp, r, err := apiClient.UsageAPI.GetRouteLogsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).RouteUID(routeUID).Limit(limit).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.GetRouteLogsUsage``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -220,6 +225,7 @@ Other parameters are passed through a pointer to a apiGetRouteLogsUsageRequest s **startDate** | **int32** | Start date for filtering results, specified as a Unix timestamp | **endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | **routeUID** | **[]string** | A Route UID. | +**limit** | **int32** | Limit the number of data points returned | [default to 200000] **aggregate** | **string** | Aggregation level for results | [default to "route"] **skipRecentData** | **bool** | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [default to false] @@ -242,7 +248,7 @@ Other parameters are passed through a pointer to a apiGetRouteLogsUsageRequest s ## GetSessionsUsage -> GetSessionsUsage200Response GetSessionsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() +> GetSessionsUsage200Response GetSessionsUsage(ctx, projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Limit(limit).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() ### Example @@ -263,12 +269,13 @@ func main() { endDate := int32(1657894210) // int32 | End date for filtering results, specified as a Unix timestamp (optional) deviceUID := []string{"Inner_example"} // []string | A Device UID. (optional) fleetUID := []string{"Inner_example"} // []string | Filter by Fleet UID (optional) + limit := int32(56) // int32 | Limit the number of data points returned (optional) (default to 200000) aggregate := "aggregate_example" // string | Aggregation level for results (optional) (default to "device") skipRecentData := true // bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to false) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.GetSessionsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() + resp, r, err := apiClient.UsageAPI.GetSessionsUsage(context.Background(), projectOrProductUID).Period(period).StartDate(startDate).EndDate(endDate).DeviceUID(deviceUID).FleetUID(fleetUID).Limit(limit).Aggregate(aggregate).SkipRecentData(skipRecentData).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.GetSessionsUsage``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -297,6 +304,7 @@ Other parameters are passed through a pointer to a apiGetSessionsUsageRequest st **endDate** | **int32** | End date for filtering results, specified as a Unix timestamp | **deviceUID** | **[]string** | A Device UID. | **fleetUID** | **[]string** | Filter by Fleet UID | +**limit** | **int32** | Limit the number of data points returned | [default to 200000] **aggregate** | **string** | Aggregation level for results | [default to "device"] **skipRecentData** | **bool** | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [default to false] diff --git a/docs/UsageData.md b/docs/UsageData.md index 914394c..6d71277 100644 --- a/docs/UsageData.md +++ b/docs/UsageData.md @@ -2,12 +2,17 @@ ## Properties -| Name | Type | Description | Notes | -| ----------------- | -------------------- | ----------- | ---------- | -| **BytesReceived** | Pointer to **int64** | | [optional] | -| **BytesSent** | Pointer to **int64** | | [optional] | -| **Period** | **time.Time** | | -| **TotalBytes** | **int64** | | +| Name | Type | Description | Notes | +| ------------------------- | -------------------- | --------------------------------------------------------- | ---------- | +| **BillableBytesTotal** | Pointer to **int64** | Total billable bytes (only for packet-based protocols) | [optional] | +| **DownlinkBytes** | Pointer to **int64** | | [optional] | +| **DownlinkBytesBillable** | Pointer to **int64** | Billable downlink bytes (only for packet-based protocols) | [optional] | +| **DownlinkPackets** | Pointer to **int64** | Downlink packets (only for packet-based protocols) | [optional] | +| **Period** | **time.Time** | | +| **TotalBytes** | **int64** | | +| **UplinkBytes** | Pointer to **int64** | | [optional] | +| **UplinkBytesBillable** | Pointer to **int64** | Billable uplink bytes (only for packet-based protocols) | [optional] | +| **UplinkPackets** | Pointer to **int64** | Uplink packets (only for packet-based protocols) | [optional] | ## Methods @@ -28,55 +33,105 @@ NewUsageDataWithDefaults instantiates a new UsageData object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetBytesReceived +### GetBillableBytesTotal -`func (o *UsageData) GetBytesReceived() int64` +`func (o *UsageData) GetBillableBytesTotal() int64` -GetBytesReceived returns the BytesReceived field if non-nil, zero value otherwise. +GetBillableBytesTotal returns the BillableBytesTotal field if non-nil, zero value otherwise. -### GetBytesReceivedOk +### GetBillableBytesTotalOk -`func (o *UsageData) GetBytesReceivedOk() (*int64, bool)` +`func (o *UsageData) GetBillableBytesTotalOk() (*int64, bool)` -GetBytesReceivedOk returns a tuple with the BytesReceived field if it's non-nil, zero value otherwise +GetBillableBytesTotalOk returns a tuple with the BillableBytesTotal field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetBytesReceived +### SetBillableBytesTotal -`func (o *UsageData) SetBytesReceived(v int64)` +`func (o *UsageData) SetBillableBytesTotal(v int64)` -SetBytesReceived sets BytesReceived field to given value. +SetBillableBytesTotal sets BillableBytesTotal field to given value. -### HasBytesReceived +### HasBillableBytesTotal -`func (o *UsageData) HasBytesReceived() bool` +`func (o *UsageData) HasBillableBytesTotal() bool` -HasBytesReceived returns a boolean if a field has been set. +HasBillableBytesTotal returns a boolean if a field has been set. -### GetBytesSent +### GetDownlinkBytes -`func (o *UsageData) GetBytesSent() int64` +`func (o *UsageData) GetDownlinkBytes() int64` -GetBytesSent returns the BytesSent field if non-nil, zero value otherwise. +GetDownlinkBytes returns the DownlinkBytes field if non-nil, zero value otherwise. -### GetBytesSentOk +### GetDownlinkBytesOk -`func (o *UsageData) GetBytesSentOk() (*int64, bool)` +`func (o *UsageData) GetDownlinkBytesOk() (*int64, bool)` -GetBytesSentOk returns a tuple with the BytesSent field if it's non-nil, zero value otherwise +GetDownlinkBytesOk returns a tuple with the DownlinkBytes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetBytesSent +### SetDownlinkBytes -`func (o *UsageData) SetBytesSent(v int64)` +`func (o *UsageData) SetDownlinkBytes(v int64)` -SetBytesSent sets BytesSent field to given value. +SetDownlinkBytes sets DownlinkBytes field to given value. -### HasBytesSent +### HasDownlinkBytes -`func (o *UsageData) HasBytesSent() bool` +`func (o *UsageData) HasDownlinkBytes() bool` -HasBytesSent returns a boolean if a field has been set. +HasDownlinkBytes returns a boolean if a field has been set. + +### GetDownlinkBytesBillable + +`func (o *UsageData) GetDownlinkBytesBillable() int64` + +GetDownlinkBytesBillable returns the DownlinkBytesBillable field if non-nil, zero value otherwise. + +### GetDownlinkBytesBillableOk + +`func (o *UsageData) GetDownlinkBytesBillableOk() (*int64, bool)` + +GetDownlinkBytesBillableOk returns a tuple with the DownlinkBytesBillable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDownlinkBytesBillable + +`func (o *UsageData) SetDownlinkBytesBillable(v int64)` + +SetDownlinkBytesBillable sets DownlinkBytesBillable field to given value. + +### HasDownlinkBytesBillable + +`func (o *UsageData) HasDownlinkBytesBillable() bool` + +HasDownlinkBytesBillable returns a boolean if a field has been set. + +### GetDownlinkPackets + +`func (o *UsageData) GetDownlinkPackets() int64` + +GetDownlinkPackets returns the DownlinkPackets field if non-nil, zero value otherwise. + +### GetDownlinkPacketsOk + +`func (o *UsageData) GetDownlinkPacketsOk() (*int64, bool)` + +GetDownlinkPacketsOk returns a tuple with the DownlinkPackets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDownlinkPackets + +`func (o *UsageData) SetDownlinkPackets(v int64)` + +SetDownlinkPackets sets DownlinkPackets field to given value. + +### HasDownlinkPackets + +`func (o *UsageData) HasDownlinkPackets() bool` + +HasDownlinkPackets returns a boolean if a field has been set. ### GetPeriod @@ -116,4 +171,79 @@ and a boolean to check if the value has been set. SetTotalBytes sets TotalBytes field to given value. +### GetUplinkBytes + +`func (o *UsageData) GetUplinkBytes() int64` + +GetUplinkBytes returns the UplinkBytes field if non-nil, zero value otherwise. + +### GetUplinkBytesOk + +`func (o *UsageData) GetUplinkBytesOk() (*int64, bool)` + +GetUplinkBytesOk returns a tuple with the UplinkBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUplinkBytes + +`func (o *UsageData) SetUplinkBytes(v int64)` + +SetUplinkBytes sets UplinkBytes field to given value. + +### HasUplinkBytes + +`func (o *UsageData) HasUplinkBytes() bool` + +HasUplinkBytes returns a boolean if a field has been set. + +### GetUplinkBytesBillable + +`func (o *UsageData) GetUplinkBytesBillable() int64` + +GetUplinkBytesBillable returns the UplinkBytesBillable field if non-nil, zero value otherwise. + +### GetUplinkBytesBillableOk + +`func (o *UsageData) GetUplinkBytesBillableOk() (*int64, bool)` + +GetUplinkBytesBillableOk returns a tuple with the UplinkBytesBillable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUplinkBytesBillable + +`func (o *UsageData) SetUplinkBytesBillable(v int64)` + +SetUplinkBytesBillable sets UplinkBytesBillable field to given value. + +### HasUplinkBytesBillable + +`func (o *UsageData) HasUplinkBytesBillable() bool` + +HasUplinkBytesBillable returns a boolean if a field has been set. + +### GetUplinkPackets + +`func (o *UsageData) GetUplinkPackets() int64` + +GetUplinkPackets returns the UplinkPackets field if non-nil, zero value otherwise. + +### GetUplinkPacketsOk + +`func (o *UsageData) GetUplinkPacketsOk() (*int64, bool)` + +GetUplinkPacketsOk returns a tuple with the UplinkPackets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUplinkPackets + +`func (o *UsageData) SetUplinkPackets(v int64)` + +SetUplinkPackets sets UplinkPackets field to given value. + +### HasUplinkPackets + +`func (o *UsageData) HasUplinkPackets() bool` + +HasUplinkPackets returns a boolean if a field has been set. + [[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/UsageEventsData.md b/docs/UsageEventsData.md index 4c8a4a1..3ee5285 100644 --- a/docs/UsageEventsData.md +++ b/docs/UsageEventsData.md @@ -2,16 +2,18 @@ ## Properties -| Name | Type | Description | Notes | -| ------------------ | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -| **Device** | Pointer to **string** | | [optional] | -| **Fleet** | Pointer to **string** | | [optional] | -| **Notefiles** | Pointer to **map[string]int64** | Count of events per notefile. Only present when includeNotefiles=true is specified. | [optional] | -| **Period** | **time.Time** | | -| **PlatformEvents** | **int64** | Total platform events. Platform events are \_log, \_session, \_health, and \_geolocate events some of which are send from the device, some generated by notehub. These events are not billed. | -| **TotalDevices** | **int64** | Total devices represented in this count | -| **TotalEvents** | **int64** | Total events the device sent to notehub, including associated notehub generated events | -| **WatchdogEvents** | **int64** | Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time. | +| Name | Type | Description | Notes | +| --------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | +| **BillableEvents** | Pointer to **int64** | Events that are billable, this include all events except platform events | [optional] | +| **Device** | Pointer to **string** | | [optional] | +| **Fleet** | Pointer to **string** | | [optional] | +| **Notefiles** | Pointer to **map[string]int64** | Count of events per notefile. Only present when includeNotefiles=true is specified. | [optional] | +| **Period** | **time.Time** | | +| **PlatformEvents** | **int64** | Total platform events. Platform events are \_log, \_session, \_health, and \_geolocate events some of which are send from the device, some generated by notehub. These events are not billed. | +| **TotalDaysInPeriod** | Pointer to **int32** | The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future. | [optional] | +| **TotalDevices** | **int64** | Total devices represented in this count | +| **TotalEvents** | **int64** | Total events the device sent to notehub, including associated notehub generated events | +| **WatchdogEvents** | **int64** | Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time. | ## Methods @@ -32,6 +34,31 @@ NewUsageEventsDataWithDefaults instantiates a new UsageEventsData object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetBillableEvents + +`func (o *UsageEventsData) GetBillableEvents() int64` + +GetBillableEvents returns the BillableEvents field if non-nil, zero value otherwise. + +### GetBillableEventsOk + +`func (o *UsageEventsData) GetBillableEventsOk() (*int64, bool)` + +GetBillableEventsOk returns a tuple with the BillableEvents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillableEvents + +`func (o *UsageEventsData) SetBillableEvents(v int64)` + +SetBillableEvents sets BillableEvents field to given value. + +### HasBillableEvents + +`func (o *UsageEventsData) HasBillableEvents() bool` + +HasBillableEvents returns a boolean if a field has been set. + ### GetDevice `func (o *UsageEventsData) GetDevice() string` @@ -145,6 +172,31 @@ and a boolean to check if the value has been set. SetPlatformEvents sets PlatformEvents field to given value. +### GetTotalDaysInPeriod + +`func (o *UsageEventsData) GetTotalDaysInPeriod() int32` + +GetTotalDaysInPeriod returns the TotalDaysInPeriod field if non-nil, zero value otherwise. + +### GetTotalDaysInPeriodOk + +`func (o *UsageEventsData) GetTotalDaysInPeriodOk() (*int32, bool)` + +GetTotalDaysInPeriodOk returns a tuple with the TotalDaysInPeriod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalDaysInPeriod + +`func (o *UsageEventsData) SetTotalDaysInPeriod(v int32)` + +SetTotalDaysInPeriod sets TotalDaysInPeriod field to given value. + +### HasTotalDaysInPeriod + +`func (o *UsageEventsData) HasTotalDaysInPeriod() bool` + +HasTotalDaysInPeriod returns a boolean if a field has been set. + ### GetTotalDevices `func (o *UsageEventsData) GetTotalDevices() int64` diff --git a/docs/UsageEventsResponse.md b/docs/UsageEventsResponse.md index a423a68..a223de9 100644 --- a/docs/UsageEventsResponse.md +++ b/docs/UsageEventsResponse.md @@ -2,9 +2,10 @@ ## Properties -| Name | Type | Description | Notes | -| -------- | ------------------------------------------- | ----------- | ----- | -| **Data** | [**[]UsageEventsData**](UsageEventsData.md) | | +| Name | Type | Description | Notes | +| ------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------- | +| **Data** | [**[]UsageEventsData**](UsageEventsData.md) | | +| **Truncated** | Pointer to **bool** | If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure | [optional] | ## Methods @@ -44,4 +45,29 @@ and a boolean to check if the value has been set. SetData sets Data field to given value. +### GetTruncated + +`func (o *UsageEventsResponse) GetTruncated() bool` + +GetTruncated returns the Truncated field if non-nil, zero value otherwise. + +### GetTruncatedOk + +`func (o *UsageEventsResponse) GetTruncatedOk() (*bool, bool)` + +GetTruncatedOk returns a tuple with the Truncated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTruncated + +`func (o *UsageEventsResponse) SetTruncated(v bool)` + +SetTruncated sets Truncated field to given value. + +### HasTruncated + +`func (o *UsageEventsResponse) HasTruncated() bool` + +HasTruncated returns a boolean if a field has been set. + [[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/UsageSessionsData.md b/docs/UsageSessionsData.md index 55fcc16..12638a6 100644 --- a/docs/UsageSessionsData.md +++ b/docs/UsageSessionsData.md @@ -2,20 +2,21 @@ ## Properties -| Name | Type | Description | Notes | -| ---------------- | --------------------- | ----------- | ---------- | -| **Device** | Pointer to **string** | | [optional] | -| **Fleet** | Pointer to **string** | | [optional] | -| **Period** | **time.Time** | | -| **Sessions** | **int64** | | -| **TotalBytes** | **int64** | | -| **TotalDevices** | **int64** | | +| Name | Type | Description | Notes | +| --------------------- | --------------------- | -------------------------------------------- | ---------- | +| **Device** | Pointer to **string** | | [optional] | +| **FirstSyncSessions** | **int64** | Number of first sync sessions in this period | +| **Fleet** | Pointer to **string** | | [optional] | +| **Period** | **time.Time** | | +| **Sessions** | **int64** | | +| **TotalBytes** | **int64** | | +| **TotalDevices** | **int64** | | ## Methods ### NewUsageSessionsData -`func NewUsageSessionsData(period time.Time, sessions int64, totalBytes int64, totalDevices int64, ) *UsageSessionsData` +`func NewUsageSessionsData(firstSyncSessions int64, period time.Time, sessions int64, totalBytes int64, totalDevices int64, ) *UsageSessionsData` NewUsageSessionsData instantiates a new UsageSessionsData object This constructor will assign default values to properties that have it defined, @@ -55,6 +56,25 @@ SetDevice sets Device field to given value. HasDevice returns a boolean if a field has been set. +### GetFirstSyncSessions + +`func (o *UsageSessionsData) GetFirstSyncSessions() int64` + +GetFirstSyncSessions returns the FirstSyncSessions field if non-nil, zero value otherwise. + +### GetFirstSyncSessionsOk + +`func (o *UsageSessionsData) GetFirstSyncSessionsOk() (*int64, bool)` + +GetFirstSyncSessionsOk returns a tuple with the FirstSyncSessions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstSyncSessions + +`func (o *UsageSessionsData) SetFirstSyncSessions(v int64)` + +SetFirstSyncSessions sets FirstSyncSessions field to given value. + ### GetFleet `func (o *UsageSessionsData) GetFleet() string` diff --git a/model_add_device_to_fleets_request.go b/model_add_device_to_fleets_request.go index b0ba59b..c23dca8 100644 --- a/model_add_device_to_fleets_request.go +++ b/model_add_device_to_fleets_request.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,7 +22,8 @@ var _ MappedNullable = &AddDeviceToFleetsRequest{} // AddDeviceToFleetsRequest struct for AddDeviceToFleetsRequest type AddDeviceToFleetsRequest struct { // The fleetUIDs to add to the device. - FleetUids []string `json:"fleet_uids"` + FleetUids []string `json:"fleet_uids"` + AdditionalProperties map[string]interface{} } type _AddDeviceToFleetsRequest AddDeviceToFleetsRequest @@ -81,6 +81,11 @@ func (o AddDeviceToFleetsRequest) MarshalJSON() ([]byte, error) { func (o AddDeviceToFleetsRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["fleet_uids"] = o.FleetUids + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -108,9 +113,7 @@ func (o *AddDeviceToFleetsRequest) UnmarshalJSON(data []byte) (err error) { varAddDeviceToFleetsRequest := _AddDeviceToFleetsRequest{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varAddDeviceToFleetsRequest) + err = json.Unmarshal(data, &varAddDeviceToFleetsRequest) if err != nil { return err @@ -118,6 +121,13 @@ func (o *AddDeviceToFleetsRequest) UnmarshalJSON(data []byte) (err error) { *o = AddDeviceToFleetsRequest(varAddDeviceToFleetsRequest) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "fleet_uids") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_alert.go b/model_alert.go index b98becb..20a3805 100644 --- a/model_alert.go +++ b/model_alert.go @@ -45,9 +45,12 @@ type Alert struct { // The value that triggered the alert Value *float32 `json:"value,omitempty"` // The version of the alert - Version *int32 `json:"version,omitempty"` + Version *int32 `json:"version,omitempty"` + AdditionalProperties map[string]interface{} } +type _Alert Alert + // NewAlert instantiates a new Alert object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -565,9 +568,48 @@ func (o Alert) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Alert) UnmarshalJSON(data []byte) (err error) { + varAlert := _Alert{} + + err = json.Unmarshal(data, &varAlert) + + if err != nil { + return err + } + + *o = Alert(varAlert) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "alert_source") + delete(additionalProperties, "created_at") + delete(additionalProperties, "data") + delete(additionalProperties, "device_uid") + delete(additionalProperties, "field_name") + delete(additionalProperties, "monitor_name") + delete(additionalProperties, "monitor_type") + delete(additionalProperties, "monitor_uid") + delete(additionalProperties, "notifications") + delete(additionalProperties, "resolved") + delete(additionalProperties, "source") + delete(additionalProperties, "uid") + delete(additionalProperties, "value") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableAlert struct { value *Alert isSet bool diff --git a/model_alert_data_inner.go b/model_alert_data_inner.go index fd80b49..0f15ea5 100644 --- a/model_alert_data_inner.go +++ b/model_alert_data_inner.go @@ -31,9 +31,12 @@ type AlertDataInner struct { // The value that triggered the alert Value *float32 `json:"value,omitempty"` // The time the alert was created - When *string `json:"when,omitempty"` + When *string `json:"when,omitempty"` + AdditionalProperties map[string]interface{} } +type _AlertDataInner AlertDataInner + // NewAlertDataInner instantiates a new AlertDataInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -271,9 +274,40 @@ func (o AlertDataInner) ToMap() (map[string]interface{}, error) { if !IsNil(o.When) { toSerialize["when"] = o.When } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *AlertDataInner) UnmarshalJSON(data []byte) (err error) { + varAlertDataInner := _AlertDataInner{} + + err = json.Unmarshal(data, &varAlertDataInner) + + if err != nil { + return err + } + + *o = AlertDataInner(varAlertDataInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "alert_source") + delete(additionalProperties, "source") + delete(additionalProperties, "source_type") + delete(additionalProperties, "source_uid") + delete(additionalProperties, "value") + delete(additionalProperties, "when") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableAlertDataInner struct { value *AlertDataInner isSet bool diff --git a/model_alert_notifications_inner.go b/model_alert_notifications_inner.go index 9e9c55c..75bc383 100644 --- a/model_alert_notifications_inner.go +++ b/model_alert_notifications_inner.go @@ -25,9 +25,12 @@ type AlertNotificationsInner struct { // The recipients of the notification Recipients *string `json:"recipients,omitempty"` // The status of the notification - Status *float32 `json:"status,omitempty"` + Status *float32 `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _AlertNotificationsInner AlertNotificationsInner + // NewAlertNotificationsInner instantiates a new AlertNotificationsInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o AlertNotificationsInner) ToMap() (map[string]interface{}, error) { if !IsNil(o.Status) { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *AlertNotificationsInner) UnmarshalJSON(data []byte) (err error) { + varAlertNotificationsInner := _AlertNotificationsInner{} + + err = json.Unmarshal(data, &varAlertNotificationsInner) + + if err != nil { + return err + } + + *o = AlertNotificationsInner(varAlertNotificationsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "notification_type") + delete(additionalProperties, "recipients") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableAlertNotificationsInner struct { value *AlertNotificationsInner isSet bool diff --git a/model_aws_role_config.go b/model_aws_role_config.go new file mode 100644 index 0000000..387de38 --- /dev/null +++ b/model_aws_role_config.go @@ -0,0 +1,198 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" + "fmt" +) + +// checks if the AWSRoleConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AWSRoleConfig{} + +// AWSRoleConfig Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes +type AWSRoleConfig struct { + // The Blues AWS Account ID to trust in your IAM role's trust policy + AwsAccountId string `json:"aws_account_id"` + // The External ID to use in your IAM role's trust policy condition + ExternalId string `json:"external_id"` + AdditionalProperties map[string]interface{} +} + +type _AWSRoleConfig AWSRoleConfig + +// NewAWSRoleConfig instantiates a new AWSRoleConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAWSRoleConfig(awsAccountId string, externalId string) *AWSRoleConfig { + this := AWSRoleConfig{} + this.AwsAccountId = awsAccountId + this.ExternalId = externalId + return &this +} + +// NewAWSRoleConfigWithDefaults instantiates a new AWSRoleConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAWSRoleConfigWithDefaults() *AWSRoleConfig { + this := AWSRoleConfig{} + return &this +} + +// GetAwsAccountId returns the AwsAccountId field value +func (o *AWSRoleConfig) GetAwsAccountId() string { + if o == nil { + var ret string + return ret + } + + return o.AwsAccountId +} + +// GetAwsAccountIdOk returns a tuple with the AwsAccountId field value +// and a boolean to check if the value has been set. +func (o *AWSRoleConfig) GetAwsAccountIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AwsAccountId, true +} + +// SetAwsAccountId sets field value +func (o *AWSRoleConfig) SetAwsAccountId(v string) { + o.AwsAccountId = v +} + +// GetExternalId returns the ExternalId field value +func (o *AWSRoleConfig) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *AWSRoleConfig) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *AWSRoleConfig) SetExternalId(v string) { + o.ExternalId = v +} + +func (o AWSRoleConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AWSRoleConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["aws_account_id"] = o.AwsAccountId + toSerialize["external_id"] = o.ExternalId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AWSRoleConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "aws_account_id", + "external_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAWSRoleConfig := _AWSRoleConfig{} + + err = json.Unmarshal(data, &varAWSRoleConfig) + + if err != nil { + return err + } + + *o = AWSRoleConfig(varAWSRoleConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "aws_account_id") + delete(additionalProperties, "external_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAWSRoleConfig struct { + value *AWSRoleConfig + isSet bool +} + +func (v NullableAWSRoleConfig) Get() *AWSRoleConfig { + return v.value +} + +func (v *NullableAWSRoleConfig) Set(val *AWSRoleConfig) { + v.value = val + v.isSet = true +} + +func (v NullableAWSRoleConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableAWSRoleConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAWSRoleConfig(val *AWSRoleConfig) *NullableAWSRoleConfig { + return &NullableAWSRoleConfig{value: val, isSet: true} +} + +func (v NullableAWSRoleConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAWSRoleConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_aws_route.go b/model_aws_route.go index 4a80417..56023cd 100644 --- a/model_aws_route.go +++ b/model_aws_route.go @@ -20,20 +20,22 @@ var _ MappedNullable = &AwsRoute{} // AwsRoute struct for AwsRoute type AwsRoute struct { - AccessKeyId *string `json:"access_key_id,omitempty"` - AccessKeySecret *string `json:"access_key_secret,omitempty"` - Channel *string `json:"channel,omitempty"` - DisableHttpHeaders *bool `json:"disable_http_headers,omitempty"` - Filter *Filter `json:"filter,omitempty"` - Fleets []string `json:"fleets,omitempty"` - HttpHeaders *map[string]string `json:"http_headers,omitempty"` - MessageDeduplicationId *string `json:"message_deduplication_id,omitempty"` - MessageGroupId *string `json:"message_group_id,omitempty"` - Region *string `json:"region,omitempty"` - ThrottleMs *int32 `json:"throttle_ms,omitempty"` - Timeout *int32 `json:"timeout,omitempty"` - Transform *RouteTransformSettings `json:"transform,omitempty"` - Url *string `json:"url,omitempty"` + AccessKeyId *string `json:"access_key_id,omitempty"` + AccessKeySecret *string `json:"access_key_secret,omitempty"` + Channel *string `json:"channel,omitempty"` + DisableHttpHeaders *bool `json:"disable_http_headers,omitempty"` + Filter *Filter `json:"filter,omitempty"` + Fleets []string `json:"fleets,omitempty"` + HttpHeaders *map[string]string `json:"http_headers,omitempty"` + MessageDeduplicationId *string `json:"message_deduplication_id,omitempty"` + MessageGroupId *string `json:"message_group_id,omitempty"` + Region *string `json:"region,omitempty"` + // IAM Role ARN for role-based authentication via STS AssumeRole + RoleArn *string `json:"role_arn,omitempty"` + ThrottleMs *int32 `json:"throttle_ms,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + Transform *RouteTransformSettings `json:"transform,omitempty"` + Url *string `json:"url,omitempty"` } // NewAwsRoute instantiates a new AwsRoute object @@ -373,6 +375,38 @@ func (o *AwsRoute) SetRegion(v string) { o.Region = &v } +// GetRoleArn returns the RoleArn field value if set, zero value otherwise. +func (o *AwsRoute) GetRoleArn() string { + if o == nil || IsNil(o.RoleArn) { + var ret string + return ret + } + return *o.RoleArn +} + +// GetRoleArnOk returns a tuple with the RoleArn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AwsRoute) GetRoleArnOk() (*string, bool) { + if o == nil || IsNil(o.RoleArn) { + return nil, false + } + return o.RoleArn, true +} + +// HasRoleArn returns a boolean if a field has been set. +func (o *AwsRoute) HasRoleArn() bool { + if o != nil && !IsNil(o.RoleArn) { + return true + } + + return false +} + +// SetRoleArn gets a reference to the given string and assigns it to the RoleArn field. +func (o *AwsRoute) SetRoleArn(v string) { + o.RoleArn = &v +} + // GetThrottleMs returns the ThrottleMs field value if set, zero value otherwise. func (o *AwsRoute) GetThrottleMs() int32 { if o == nil || IsNil(o.ThrottleMs) { @@ -541,6 +575,9 @@ func (o AwsRoute) ToMap() (map[string]interface{}, error) { if !IsNil(o.Region) { toSerialize["region"] = o.Region } + if !IsNil(o.RoleArn) { + toSerialize["role_arn"] = o.RoleArn + } if !IsNil(o.ThrottleMs) { toSerialize["throttle_ms"] = o.ThrottleMs } diff --git a/model_billing_account.go b/model_billing_account.go index 7954e0b..46606f7 100644 --- a/model_billing_account.go +++ b/model_billing_account.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,9 +21,10 @@ var _ MappedNullable = &BillingAccount{} // BillingAccount struct for BillingAccount type BillingAccount struct { - Name string `json:"name"` - Role BillingAccountRole `json:"role"` - Uid string `json:"uid"` + Name string `json:"name"` + Role BillingAccountRole `json:"role"` + Uid string `json:"uid"` + AdditionalProperties map[string]interface{} } type _BillingAccount BillingAccount @@ -134,6 +134,11 @@ func (o BillingAccount) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["role"] = o.Role toSerialize["uid"] = o.Uid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -163,9 +168,7 @@ func (o *BillingAccount) UnmarshalJSON(data []byte) (err error) { varBillingAccount := _BillingAccount{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varBillingAccount) + err = json.Unmarshal(data, &varBillingAccount) if err != nil { return err @@ -173,6 +176,15 @@ func (o *BillingAccount) UnmarshalJSON(data []byte) (err error) { *o = BillingAccount(varBillingAccount) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_body.go b/model_body.go index 1c3009a..a1df3e7 100644 --- a/model_body.go +++ b/model_body.go @@ -20,9 +20,12 @@ var _ MappedNullable = &Body{} // Body struct for Body type Body struct { - Body map[string]interface{} `json:"body,omitempty"` + Body map[string]interface{} `json:"body,omitempty"` + AdditionalProperties map[string]interface{} } +type _Body Body + // NewBody instantiates a new Body object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -85,9 +88,35 @@ func (o Body) ToMap() (map[string]interface{}, error) { if !IsNil(o.Body) { toSerialize["body"] = o.Body } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Body) UnmarshalJSON(data []byte) (err error) { + varBody := _Body{} + + err = json.Unmarshal(data, &varBody) + + if err != nil { + return err + } + + *o = Body(varBody) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "body") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableBody struct { value *Body isSet bool diff --git a/model_cellular_plan.go b/model_cellular_plan.go index 75d8f8c..66b684b 100644 --- a/model_cellular_plan.go +++ b/model_cellular_plan.go @@ -33,9 +33,12 @@ type CellularPlan struct { // Total bytes used by this SIM LifetimeUsed *int64 `json:"lifetime_used,omitempty"` // Description of the SIM plan type including data allowance, region, and validity period - PlanType *string `json:"plan_type,omitempty"` + PlanType *string `json:"plan_type,omitempty"` + AdditionalProperties map[string]interface{} } +type _CellularPlan CellularPlan + // NewCellularPlan instantiates a new CellularPlan object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -343,9 +346,42 @@ func (o CellularPlan) ToMap() (map[string]interface{}, error) { if !IsNil(o.PlanType) { toSerialize["plan_type"] = o.PlanType } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *CellularPlan) UnmarshalJSON(data []byte) (err error) { + varCellularPlan := _CellularPlan{} + + err = json.Unmarshal(data, &varCellularPlan) + + if err != nil { + return err + } + + *o = CellularPlan(varCellularPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "activated") + delete(additionalProperties, "data_usage") + delete(additionalProperties, "expires_at") + delete(additionalProperties, "iccid") + delete(additionalProperties, "imsi") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "lifetime_used") + delete(additionalProperties, "plan_type") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCellularPlan struct { value *CellularPlan isSet bool diff --git a/model_clone_project_request.go b/model_clone_project_request.go index 7f10c35..42f8883 100644 --- a/model_clone_project_request.go +++ b/model_clone_project_request.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -29,7 +28,8 @@ type CloneProjectRequest struct { // Whether to disallow the cloning of the routes from the parent project. Default is false if not specified. DisableCloneRoutes *bool `json:"disable_clone_routes,omitempty"` // The label for the project. - Label string `json:"label"` + Label string `json:"label"` + AdditionalProperties map[string]interface{} } type _CloneProjectRequest CloneProjectRequest @@ -183,6 +183,11 @@ func (o CloneProjectRequest) ToMap() (map[string]interface{}, error) { toSerialize["disable_clone_routes"] = o.DisableCloneRoutes } toSerialize["label"] = o.Label + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -211,9 +216,7 @@ func (o *CloneProjectRequest) UnmarshalJSON(data []byte) (err error) { varCloneProjectRequest := _CloneProjectRequest{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCloneProjectRequest) + err = json.Unmarshal(data, &varCloneProjectRequest) if err != nil { return err @@ -221,6 +224,16 @@ func (o *CloneProjectRequest) UnmarshalJSON(data []byte) (err error) { *o = CloneProjectRequest(varCloneProjectRequest) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "billing_account_uid") + delete(additionalProperties, "disable_clone_fleets") + delete(additionalProperties, "disable_clone_routes") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_contact.go b/model_contact.go index 7716a41..ea8d410 100644 --- a/model_contact.go +++ b/model_contact.go @@ -20,12 +20,15 @@ var _ MappedNullable = &Contact{} // Contact struct for Contact type Contact struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - Organization *string `json:"organization,omitempty"` - Role *string `json:"role,omitempty"` + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + Organization *string `json:"organization,omitempty"` + Role *string `json:"role,omitempty"` + AdditionalProperties map[string]interface{} } +type _Contact Contact + // NewContact instantiates a new Contact object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -193,9 +196,38 @@ func (o Contact) ToMap() (map[string]interface{}, error) { if !IsNil(o.Role) { toSerialize["role"] = o.Role } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Contact) UnmarshalJSON(data []byte) (err error) { + varContact := _Contact{} + + err = json.Unmarshal(data, &varContact) + + if err != nil { + return err + } + + *o = Contact(varContact) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + delete(additionalProperties, "name") + delete(additionalProperties, "organization") + delete(additionalProperties, "role") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableContact struct { value *Contact isSet bool diff --git a/model_create_fleet_request.go b/model_create_fleet_request.go index 8dcc14c..868aa19 100644 --- a/model_create_fleet_request.go +++ b/model_create_fleet_request.go @@ -24,10 +24,13 @@ type CreateFleetRequest struct { // The label, or name, for the Fleet. Label *string `json:"label,omitempty"` // JSONata expression that will be evaluated to determine device membership into this fleet, if the expression evaluates to a 1, the device will be included, if it evaluates to -1 it will be removed, and if it evaluates to 0 or errors it will be left unchanged. - SmartRule *string `json:"smart_rule,omitempty"` - SmartRuleEnabled *bool `json:"smart_rule_enabled,omitempty"` + SmartRule *string `json:"smart_rule,omitempty"` + SmartRuleEnabled *bool `json:"smart_rule_enabled,omitempty"` + AdditionalProperties map[string]interface{} } +type _CreateFleetRequest CreateFleetRequest + // NewCreateFleetRequest instantiates a new CreateFleetRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -206,9 +209,38 @@ func (o CreateFleetRequest) ToMap() (map[string]interface{}, error) { if !IsNil(o.SmartRuleEnabled) { toSerialize["smart_rule_enabled"] = o.SmartRuleEnabled } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *CreateFleetRequest) UnmarshalJSON(data []byte) (err error) { + varCreateFleetRequest := _CreateFleetRequest{} + + err = json.Unmarshal(data, &varCreateFleetRequest) + + if err != nil { + return err + } + + *o = CreateFleetRequest(varCreateFleetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connectivity_assurance") + delete(additionalProperties, "label") + delete(additionalProperties, "smart_rule") + delete(additionalProperties, "smart_rule_enabled") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCreateFleetRequest struct { value *CreateFleetRequest isSet bool diff --git a/model_create_product_request.go b/model_create_product_request.go index 8667165..003d7d3 100644 --- a/model_create_product_request.go +++ b/model_create_product_request.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -28,7 +27,8 @@ type CreateProductRequest struct { // The label for the Product. Label string `json:"label"` // The requested uid for the Product. Will be prefixed with the user's reversed email. - ProductUid string `json:"product_uid"` + ProductUid string `json:"product_uid"` + AdditionalProperties map[string]interface{} } type _CreateProductRequest CreateProductRequest @@ -182,6 +182,11 @@ func (o CreateProductRequest) ToMap() (map[string]interface{}, error) { } toSerialize["label"] = o.Label toSerialize["product_uid"] = o.ProductUid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -210,9 +215,7 @@ func (o *CreateProductRequest) UnmarshalJSON(data []byte) (err error) { varCreateProductRequest := _CreateProductRequest{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCreateProductRequest) + err = json.Unmarshal(data, &varCreateProductRequest) if err != nil { return err @@ -220,6 +223,16 @@ func (o *CreateProductRequest) UnmarshalJSON(data []byte) (err error) { *o = CreateProductRequest(varCreateProductRequest) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "auto_provision_fleets") + delete(additionalProperties, "disable_devices_by_default") + delete(additionalProperties, "label") + delete(additionalProperties, "product_uid") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_create_project_request.go b/model_create_project_request.go index 651ad39..ada38a5 100644 --- a/model_create_project_request.go +++ b/model_create_project_request.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -25,7 +24,8 @@ type CreateProjectRequest struct { // The billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned. BillingAccountUid string `json:"billing_account_uid"` // The label for the project. - Label string `json:"label"` + Label string `json:"label"` + AdditionalProperties map[string]interface{} } type _CreateProjectRequest CreateProjectRequest @@ -109,6 +109,11 @@ func (o CreateProjectRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["billing_account_uid"] = o.BillingAccountUid toSerialize["label"] = o.Label + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -137,9 +142,7 @@ func (o *CreateProjectRequest) UnmarshalJSON(data []byte) (err error) { varCreateProjectRequest := _CreateProjectRequest{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varCreateProjectRequest) + err = json.Unmarshal(data, &varCreateProjectRequest) if err != nil { return err @@ -147,6 +150,14 @@ func (o *CreateProjectRequest) UnmarshalJSON(data []byte) (err error) { *o = CreateProjectRequest(varCreateProjectRequest) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "billing_account_uid") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_create_update_repository.go b/model_create_update_repository.go index 8e982e6..25b8372 100644 --- a/model_create_update_repository.go +++ b/model_create_update_repository.go @@ -20,11 +20,14 @@ var _ MappedNullable = &CreateUpdateRepository{} // CreateUpdateRepository struct for CreateUpdateRepository type CreateUpdateRepository struct { - FleetUids []string `json:"fleet_uids,omitempty"` - Name *string `json:"name,omitempty"` - ProjectUids []string `json:"project_uids,omitempty"` + FleetUids []string `json:"fleet_uids,omitempty"` + Name *string `json:"name,omitempty"` + ProjectUids []string `json:"project_uids,omitempty"` + AdditionalProperties map[string]interface{} } +type _CreateUpdateRepository CreateUpdateRepository + // NewCreateUpdateRepository instantiates a new CreateUpdateRepository object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -157,9 +160,37 @@ func (o CreateUpdateRepository) ToMap() (map[string]interface{}, error) { if !IsNil(o.ProjectUids) { toSerialize["project_uids"] = o.ProjectUids } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *CreateUpdateRepository) UnmarshalJSON(data []byte) (err error) { + varCreateUpdateRepository := _CreateUpdateRepository{} + + err = json.Unmarshal(data, &varCreateUpdateRepository) + + if err != nil { + return err + } + + *o = CreateUpdateRepository(varCreateUpdateRepository) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "fleet_uids") + delete(additionalProperties, "name") + delete(additionalProperties, "project_uids") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCreateUpdateRepository struct { value *CreateUpdateRepository isSet bool diff --git a/model_current_firmware.go b/model_current_firmware.go index 9968b6b..7f9fe54 100644 --- a/model_current_firmware.go +++ b/model_current_firmware.go @@ -20,10 +20,13 @@ var _ MappedNullable = &CurrentFirmware{} // CurrentFirmware struct for CurrentFirmware type CurrentFirmware struct { - Metadata NullableFirmware `json:"metadata,omitempty"` - Version *string `json:"version,omitempty"` + Metadata NullableFirmware `json:"metadata,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} } +type _CurrentFirmware CurrentFirmware + // NewCurrentFirmware instantiates a new CurrentFirmware object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -132,9 +135,36 @@ func (o CurrentFirmware) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *CurrentFirmware) UnmarshalJSON(data []byte) (err error) { + varCurrentFirmware := _CurrentFirmware{} + + err = json.Unmarshal(data, &varCurrentFirmware) + + if err != nil { + return err + } + + *o = CurrentFirmware(varCurrentFirmware) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "metadata") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableCurrentFirmware struct { value *CurrentFirmware isSet bool diff --git a/model_data_field.go b/model_data_field.go index a66c51a..ad449fd 100644 --- a/model_data_field.go +++ b/model_data_field.go @@ -21,9 +21,12 @@ var _ MappedNullable = &DataField{} // DataField struct for DataField type DataField struct { // The name of the field - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} } +type _DataField DataField + // NewDataField instantiates a new DataField object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o DataField) ToMap() (map[string]interface{}, error) { if !IsNil(o.Name) { toSerialize["name"] = o.Name } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DataField) UnmarshalJSON(data []byte) (err error) { + varDataField := _DataField{} + + err = json.Unmarshal(data, &varDataField) + + if err != nil { + return err + } + + *o = DataField(varDataField) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDataField struct { value *DataField isSet bool diff --git a/model_data_set_field.go b/model_data_set_field.go index 1c1b17e..41be4af 100644 --- a/model_data_set_field.go +++ b/model_data_set_field.go @@ -25,9 +25,12 @@ type DataSetField struct { // the JSONata expression used to populate this field Jsonata *string `json:"jsonata,omitempty"` // The name of the field - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} } +type _DataSetField DataSetField + // NewDataSetField instantiates a new DataSetField object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o DataSetField) ToMap() (map[string]interface{}, error) { if !IsNil(o.Name) { toSerialize["name"] = o.Name } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DataSetField) UnmarshalJSON(data []byte) (err error) { + varDataSetField := _DataSetField{} + + err = json.Unmarshal(data, &varDataSetField) + + if err != nil { + return err + } + + *o = DataSetField(varDataSetField) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "datatype") + delete(additionalProperties, "jsonata") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDataSetField struct { value *DataSetField isSet bool diff --git a/model_data_usage.go b/model_data_usage.go index 99355d5..92d8e5a 100644 --- a/model_data_usage.go +++ b/model_data_usage.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -27,7 +26,8 @@ type DataUsage struct { // Total Kilobytes included in the plan KbTotal float64 `json:"kb_total"` // Kilobytes used to date - KbUsed float64 `json:"kb_used"` + KbUsed float64 `json:"kb_used"` + AdditionalProperties map[string]interface{} } type _DataUsage DataUsage @@ -137,6 +137,11 @@ func (o DataUsage) ToMap() (map[string]interface{}, error) { toSerialize["kb_remaining"] = o.KbRemaining toSerialize["kb_total"] = o.KbTotal toSerialize["kb_used"] = o.KbUsed + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -166,9 +171,7 @@ func (o *DataUsage) UnmarshalJSON(data []byte) (err error) { varDataUsage := _DataUsage{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDataUsage) + err = json.Unmarshal(data, &varDataUsage) if err != nil { return err @@ -176,6 +179,15 @@ func (o *DataUsage) UnmarshalJSON(data []byte) (err error) { *o = DataUsage(varDataUsage) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "kb_remaining") + delete(additionalProperties, "kb_total") + delete(additionalProperties, "kb_used") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_delete_device_from_fleets_request.go b/model_delete_device_from_fleets_request.go index 0d7cb3a..0913d2b 100644 --- a/model_delete_device_from_fleets_request.go +++ b/model_delete_device_from_fleets_request.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,7 +22,8 @@ var _ MappedNullable = &DeleteDeviceFromFleetsRequest{} // DeleteDeviceFromFleetsRequest struct for DeleteDeviceFromFleetsRequest type DeleteDeviceFromFleetsRequest struct { // The fleetUIDs to remove from the device. - FleetUids []string `json:"fleet_uids"` + FleetUids []string `json:"fleet_uids"` + AdditionalProperties map[string]interface{} } type _DeleteDeviceFromFleetsRequest DeleteDeviceFromFleetsRequest @@ -81,6 +81,11 @@ func (o DeleteDeviceFromFleetsRequest) MarshalJSON() ([]byte, error) { func (o DeleteDeviceFromFleetsRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["fleet_uids"] = o.FleetUids + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -108,9 +113,7 @@ func (o *DeleteDeviceFromFleetsRequest) UnmarshalJSON(data []byte) (err error) { varDeleteDeviceFromFleetsRequest := _DeleteDeviceFromFleetsRequest{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDeleteDeviceFromFleetsRequest) + err = json.Unmarshal(data, &varDeleteDeviceFromFleetsRequest) if err != nil { return err @@ -118,6 +121,13 @@ func (o *DeleteDeviceFromFleetsRequest) UnmarshalJSON(data []byte) (err error) { *o = DeleteDeviceFromFleetsRequest(varDeleteDeviceFromFleetsRequest) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "fleet_uids") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_delete_notefiles_request.go b/model_delete_notefiles_request.go index 8352f94..723c861 100644 --- a/model_delete_notefiles_request.go +++ b/model_delete_notefiles_request.go @@ -21,9 +21,12 @@ var _ MappedNullable = &DeleteNotefilesRequest{} // DeleteNotefilesRequest struct for DeleteNotefilesRequest type DeleteNotefilesRequest struct { // Name of notefiles to delete - Files []string `json:"files,omitempty"` + Files []string `json:"files,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeleteNotefilesRequest DeleteNotefilesRequest + // NewDeleteNotefilesRequest instantiates a new DeleteNotefilesRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o DeleteNotefilesRequest) ToMap() (map[string]interface{}, error) { if !IsNil(o.Files) { toSerialize["files"] = o.Files } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeleteNotefilesRequest) UnmarshalJSON(data []byte) (err error) { + varDeleteNotefilesRequest := _DeleteNotefilesRequest{} + + err = json.Unmarshal(data, &varDeleteNotefilesRequest) + + if err != nil { + return err + } + + *o = DeleteNotefilesRequest(varDeleteNotefilesRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "files") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeleteNotefilesRequest struct { value *DeleteNotefilesRequest isSet bool diff --git a/model_device.go b/model_device.go index eed1486..106a0b9 100644 --- a/model_device.go +++ b/model_device.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -43,6 +42,7 @@ type Device struct { TriangulatedLocation NullableLocation `json:"triangulated_location,omitempty"` Uid string `json:"uid"` Voltage float64 `json:"voltage"` + AdditionalProperties map[string]interface{} } type _Device Device @@ -808,6 +808,11 @@ func (o Device) ToMap() (map[string]interface{}, error) { } toSerialize["uid"] = o.Uid toSerialize["voltage"] = o.Voltage + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -840,9 +845,7 @@ func (o *Device) UnmarshalJSON(data []byte) (err error) { varDevice := _Device{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varDevice) + err = json.Unmarshal(data, &varDevice) if err != nil { return err @@ -850,6 +853,32 @@ func (o *Device) UnmarshalJSON(data []byte) (err error) { *o = Device(varDevice) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "best_location") + delete(additionalProperties, "cellular_usage") + delete(additionalProperties, "contact") + delete(additionalProperties, "dfu") + delete(additionalProperties, "disabled") + delete(additionalProperties, "firmware_host") + delete(additionalProperties, "firmware_notecard") + delete(additionalProperties, "fleet_uids") + delete(additionalProperties, "gps_location") + delete(additionalProperties, "last_activity") + delete(additionalProperties, "product_uid") + delete(additionalProperties, "provisioned") + delete(additionalProperties, "serial_number") + delete(additionalProperties, "sku") + delete(additionalProperties, "temperature") + delete(additionalProperties, "tower_info") + delete(additionalProperties, "tower_location") + delete(additionalProperties, "triangulated_location") + delete(additionalProperties, "uid") + delete(additionalProperties, "voltage") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_device_dfu_history.go b/model_device_dfu_history.go index ef9e277..6e6218d 100644 --- a/model_device_dfu_history.go +++ b/model_device_dfu_history.go @@ -22,10 +22,13 @@ var _ MappedNullable = &DeviceDfuHistory{} type DeviceDfuHistory struct { Current *DeviceDfuHistoryCurrent `json:"current,omitempty"` // Device UID - DeviceUid *string `json:"device_uid,omitempty"` - History []DeviceDfuStateMachine `json:"history,omitempty"` + DeviceUid *string `json:"device_uid,omitempty"` + History []DeviceDfuStateMachine `json:"history,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuHistory DeviceDfuHistory + // NewDeviceDfuHistory instantiates a new DeviceDfuHistory object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -158,9 +161,37 @@ func (o DeviceDfuHistory) ToMap() (map[string]interface{}, error) { if !IsNil(o.History) { toSerialize["history"] = o.History } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuHistory) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuHistory := _DeviceDfuHistory{} + + err = json.Unmarshal(data, &varDeviceDfuHistory) + + if err != nil { + return err + } + + *o = DeviceDfuHistory(varDeviceDfuHistory) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current") + delete(additionalProperties, "device_uid") + delete(additionalProperties, "history") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuHistory struct { value *DeviceDfuHistory isSet bool diff --git a/model_device_dfu_history_current.go b/model_device_dfu_history_current.go index 079e349..ef872c9 100644 --- a/model_device_dfu_history_current.go +++ b/model_device_dfu_history_current.go @@ -31,9 +31,12 @@ type DeviceDfuHistoryCurrent struct { // Firmware product Product *string `json:"product,omitempty"` // Firmware version - Version *string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuHistoryCurrent DeviceDfuHistoryCurrent + // NewDeviceDfuHistoryCurrent instantiates a new DeviceDfuHistoryCurrent object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -271,9 +274,40 @@ func (o DeviceDfuHistoryCurrent) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuHistoryCurrent) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuHistoryCurrent := _DeviceDfuHistoryCurrent{} + + err = json.Unmarshal(data, &varDeviceDfuHistoryCurrent) + + if err != nil { + return err + } + + *o = DeviceDfuHistoryCurrent(varDeviceDfuHistoryCurrent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "builder") + delete(additionalProperties, "built") + delete(additionalProperties, "description") + delete(additionalProperties, "organization") + delete(additionalProperties, "product") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuHistoryCurrent struct { value *DeviceDfuHistoryCurrent isSet bool diff --git a/model_device_dfu_history_page.go b/model_device_dfu_history_page.go index 77ac594..76e15e8 100644 --- a/model_device_dfu_history_page.go +++ b/model_device_dfu_history_page.go @@ -20,10 +20,13 @@ var _ MappedNullable = &DeviceDfuHistoryPage{} // DeviceDfuHistoryPage struct for DeviceDfuHistoryPage type DeviceDfuHistoryPage struct { - Devices []DeviceDfuHistory `json:"devices,omitempty"` - HasMore *bool `json:"has_more,omitempty"` + Devices []DeviceDfuHistory `json:"devices,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuHistoryPage DeviceDfuHistoryPage + // NewDeviceDfuHistoryPage instantiates a new DeviceDfuHistoryPage object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -125,9 +128,36 @@ func (o DeviceDfuHistoryPage) ToMap() (map[string]interface{}, error) { if !IsNil(o.HasMore) { toSerialize["has_more"] = o.HasMore } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuHistoryPage) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuHistoryPage := _DeviceDfuHistoryPage{} + + err = json.Unmarshal(data, &varDeviceDfuHistoryPage) + + if err != nil { + return err + } + + *o = DeviceDfuHistoryPage(varDeviceDfuHistoryPage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "devices") + delete(additionalProperties, "has_more") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuHistoryPage struct { value *DeviceDfuHistoryPage isSet bool diff --git a/model_device_dfu_state_machine.go b/model_device_dfu_state_machine.go index c2f4eb3..cfad466 100644 --- a/model_device_dfu_state_machine.go +++ b/model_device_dfu_state_machine.go @@ -25,10 +25,13 @@ type DeviceDfuStateMachine struct { // RFC3339 datetime of when this update was requested Initiated *string `json:"initiated,omitempty"` // Version of the firmware that was requested to be installed - RequestedVersion *string `json:"requested_version,omitempty"` - Updates []DeviceDfuStateMachineNode `json:"updates,omitempty"` + RequestedVersion *string `json:"requested_version,omitempty"` + Updates []DeviceDfuStateMachineNode `json:"updates,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuStateMachine DeviceDfuStateMachine + // NewDeviceDfuStateMachine instantiates a new DeviceDfuStateMachine object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -196,9 +199,38 @@ func (o DeviceDfuStateMachine) ToMap() (map[string]interface{}, error) { if !IsNil(o.Updates) { toSerialize["updates"] = o.Updates } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuStateMachine) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuStateMachine := _DeviceDfuStateMachine{} + + err = json.Unmarshal(data, &varDeviceDfuStateMachine) + + if err != nil { + return err + } + + *o = DeviceDfuStateMachine(varDeviceDfuStateMachine) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current_version") + delete(additionalProperties, "initiated") + delete(additionalProperties, "requested_version") + delete(additionalProperties, "updates") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuStateMachine struct { value *DeviceDfuStateMachine isSet bool diff --git a/model_device_dfu_state_machine_node.go b/model_device_dfu_state_machine_node.go index e390595..4a092b3 100644 --- a/model_device_dfu_state_machine_node.go +++ b/model_device_dfu_state_machine_node.go @@ -27,9 +27,12 @@ type DeviceDfuStateMachineNode struct { // Phase for this step in the firmware update process Phase *string `json:"phase,omitempty"` // Status for this step in the firmware update process - Status *string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuStateMachineNode DeviceDfuStateMachineNode + // NewDeviceDfuStateMachineNode instantiates a new DeviceDfuStateMachineNode object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -197,9 +200,38 @@ func (o DeviceDfuStateMachineNode) ToMap() (map[string]interface{}, error) { if !IsNil(o.Status) { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuStateMachineNode) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuStateMachineNode := _DeviceDfuStateMachineNode{} + + err = json.Unmarshal(data, &varDeviceDfuStateMachineNode) + + if err != nil { + return err + } + + *o = DeviceDfuStateMachineNode(varDeviceDfuStateMachineNode) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "datetime") + delete(additionalProperties, "description") + delete(additionalProperties, "phase") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuStateMachineNode struct { value *DeviceDfuStateMachineNode isSet bool diff --git a/model_device_dfu_status.go b/model_device_dfu_status.go index 7abed1d..1b51ac5 100644 --- a/model_device_dfu_status.go +++ b/model_device_dfu_status.go @@ -24,10 +24,13 @@ type DeviceDfuStatus struct { // Device UID DeviceUid *string `json:"device_uid,omitempty"` // true if there is a DFU currently in progress - DfuInProgress *bool `json:"dfu_in_progress,omitempty"` - Status *DeviceDfuStateMachine `json:"status,omitempty"` + DfuInProgress *bool `json:"dfu_in_progress,omitempty"` + Status *DeviceDfuStateMachine `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuStatus DeviceDfuStatus + // NewDeviceDfuStatus instantiates a new DeviceDfuStatus object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -195,9 +198,38 @@ func (o DeviceDfuStatus) ToMap() (map[string]interface{}, error) { if !IsNil(o.Status) { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuStatus) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuStatus := _DeviceDfuStatus{} + + err = json.Unmarshal(data, &varDeviceDfuStatus) + + if err != nil { + return err + } + + *o = DeviceDfuStatus(varDeviceDfuStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current") + delete(additionalProperties, "device_uid") + delete(additionalProperties, "dfu_in_progress") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuStatus struct { value *DeviceDfuStatus isSet bool diff --git a/model_device_dfu_status_page.go b/model_device_dfu_status_page.go index 3d93e2d..fbda2ed 100644 --- a/model_device_dfu_status_page.go +++ b/model_device_dfu_status_page.go @@ -20,10 +20,13 @@ var _ MappedNullable = &DeviceDfuStatusPage{} // DeviceDfuStatusPage struct for DeviceDfuStatusPage type DeviceDfuStatusPage struct { - Devices []DeviceDfuStatus `json:"devices,omitempty"` - HasMore *bool `json:"has_more,omitempty"` + Devices []DeviceDfuStatus `json:"devices,omitempty"` + HasMore *bool `json:"has_more,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceDfuStatusPage DeviceDfuStatusPage + // NewDeviceDfuStatusPage instantiates a new DeviceDfuStatusPage object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -125,9 +128,36 @@ func (o DeviceDfuStatusPage) ToMap() (map[string]interface{}, error) { if !IsNil(o.HasMore) { toSerialize["has_more"] = o.HasMore } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceDfuStatusPage) UnmarshalJSON(data []byte) (err error) { + varDeviceDfuStatusPage := _DeviceDfuStatusPage{} + + err = json.Unmarshal(data, &varDeviceDfuStatusPage) + + if err != nil { + return err + } + + *o = DeviceDfuStatusPage(varDeviceDfuStatusPage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "devices") + delete(additionalProperties, "has_more") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceDfuStatusPage struct { value *DeviceDfuStatusPage isSet bool diff --git a/model_device_session.go b/model_device_session.go index d367439..5894b34 100644 --- a/model_device_session.go +++ b/model_device_session.go @@ -97,9 +97,12 @@ type DeviceSession struct { // Reason for session opening WhySessionOpened *string `json:"why_session_opened,omitempty"` // Unix timestamp of the last time work was done for this session - Work *int64 `json:"work,omitempty"` + Work *int64 `json:"work,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceSession DeviceSession + // NewDeviceSession instantiates a new DeviceSession object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -2122,9 +2125,91 @@ func (o DeviceSession) ToMap() (map[string]interface{}, error) { if !IsNil(o.Work) { toSerialize["work"] = o.Work } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceSession) UnmarshalJSON(data []byte) (err error) { + varDeviceSession := _DeviceSession{} + + err = json.Unmarshal(data, &varDeviceSession) + + if err != nil { + return err + } + + *o = DeviceSession(varDeviceSession) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "apn") + delete(additionalProperties, "bars") + delete(additionalProperties, "bearer") + delete(additionalProperties, "bssid") + delete(additionalProperties, "cell") + delete(additionalProperties, "continuous") + delete(additionalProperties, "device") + delete(additionalProperties, "events") + delete(additionalProperties, "failed_connects") + delete(additionalProperties, "fleets") + delete(additionalProperties, "hp_cycles_data") + delete(additionalProperties, "hp_cycles_gps") + delete(additionalProperties, "hp_cycles_total") + delete(additionalProperties, "hp_secs_data") + delete(additionalProperties, "hp_secs_gps") + delete(additionalProperties, "hp_secs_total") + delete(additionalProperties, "iccid") + delete(additionalProperties, "ip") + delete(additionalProperties, "moved") + delete(additionalProperties, "orientation") + delete(additionalProperties, "penalty_secs") + delete(additionalProperties, "period") + delete(additionalProperties, "power_charging") + delete(additionalProperties, "power_mah") + delete(additionalProperties, "power_primary") + delete(additionalProperties, "power_usb") + delete(additionalProperties, "product") + delete(additionalProperties, "rat") + delete(additionalProperties, "rsrp") + delete(additionalProperties, "rsrq") + delete(additionalProperties, "rssi") + delete(additionalProperties, "scan") + delete(additionalProperties, "session") + delete(additionalProperties, "session_began") + delete(additionalProperties, "session_ended") + delete(additionalProperties, "sinr") + delete(additionalProperties, "sn") + delete(additionalProperties, "ssid") + delete(additionalProperties, "temp") + delete(additionalProperties, "tls") + delete(additionalProperties, "tower") + delete(additionalProperties, "transport") + delete(additionalProperties, "tri") + delete(additionalProperties, "triangulate") + delete(additionalProperties, "usage_actual") + delete(additionalProperties, "voltage") + delete(additionalProperties, "when") + delete(additionalProperties, "where") + delete(additionalProperties, "where_country") + delete(additionalProperties, "where_lat") + delete(additionalProperties, "where_location") + delete(additionalProperties, "where_lon") + delete(additionalProperties, "where_timezone") + delete(additionalProperties, "where_when") + delete(additionalProperties, "why_session_closed") + delete(additionalProperties, "why_session_opened") + delete(additionalProperties, "work") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceSession struct { value *DeviceSession isSet bool diff --git a/model_device_tower_info.go b/model_device_tower_info.go index 88c1dbd..e4b74ef 100644 --- a/model_device_tower_info.go +++ b/model_device_tower_info.go @@ -20,12 +20,15 @@ var _ MappedNullable = &DeviceTowerInfo{} // DeviceTowerInfo struct for DeviceTowerInfo type DeviceTowerInfo struct { - CellId *int32 `json:"cell_id,omitempty"` - Lac *int32 `json:"lac,omitempty"` - Mcc *int32 `json:"mcc,omitempty"` - Mnc *int32 `json:"mnc,omitempty"` + CellId *int32 `json:"cell_id,omitempty"` + Lac *int32 `json:"lac,omitempty"` + Mcc *int32 `json:"mcc,omitempty"` + Mnc *int32 `json:"mnc,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceTowerInfo DeviceTowerInfo + // NewDeviceTowerInfo instantiates a new DeviceTowerInfo object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -193,9 +196,38 @@ func (o DeviceTowerInfo) ToMap() (map[string]interface{}, error) { if !IsNil(o.Mnc) { toSerialize["mnc"] = o.Mnc } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceTowerInfo) UnmarshalJSON(data []byte) (err error) { + varDeviceTowerInfo := _DeviceTowerInfo{} + + err = json.Unmarshal(data, &varDeviceTowerInfo) + + if err != nil { + return err + } + + *o = DeviceTowerInfo(varDeviceTowerInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cell_id") + delete(additionalProperties, "lac") + delete(additionalProperties, "mcc") + delete(additionalProperties, "mnc") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceTowerInfo struct { value *DeviceTowerInfo isSet bool diff --git a/model_device_usage.go b/model_device_usage.go index 399b334..751e27b 100644 --- a/model_device_usage.go +++ b/model_device_usage.go @@ -31,9 +31,12 @@ type DeviceUsage struct { SessionsTcp *int64 `json:"sessions_tcp,omitempty"` SessionsTls *int64 `json:"sessions_tls,omitempty"` // Unix timestamp - Since *int64 `json:"since,omitempty"` + Since *int64 `json:"since,omitempty"` + AdditionalProperties map[string]interface{} } +type _DeviceUsage DeviceUsage + // NewDeviceUsage instantiates a new DeviceUsage object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -411,9 +414,44 @@ func (o DeviceUsage) ToMap() (map[string]interface{}, error) { if !IsNil(o.Since) { toSerialize["since"] = o.Since } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DeviceUsage) UnmarshalJSON(data []byte) (err error) { + varDeviceUsage := _DeviceUsage{} + + err = json.Unmarshal(data, &varDeviceUsage) + + if err != nil { + return err + } + + *o = DeviceUsage(varDeviceUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "bytes_rcvd") + delete(additionalProperties, "bytes_rcvd_secondary") + delete(additionalProperties, "bytes_sent") + delete(additionalProperties, "bytes_sent_secondary") + delete(additionalProperties, "duration") + delete(additionalProperties, "notes_rcvd") + delete(additionalProperties, "notes_sent") + delete(additionalProperties, "sessions_tcp") + delete(additionalProperties, "sessions_tls") + delete(additionalProperties, "since") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDeviceUsage struct { value *DeviceUsage isSet bool diff --git a/model_dfu_action_request.go b/model_dfu_action_request.go index eeeea47..b6b3b8f 100644 --- a/model_dfu_action_request.go +++ b/model_dfu_action_request.go @@ -21,9 +21,12 @@ var _ MappedNullable = &DfuActionRequest{} // DfuActionRequest struct for DfuActionRequest type DfuActionRequest struct { // The name of the firmware file - Filename *string `json:"filename,omitempty"` + Filename *string `json:"filename,omitempty"` + AdditionalProperties map[string]interface{} } +type _DfuActionRequest DfuActionRequest + // NewDfuActionRequest instantiates a new DfuActionRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o DfuActionRequest) ToMap() (map[string]interface{}, error) { if !IsNil(o.Filename) { toSerialize["filename"] = o.Filename } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DfuActionRequest) UnmarshalJSON(data []byte) (err error) { + varDfuActionRequest := _DfuActionRequest{} + + err = json.Unmarshal(data, &varDfuActionRequest) + + if err != nil { + return err + } + + *o = DfuActionRequest(varDfuActionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "filename") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDfuActionRequest struct { value *DfuActionRequest isSet bool diff --git a/model_dfu_env.go b/model_dfu_env.go index 73020b6..9fe6330 100644 --- a/model_dfu_env.go +++ b/model_dfu_env.go @@ -20,10 +20,13 @@ var _ MappedNullable = &DFUEnv{} // DFUEnv struct for DFUEnv type DFUEnv struct { - Card NullableDFUState `json:"card,omitempty"` - User NullableDFUState `json:"user,omitempty"` + Card NullableDFUState `json:"card,omitempty"` + User NullableDFUState `json:"user,omitempty"` + AdditionalProperties map[string]interface{} } +type _DFUEnv DFUEnv + // NewDFUEnv instantiates a new DFUEnv object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -143,9 +146,36 @@ func (o DFUEnv) ToMap() (map[string]interface{}, error) { if o.User.IsSet() { toSerialize["user"] = o.User.Get() } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DFUEnv) UnmarshalJSON(data []byte) (err error) { + varDFUEnv := _DFUEnv{} + + err = json.Unmarshal(data, &varDFUEnv) + + if err != nil { + return err + } + + *o = DFUEnv(varDFUEnv) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "card") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDFUEnv struct { value *DFUEnv isSet bool diff --git a/model_dfu_state.go b/model_dfu_state.go index 251639f..98f5f38 100644 --- a/model_dfu_state.go +++ b/model_dfu_state.go @@ -44,9 +44,12 @@ type DFUState struct { // Last updated timestamp Updated *float32 `json:"updated,omitempty"` // Last known version, which is generally a JSON object contained within the firmware image - Version *string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} } +type _DFUState DFUState + // NewDFUState instantiates a new DFUState object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -529,9 +532,47 @@ func (o DFUState) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *DFUState) UnmarshalJSON(data []byte) (err error) { + varDFUState := _DFUState{} + + err = json.Unmarshal(data, &varDFUState) + + if err != nil { + return err + } + + *o = DFUState(varDFUState) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "began") + delete(additionalProperties, "crc32") + delete(additionalProperties, "errors") + delete(additionalProperties, "file") + delete(additionalProperties, "length") + delete(additionalProperties, "md5") + delete(additionalProperties, "mode") + delete(additionalProperties, "read") + delete(additionalProperties, "retry") + delete(additionalProperties, "status") + delete(additionalProperties, "type") + delete(additionalProperties, "updated") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableDFUState struct { value *DFUState isSet bool diff --git a/model_email_notification.go b/model_email_notification.go index 5c07922..d6e735d 100644 --- a/model_email_notification.go +++ b/model_email_notification.go @@ -21,9 +21,12 @@ var _ MappedNullable = &EmailNotification{} // EmailNotification struct for EmailNotification type EmailNotification struct { // Email Address - Email *string `json:"email,omitempty"` + Email *string `json:"email,omitempty"` + AdditionalProperties map[string]interface{} } +type _EmailNotification EmailNotification + // NewEmailNotification instantiates a new EmailNotification object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o EmailNotification) ToMap() (map[string]interface{}, error) { if !IsNil(o.Email) { toSerialize["email"] = o.Email } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *EmailNotification) UnmarshalJSON(data []byte) (err error) { + varEmailNotification := _EmailNotification{} + + err = json.Unmarshal(data, &varEmailNotification) + + if err != nil { + return err + } + + *o = EmailNotification(varEmailNotification) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableEmailNotification struct { value *EmailNotification isSet bool diff --git a/model_env_tree_json_node.go b/model_env_tree_json_node.go index ab8fb36..62c9b6d 100644 --- a/model_env_tree_json_node.go +++ b/model_env_tree_json_node.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,17 +21,18 @@ var _ MappedNullable = &EnvTreeJsonNode{} // EnvTreeJsonNode struct for EnvTreeJsonNode type EnvTreeJsonNode struct { - AppLabel *string `json:"app_label,omitempty"` - AppUid *string `json:"app_uid,omitempty"` - Children []EnvTreeJsonNode `json:"children"` - DeviceUid *string `json:"device_uid,omitempty"` - FleetLabel *string `json:"fleet_label,omitempty"` - FleetUid *string `json:"fleet_uid,omitempty"` - InheritedVarCount int32 `json:"inherited_var_count"` - Type string `json:"type"` - Url *string `json:"url,omitempty"` - VarCount int32 `json:"var_count"` - Variables []EnvVar `json:"variables"` + AppLabel *string `json:"app_label,omitempty"` + AppUid *string `json:"app_uid,omitempty"` + Children []EnvTreeJsonNode `json:"children"` + DeviceUid *string `json:"device_uid,omitempty"` + FleetLabel *string `json:"fleet_label,omitempty"` + FleetUid *string `json:"fleet_uid,omitempty"` + InheritedVarCount int32 `json:"inherited_var_count"` + Type string `json:"type"` + Url *string `json:"url,omitempty"` + VarCount int32 `json:"var_count"` + Variables []EnvVar `json:"variables"` + AdditionalProperties map[string]interface{} } type _EnvTreeJsonNode EnvTreeJsonNode @@ -404,6 +404,11 @@ func (o EnvTreeJsonNode) ToMap() (map[string]interface{}, error) { } toSerialize["var_count"] = o.VarCount toSerialize["variables"] = o.Variables + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -435,9 +440,7 @@ func (o *EnvTreeJsonNode) UnmarshalJSON(data []byte) (err error) { varEnvTreeJsonNode := _EnvTreeJsonNode{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEnvTreeJsonNode) + err = json.Unmarshal(data, &varEnvTreeJsonNode) if err != nil { return err @@ -445,6 +448,23 @@ func (o *EnvTreeJsonNode) UnmarshalJSON(data []byte) (err error) { *o = EnvTreeJsonNode(varEnvTreeJsonNode) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "app_label") + delete(additionalProperties, "app_uid") + delete(additionalProperties, "children") + delete(additionalProperties, "device_uid") + delete(additionalProperties, "fleet_label") + delete(additionalProperties, "fleet_uid") + delete(additionalProperties, "inherited_var_count") + delete(additionalProperties, "type") + delete(additionalProperties, "url") + delete(additionalProperties, "var_count") + delete(additionalProperties, "variables") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_env_var.go b/model_env_var.go index ec12d84..f74f876 100644 --- a/model_env_var.go +++ b/model_env_var.go @@ -20,12 +20,15 @@ var _ MappedNullable = &EnvVar{} // EnvVar struct for EnvVar type EnvVar struct { - Key *string `json:"key,omitempty"` - Precedence *int32 `json:"precedence,omitempty"` - Used *bool `json:"used,omitempty"` - Value *string `json:"value,omitempty"` + Key *string `json:"key,omitempty"` + Precedence *int32 `json:"precedence,omitempty"` + Used *bool `json:"used,omitempty"` + Value *string `json:"value,omitempty"` + AdditionalProperties map[string]interface{} } +type _EnvVar EnvVar + // NewEnvVar instantiates a new EnvVar object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -193,9 +196,38 @@ func (o EnvVar) ToMap() (map[string]interface{}, error) { if !IsNil(o.Value) { toSerialize["value"] = o.Value } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *EnvVar) UnmarshalJSON(data []byte) (err error) { + varEnvVar := _EnvVar{} + + err = json.Unmarshal(data, &varEnvVar) + + if err != nil { + return err + } + + *o = EnvVar(varEnvVar) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "precedence") + delete(additionalProperties, "used") + delete(additionalProperties, "value") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableEnvVar struct { value *EnvVar isSet bool diff --git a/model_environment_variables.go b/model_environment_variables.go index 225bfaa..335cbbc 100644 --- a/model_environment_variables.go +++ b/model_environment_variables.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,6 +22,7 @@ var _ MappedNullable = &EnvironmentVariables{} // EnvironmentVariables struct for EnvironmentVariables type EnvironmentVariables struct { EnvironmentVariables map[string]string `json:"environment_variables"` + AdditionalProperties map[string]interface{} } type _EnvironmentVariables EnvironmentVariables @@ -80,6 +80,11 @@ func (o EnvironmentVariables) MarshalJSON() ([]byte, error) { func (o EnvironmentVariables) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["environment_variables"] = o.EnvironmentVariables + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -107,9 +112,7 @@ func (o *EnvironmentVariables) UnmarshalJSON(data []byte) (err error) { varEnvironmentVariables := _EnvironmentVariables{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varEnvironmentVariables) + err = json.Unmarshal(data, &varEnvironmentVariables) if err != nil { return err @@ -117,6 +120,13 @@ func (o *EnvironmentVariables) UnmarshalJSON(data []byte) (err error) { *o = EnvironmentVariables(varEnvironmentVariables) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "environment_variables") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_error.go b/model_error.go index e810416..5df127d 100644 --- a/model_error.go +++ b/model_error.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -30,7 +29,8 @@ type Error struct { Err string `json:"err"` Request *string `json:"request,omitempty"` // Machine readable representation of the HTTP error code. - Status string `json:"status"` + Status string `json:"status"` + AdditionalProperties map[string]interface{} } type _Error Error @@ -245,6 +245,11 @@ func (o Error) ToMap() (map[string]interface{}, error) { toSerialize["request"] = o.Request } toSerialize["status"] = o.Status + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -274,9 +279,7 @@ func (o *Error) UnmarshalJSON(data []byte) (err error) { varError := _Error{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varError) + err = json.Unmarshal(data, &varError) if err != nil { return err @@ -284,6 +287,18 @@ func (o *Error) UnmarshalJSON(data []byte) (err error) { *o = Error(varError) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "debug") + delete(additionalProperties, "details") + delete(additionalProperties, "err") + delete(additionalProperties, "request") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_event.go b/model_event.go index 691995e..27175f4 100644 --- a/model_event.go +++ b/model_event.go @@ -138,9 +138,12 @@ type Event struct { // Timezone WhereTimezone *string `json:"where_timezone,omitempty"` // Unix timestamp - WhereWhen *float32 `json:"where_when,omitempty"` + WhereWhen *float32 `json:"where_when,omitempty"` + AdditionalProperties map[string]interface{} } +type _Event Event + // NewEvent instantiates a new Event object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -2268,9 +2271,94 @@ func (o Event) ToMap() (map[string]interface{}, error) { if !IsNil(o.WhereWhen) { toSerialize["where_when"] = o.WhereWhen } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Event) UnmarshalJSON(data []byte) (err error) { + varEvent := _Event{} + + err = json.Unmarshal(data, &varEvent) + + if err != nil { + return err + } + + *o = Event(varEvent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "app") + delete(additionalProperties, "bars") + delete(additionalProperties, "best_country") + delete(additionalProperties, "best_id") + delete(additionalProperties, "best_lat") + delete(additionalProperties, "best_location") + delete(additionalProperties, "best_location_type") + delete(additionalProperties, "best_location_when") + delete(additionalProperties, "best_lon") + delete(additionalProperties, "best_timezone") + delete(additionalProperties, "body") + delete(additionalProperties, "bssid") + delete(additionalProperties, "device") + delete(additionalProperties, "environment") + delete(additionalProperties, "event") + delete(additionalProperties, "file") + delete(additionalProperties, "moved") + delete(additionalProperties, "note") + delete(additionalProperties, "ordering_code") + delete(additionalProperties, "orientation") + delete(additionalProperties, "payload") + delete(additionalProperties, "product") + delete(additionalProperties, "rat") + delete(additionalProperties, "received") + delete(additionalProperties, "req") + delete(additionalProperties, "rsrp") + delete(additionalProperties, "rsrq") + delete(additionalProperties, "rssi") + delete(additionalProperties, "session") + delete(additionalProperties, "sinr") + delete(additionalProperties, "sku") + delete(additionalProperties, "sn") + delete(additionalProperties, "ssid") + delete(additionalProperties, "temp") + delete(additionalProperties, "tls") + delete(additionalProperties, "tower_country") + delete(additionalProperties, "tower_id") + delete(additionalProperties, "tower_lat") + delete(additionalProperties, "tower_location") + delete(additionalProperties, "tower_lon") + delete(additionalProperties, "tower_timezone") + delete(additionalProperties, "tower_when") + delete(additionalProperties, "transport") + delete(additionalProperties, "tri_country") + delete(additionalProperties, "tri_lat") + delete(additionalProperties, "tri_location") + delete(additionalProperties, "tri_lon") + delete(additionalProperties, "tri_points") + delete(additionalProperties, "tri_timezone") + delete(additionalProperties, "tri_when") + delete(additionalProperties, "updates") + delete(additionalProperties, "voltage") + delete(additionalProperties, "when") + delete(additionalProperties, "where_country") + delete(additionalProperties, "where_lat") + delete(additionalProperties, "where_location") + delete(additionalProperties, "where_lon") + delete(additionalProperties, "where_olc") + delete(additionalProperties, "where_timezone") + delete(additionalProperties, "where_when") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableEvent struct { value *Event isSet bool diff --git a/model_filter.go b/model_filter.go index a8242f7..81564be 100644 --- a/model_filter.go +++ b/model_filter.go @@ -25,9 +25,12 @@ type Filter struct { // Whether system notefiles should be included. SystemNotefiles *bool `json:"system_notefiles,omitempty"` // Type of filter to apply (corresponds to `hublib.NotefileFilterType`). - Type *string `json:"type,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} } +type _Filter Filter + // NewFilter instantiates a new Filter object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o Filter) ToMap() (map[string]interface{}, error) { if !IsNil(o.Type) { toSerialize["type"] = o.Type } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Filter) UnmarshalJSON(data []byte) (err error) { + varFilter := _Filter{} + + err = json.Unmarshal(data, &varFilter) + + if err != nil { + return err + } + + *o = Filter(varFilter) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "files") + delete(additionalProperties, "system_notefiles") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFilter struct { value *Filter isSet bool diff --git a/model_firmware.go b/model_firmware.go index c4307f1..5924732 100644 --- a/model_firmware.go +++ b/model_firmware.go @@ -20,18 +20,21 @@ var _ MappedNullable = &Firmware{} // Firmware struct for Firmware type Firmware struct { - Builder *string `json:"builder,omitempty"` - Built *string `json:"built,omitempty"` - Firmware *string `json:"firmware,omitempty"` - Org *string `json:"org,omitempty"` - Product *string `json:"product,omitempty"` - Target *string `json:"target,omitempty"` - VerBuild *int32 `json:"ver_build,omitempty"` - VerMajor *int32 `json:"ver_major,omitempty"` - VerMinor *int32 `json:"ver_minor,omitempty"` - VerPatch *int32 `json:"ver_patch,omitempty"` - Version *string `json:"version,omitempty"` -} + Builder *string `json:"builder,omitempty"` + Built *string `json:"built,omitempty"` + Firmware *string `json:"firmware,omitempty"` + Org *string `json:"org,omitempty"` + Product *string `json:"product,omitempty"` + Target *string `json:"target,omitempty"` + VerBuild *int32 `json:"ver_build,omitempty"` + VerMajor *int32 `json:"ver_major,omitempty"` + VerMinor *int32 `json:"ver_minor,omitempty"` + VerPatch *int32 `json:"ver_patch,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Firmware Firmware // NewFirmware instantiates a new Firmware object // This constructor will assign default values to properties that have it defined, @@ -445,9 +448,45 @@ func (o Firmware) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Firmware) UnmarshalJSON(data []byte) (err error) { + varFirmware := _Firmware{} + + err = json.Unmarshal(data, &varFirmware) + + if err != nil { + return err + } + + *o = Firmware(varFirmware) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "builder") + delete(additionalProperties, "built") + delete(additionalProperties, "firmware") + delete(additionalProperties, "org") + delete(additionalProperties, "product") + delete(additionalProperties, "target") + delete(additionalProperties, "ver_build") + delete(additionalProperties, "ver_major") + delete(additionalProperties, "ver_minor") + delete(additionalProperties, "ver_patch") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFirmware struct { value *Firmware isSet bool diff --git a/model_firmware_info.go b/model_firmware_info.go index 424007e..38e562d 100644 --- a/model_firmware_info.go +++ b/model_firmware_info.go @@ -43,9 +43,12 @@ type FirmwareInfo struct { // The type of firmware. Type *string `json:"type,omitempty"` // The version of the firmware. - Version *string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} } +type _FirmwareInfo FirmwareInfo + // NewFirmwareInfo instantiates a new FirmwareInfo object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -493,9 +496,46 @@ func (o FirmwareInfo) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *FirmwareInfo) UnmarshalJSON(data []byte) (err error) { + varFirmwareInfo := _FirmwareInfo{} + + err = json.Unmarshal(data, &varFirmwareInfo) + + if err != nil { + return err + } + + *o = FirmwareInfo(varFirmwareInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "built") + delete(additionalProperties, "created") + delete(additionalProperties, "description") + delete(additionalProperties, "filename") + delete(additionalProperties, "md5") + delete(additionalProperties, "organization") + delete(additionalProperties, "product") + delete(additionalProperties, "published") + delete(additionalProperties, "tags") + delete(additionalProperties, "target") + delete(additionalProperties, "type") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFirmwareInfo struct { value *FirmwareInfo isSet bool diff --git a/model_fleet.go b/model_fleet.go index 28b7d4b..d668b3a 100644 --- a/model_fleet.go +++ b/model_fleet.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -36,7 +35,8 @@ type Fleet struct { // Fleet UID Uid string `json:"uid"` // A watchdog timer is used to generate an event every N minutes of inactivity. 0 means no watchdog - WatchdogMins *int64 `json:"watchdog_mins,omitempty"` + WatchdogMins *int64 `json:"watchdog_mins,omitempty"` + AdditionalProperties map[string]interface{} } type _Fleet Fleet @@ -332,6 +332,11 @@ func (o Fleet) ToMap() (map[string]interface{}, error) { if !IsNil(o.WatchdogMins) { toSerialize["watchdog_mins"] = o.WatchdogMins } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -361,9 +366,7 @@ func (o *Fleet) UnmarshalJSON(data []byte) (err error) { varFleet := _Fleet{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varFleet) + err = json.Unmarshal(data, &varFleet) if err != nil { return err @@ -371,6 +374,20 @@ func (o *Fleet) UnmarshalJSON(data []byte) (err error) { *o = Fleet(varFleet) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connectivity_assurance") + delete(additionalProperties, "created") + delete(additionalProperties, "environment_variables") + delete(additionalProperties, "label") + delete(additionalProperties, "smart_rule") + delete(additionalProperties, "smart_rule_enabled") + delete(additionalProperties, "uid") + delete(additionalProperties, "watchdog_mins") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_fleet_connectivity_assurance.go b/model_fleet_connectivity_assurance.go index 4b891cb..517e25f 100644 --- a/model_fleet_connectivity_assurance.go +++ b/model_fleet_connectivity_assurance.go @@ -21,9 +21,12 @@ var _ MappedNullable = &FleetConnectivityAssurance{} // FleetConnectivityAssurance struct for FleetConnectivityAssurance type FleetConnectivityAssurance struct { // Whether Connectivity Assurance is enabled for this fleet - Enabled NullableBool `json:"enabled,omitempty"` + Enabled NullableBool `json:"enabled,omitempty"` + AdditionalProperties map[string]interface{} } +type _FleetConnectivityAssurance FleetConnectivityAssurance + // NewFleetConnectivityAssurance instantiates a new FleetConnectivityAssurance object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -97,9 +100,35 @@ func (o FleetConnectivityAssurance) ToMap() (map[string]interface{}, error) { if o.Enabled.IsSet() { toSerialize["enabled"] = o.Enabled.Get() } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *FleetConnectivityAssurance) UnmarshalJSON(data []byte) (err error) { + varFleetConnectivityAssurance := _FleetConnectivityAssurance{} + + err = json.Unmarshal(data, &varFleetConnectivityAssurance) + + if err != nil { + return err + } + + *o = FleetConnectivityAssurance(varFleetConnectivityAssurance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enabled") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableFleetConnectivityAssurance struct { value *FleetConnectivityAssurance isSet bool diff --git a/model_get_alerts_200_response.go b/model_get_alerts_200_response.go index 1381ec7..eb463dd 100644 --- a/model_get_alerts_200_response.go +++ b/model_get_alerts_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -25,7 +24,8 @@ type GetAlerts200Response struct { // The list of alerts Alerts []Alert `json:"alerts"` // True if there are more alerts - HasMore bool `json:"has_more"` + HasMore bool `json:"has_more"` + AdditionalProperties map[string]interface{} } type _GetAlerts200Response GetAlerts200Response @@ -109,6 +109,11 @@ func (o GetAlerts200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["alerts"] = o.Alerts toSerialize["has_more"] = o.HasMore + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -137,9 +142,7 @@ func (o *GetAlerts200Response) UnmarshalJSON(data []byte) (err error) { varGetAlerts200Response := _GetAlerts200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetAlerts200Response) + err = json.Unmarshal(data, &varGetAlerts200Response) if err != nil { return err @@ -147,6 +150,14 @@ func (o *GetAlerts200Response) UnmarshalJSON(data []byte) (err error) { *o = GetAlerts200Response(varGetAlerts200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "alerts") + delete(additionalProperties, "has_more") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_billing_account_200_response.go b/model_get_billing_account_200_response.go new file mode 100644 index 0000000..a1a85f0 --- /dev/null +++ b/model_get_billing_account_200_response.go @@ -0,0 +1,302 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" +) + +// checks if the GetBillingAccount200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBillingAccount200Response{} + +// GetBillingAccount200Response struct for GetBillingAccount200Response +type GetBillingAccount200Response struct { + Name *string `json:"name,omitempty"` + Owner *string `json:"owner,omitempty"` + Plan *GetBillingAccount200ResponsePlan `json:"plan,omitempty"` + Suspended *bool `json:"suspended,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetBillingAccount200Response GetBillingAccount200Response + +// NewGetBillingAccount200Response instantiates a new GetBillingAccount200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBillingAccount200Response() *GetBillingAccount200Response { + this := GetBillingAccount200Response{} + return &this +} + +// NewGetBillingAccount200ResponseWithDefaults instantiates a new GetBillingAccount200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBillingAccount200ResponseWithDefaults() *GetBillingAccount200Response { + this := GetBillingAccount200Response{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetBillingAccount200Response) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200Response) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GetBillingAccount200Response) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetBillingAccount200Response) SetName(v string) { + o.Name = &v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *GetBillingAccount200Response) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200Response) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *GetBillingAccount200Response) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *GetBillingAccount200Response) SetOwner(v string) { + o.Owner = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *GetBillingAccount200Response) GetPlan() GetBillingAccount200ResponsePlan { + if o == nil || IsNil(o.Plan) { + var ret GetBillingAccount200ResponsePlan + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200Response) GetPlanOk() (*GetBillingAccount200ResponsePlan, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *GetBillingAccount200Response) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given GetBillingAccount200ResponsePlan and assigns it to the Plan field. +func (o *GetBillingAccount200Response) SetPlan(v GetBillingAccount200ResponsePlan) { + o.Plan = &v +} + +// GetSuspended returns the Suspended field value if set, zero value otherwise. +func (o *GetBillingAccount200Response) GetSuspended() bool { + if o == nil || IsNil(o.Suspended) { + var ret bool + return ret + } + return *o.Suspended +} + +// GetSuspendedOk returns a tuple with the Suspended field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200Response) GetSuspendedOk() (*bool, bool) { + if o == nil || IsNil(o.Suspended) { + return nil, false + } + return o.Suspended, true +} + +// HasSuspended returns a boolean if a field has been set. +func (o *GetBillingAccount200Response) HasSuspended() bool { + if o != nil && !IsNil(o.Suspended) { + return true + } + + return false +} + +// SetSuspended gets a reference to the given bool and assigns it to the Suspended field. +func (o *GetBillingAccount200Response) SetSuspended(v bool) { + o.Suspended = &v +} + +// GetUid returns the Uid field value if set, zero value otherwise. +func (o *GetBillingAccount200Response) GetUid() string { + if o == nil || IsNil(o.Uid) { + var ret string + return ret + } + return *o.Uid +} + +// GetUidOk returns a tuple with the Uid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200Response) GetUidOk() (*string, bool) { + if o == nil || IsNil(o.Uid) { + return nil, false + } + return o.Uid, true +} + +// HasUid returns a boolean if a field has been set. +func (o *GetBillingAccount200Response) HasUid() bool { + if o != nil && !IsNil(o.Uid) { + return true + } + + return false +} + +// SetUid gets a reference to the given string and assigns it to the Uid field. +func (o *GetBillingAccount200Response) SetUid(v string) { + o.Uid = &v +} + +func (o GetBillingAccount200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBillingAccount200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Suspended) { + toSerialize["suspended"] = o.Suspended + } + if !IsNil(o.Uid) { + toSerialize["uid"] = o.Uid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetBillingAccount200Response) UnmarshalJSON(data []byte) (err error) { + varGetBillingAccount200Response := _GetBillingAccount200Response{} + + err = json.Unmarshal(data, &varGetBillingAccount200Response) + + if err != nil { + return err + } + + *o = GetBillingAccount200Response(varGetBillingAccount200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "owner") + delete(additionalProperties, "plan") + delete(additionalProperties, "suspended") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBillingAccount200Response struct { + value *GetBillingAccount200Response + isSet bool +} + +func (v NullableGetBillingAccount200Response) Get() *GetBillingAccount200Response { + return v.value +} + +func (v *NullableGetBillingAccount200Response) Set(val *GetBillingAccount200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBillingAccount200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBillingAccount200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBillingAccount200Response(val *GetBillingAccount200Response) *NullableGetBillingAccount200Response { + return &NullableGetBillingAccount200Response{value: val, isSet: true} +} + +func (v NullableGetBillingAccount200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBillingAccount200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_get_billing_account_200_response_plan.go b/model_get_billing_account_200_response_plan.go new file mode 100644 index 0000000..3ef4341 --- /dev/null +++ b/model_get_billing_account_200_response_plan.go @@ -0,0 +1,303 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" + "time" +) + +// checks if the GetBillingAccount200ResponsePlan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBillingAccount200ResponsePlan{} + +// GetBillingAccount200ResponsePlan struct for GetBillingAccount200ResponsePlan +type GetBillingAccount200ResponsePlan struct { + CurrentBalance *int64 `json:"current_balance,omitempty"` + EndDate *time.Time `json:"end_date,omitempty"` + EventCapacity *int64 `json:"event_capacity,omitempty"` + StartDate *time.Time `json:"start_date,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetBillingAccount200ResponsePlan GetBillingAccount200ResponsePlan + +// NewGetBillingAccount200ResponsePlan instantiates a new GetBillingAccount200ResponsePlan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBillingAccount200ResponsePlan() *GetBillingAccount200ResponsePlan { + this := GetBillingAccount200ResponsePlan{} + return &this +} + +// NewGetBillingAccount200ResponsePlanWithDefaults instantiates a new GetBillingAccount200ResponsePlan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBillingAccount200ResponsePlanWithDefaults() *GetBillingAccount200ResponsePlan { + this := GetBillingAccount200ResponsePlan{} + return &this +} + +// GetCurrentBalance returns the CurrentBalance field value if set, zero value otherwise. +func (o *GetBillingAccount200ResponsePlan) GetCurrentBalance() int64 { + if o == nil || IsNil(o.CurrentBalance) { + var ret int64 + return ret + } + return *o.CurrentBalance +} + +// GetCurrentBalanceOk returns a tuple with the CurrentBalance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200ResponsePlan) GetCurrentBalanceOk() (*int64, bool) { + if o == nil || IsNil(o.CurrentBalance) { + return nil, false + } + return o.CurrentBalance, true +} + +// HasCurrentBalance returns a boolean if a field has been set. +func (o *GetBillingAccount200ResponsePlan) HasCurrentBalance() bool { + if o != nil && !IsNil(o.CurrentBalance) { + return true + } + + return false +} + +// SetCurrentBalance gets a reference to the given int64 and assigns it to the CurrentBalance field. +func (o *GetBillingAccount200ResponsePlan) SetCurrentBalance(v int64) { + o.CurrentBalance = &v +} + +// GetEndDate returns the EndDate field value if set, zero value otherwise. +func (o *GetBillingAccount200ResponsePlan) GetEndDate() time.Time { + if o == nil || IsNil(o.EndDate) { + var ret time.Time + return ret + } + return *o.EndDate +} + +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200ResponsePlan) GetEndDateOk() (*time.Time, bool) { + if o == nil || IsNil(o.EndDate) { + return nil, false + } + return o.EndDate, true +} + +// HasEndDate returns a boolean if a field has been set. +func (o *GetBillingAccount200ResponsePlan) HasEndDate() bool { + if o != nil && !IsNil(o.EndDate) { + return true + } + + return false +} + +// SetEndDate gets a reference to the given time.Time and assigns it to the EndDate field. +func (o *GetBillingAccount200ResponsePlan) SetEndDate(v time.Time) { + o.EndDate = &v +} + +// GetEventCapacity returns the EventCapacity field value if set, zero value otherwise. +func (o *GetBillingAccount200ResponsePlan) GetEventCapacity() int64 { + if o == nil || IsNil(o.EventCapacity) { + var ret int64 + return ret + } + return *o.EventCapacity +} + +// GetEventCapacityOk returns a tuple with the EventCapacity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200ResponsePlan) GetEventCapacityOk() (*int64, bool) { + if o == nil || IsNil(o.EventCapacity) { + return nil, false + } + return o.EventCapacity, true +} + +// HasEventCapacity returns a boolean if a field has been set. +func (o *GetBillingAccount200ResponsePlan) HasEventCapacity() bool { + if o != nil && !IsNil(o.EventCapacity) { + return true + } + + return false +} + +// SetEventCapacity gets a reference to the given int64 and assigns it to the EventCapacity field. +func (o *GetBillingAccount200ResponsePlan) SetEventCapacity(v int64) { + o.EventCapacity = &v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *GetBillingAccount200ResponsePlan) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate) { + var ret time.Time + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200ResponsePlan) GetStartDateOk() (*time.Time, bool) { + if o == nil || IsNil(o.StartDate) { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *GetBillingAccount200ResponsePlan) HasStartDate() bool { + if o != nil && !IsNil(o.StartDate) { + return true + } + + return false +} + +// SetStartDate gets a reference to the given time.Time and assigns it to the StartDate field. +func (o *GetBillingAccount200ResponsePlan) SetStartDate(v time.Time) { + o.StartDate = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *GetBillingAccount200ResponsePlan) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccount200ResponsePlan) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *GetBillingAccount200ResponsePlan) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *GetBillingAccount200ResponsePlan) SetType(v string) { + o.Type = &v +} + +func (o GetBillingAccount200ResponsePlan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBillingAccount200ResponsePlan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CurrentBalance) { + toSerialize["current_balance"] = o.CurrentBalance + } + if !IsNil(o.EndDate) { + toSerialize["end_date"] = o.EndDate + } + if !IsNil(o.EventCapacity) { + toSerialize["event_capacity"] = o.EventCapacity + } + if !IsNil(o.StartDate) { + toSerialize["start_date"] = o.StartDate + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetBillingAccount200ResponsePlan) UnmarshalJSON(data []byte) (err error) { + varGetBillingAccount200ResponsePlan := _GetBillingAccount200ResponsePlan{} + + err = json.Unmarshal(data, &varGetBillingAccount200ResponsePlan) + + if err != nil { + return err + } + + *o = GetBillingAccount200ResponsePlan(varGetBillingAccount200ResponsePlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current_balance") + delete(additionalProperties, "end_date") + delete(additionalProperties, "event_capacity") + delete(additionalProperties, "start_date") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBillingAccount200ResponsePlan struct { + value *GetBillingAccount200ResponsePlan + isSet bool +} + +func (v NullableGetBillingAccount200ResponsePlan) Get() *GetBillingAccount200ResponsePlan { + return v.value +} + +func (v *NullableGetBillingAccount200ResponsePlan) Set(val *GetBillingAccount200ResponsePlan) { + v.value = val + v.isSet = true +} + +func (v NullableGetBillingAccount200ResponsePlan) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBillingAccount200ResponsePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBillingAccount200ResponsePlan(val *GetBillingAccount200ResponsePlan) *NullableGetBillingAccount200ResponsePlan { + return &NullableGetBillingAccount200ResponsePlan{value: val, isSet: true} +} + +func (v NullableGetBillingAccount200ResponsePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBillingAccount200ResponsePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_get_billing_account_balance_history_200_response.go b/model_get_billing_account_balance_history_200_response.go new file mode 100644 index 0000000..ec2da8d --- /dev/null +++ b/model_get_billing_account_balance_history_200_response.go @@ -0,0 +1,154 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" +) + +// checks if the GetBillingAccountBalanceHistory200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBillingAccountBalanceHistory200Response{} + +// GetBillingAccountBalanceHistory200Response struct for GetBillingAccountBalanceHistory200Response +type GetBillingAccountBalanceHistory200Response struct { + Data []GetBillingAccountBalanceHistory200ResponseDataInner `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetBillingAccountBalanceHistory200Response GetBillingAccountBalanceHistory200Response + +// NewGetBillingAccountBalanceHistory200Response instantiates a new GetBillingAccountBalanceHistory200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBillingAccountBalanceHistory200Response() *GetBillingAccountBalanceHistory200Response { + this := GetBillingAccountBalanceHistory200Response{} + return &this +} + +// NewGetBillingAccountBalanceHistory200ResponseWithDefaults instantiates a new GetBillingAccountBalanceHistory200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBillingAccountBalanceHistory200ResponseWithDefaults() *GetBillingAccountBalanceHistory200Response { + this := GetBillingAccountBalanceHistory200Response{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetBillingAccountBalanceHistory200Response) GetData() []GetBillingAccountBalanceHistory200ResponseDataInner { + if o == nil || IsNil(o.Data) { + var ret []GetBillingAccountBalanceHistory200ResponseDataInner + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBillingAccountBalanceHistory200Response) GetDataOk() ([]GetBillingAccountBalanceHistory200ResponseDataInner, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetBillingAccountBalanceHistory200Response) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []GetBillingAccountBalanceHistory200ResponseDataInner and assigns it to the Data field. +func (o *GetBillingAccountBalanceHistory200Response) SetData(v []GetBillingAccountBalanceHistory200ResponseDataInner) { + o.Data = v +} + +func (o GetBillingAccountBalanceHistory200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBillingAccountBalanceHistory200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetBillingAccountBalanceHistory200Response) UnmarshalJSON(data []byte) (err error) { + varGetBillingAccountBalanceHistory200Response := _GetBillingAccountBalanceHistory200Response{} + + err = json.Unmarshal(data, &varGetBillingAccountBalanceHistory200Response) + + if err != nil { + return err + } + + *o = GetBillingAccountBalanceHistory200Response(varGetBillingAccountBalanceHistory200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBillingAccountBalanceHistory200Response struct { + value *GetBillingAccountBalanceHistory200Response + isSet bool +} + +func (v NullableGetBillingAccountBalanceHistory200Response) Get() *GetBillingAccountBalanceHistory200Response { + return v.value +} + +func (v *NullableGetBillingAccountBalanceHistory200Response) Set(val *GetBillingAccountBalanceHistory200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetBillingAccountBalanceHistory200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBillingAccountBalanceHistory200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBillingAccountBalanceHistory200Response(val *GetBillingAccountBalanceHistory200Response) *NullableGetBillingAccountBalanceHistory200Response { + return &NullableGetBillingAccountBalanceHistory200Response{value: val, isSet: true} +} + +func (v NullableGetBillingAccountBalanceHistory200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBillingAccountBalanceHistory200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_get_billing_account_balance_history_200_response_data_inner.go b/model_get_billing_account_balance_history_200_response_data_inner.go new file mode 100644 index 0000000..371ac90 --- /dev/null +++ b/model_get_billing_account_balance_history_200_response_data_inner.go @@ -0,0 +1,197 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GetBillingAccountBalanceHistory200ResponseDataInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBillingAccountBalanceHistory200ResponseDataInner{} + +// GetBillingAccountBalanceHistory200ResponseDataInner struct for GetBillingAccountBalanceHistory200ResponseDataInner +type GetBillingAccountBalanceHistory200ResponseDataInner struct { + Period time.Time `json:"period"` + RemainingEventCapacity int64 `json:"remaining_event_capacity"` + AdditionalProperties map[string]interface{} +} + +type _GetBillingAccountBalanceHistory200ResponseDataInner GetBillingAccountBalanceHistory200ResponseDataInner + +// NewGetBillingAccountBalanceHistory200ResponseDataInner instantiates a new GetBillingAccountBalanceHistory200ResponseDataInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBillingAccountBalanceHistory200ResponseDataInner(period time.Time, remainingEventCapacity int64) *GetBillingAccountBalanceHistory200ResponseDataInner { + this := GetBillingAccountBalanceHistory200ResponseDataInner{} + this.Period = period + this.RemainingEventCapacity = remainingEventCapacity + return &this +} + +// NewGetBillingAccountBalanceHistory200ResponseDataInnerWithDefaults instantiates a new GetBillingAccountBalanceHistory200ResponseDataInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBillingAccountBalanceHistory200ResponseDataInnerWithDefaults() *GetBillingAccountBalanceHistory200ResponseDataInner { + this := GetBillingAccountBalanceHistory200ResponseDataInner{} + return &this +} + +// GetPeriod returns the Period field value +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetPeriod() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Period +} + +// GetPeriodOk returns a tuple with the Period field value +// and a boolean to check if the value has been set. +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetPeriodOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Period, true +} + +// SetPeriod sets field value +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) SetPeriod(v time.Time) { + o.Period = v +} + +// GetRemainingEventCapacity returns the RemainingEventCapacity field value +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetRemainingEventCapacity() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.RemainingEventCapacity +} + +// GetRemainingEventCapacityOk returns a tuple with the RemainingEventCapacity field value +// and a boolean to check if the value has been set. +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) GetRemainingEventCapacityOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.RemainingEventCapacity, true +} + +// SetRemainingEventCapacity sets field value +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) SetRemainingEventCapacity(v int64) { + o.RemainingEventCapacity = v +} + +func (o GetBillingAccountBalanceHistory200ResponseDataInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBillingAccountBalanceHistory200ResponseDataInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["period"] = o.Period + toSerialize["remaining_event_capacity"] = o.RemainingEventCapacity + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetBillingAccountBalanceHistory200ResponseDataInner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "period", + "remaining_event_capacity", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetBillingAccountBalanceHistory200ResponseDataInner := _GetBillingAccountBalanceHistory200ResponseDataInner{} + + err = json.Unmarshal(data, &varGetBillingAccountBalanceHistory200ResponseDataInner) + + if err != nil { + return err + } + + *o = GetBillingAccountBalanceHistory200ResponseDataInner(varGetBillingAccountBalanceHistory200ResponseDataInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "period") + delete(additionalProperties, "remaining_event_capacity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBillingAccountBalanceHistory200ResponseDataInner struct { + value *GetBillingAccountBalanceHistory200ResponseDataInner + isSet bool +} + +func (v NullableGetBillingAccountBalanceHistory200ResponseDataInner) Get() *GetBillingAccountBalanceHistory200ResponseDataInner { + return v.value +} + +func (v *NullableGetBillingAccountBalanceHistory200ResponseDataInner) Set(val *GetBillingAccountBalanceHistory200ResponseDataInner) { + v.value = val + v.isSet = true +} + +func (v NullableGetBillingAccountBalanceHistory200ResponseDataInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBillingAccountBalanceHistory200ResponseDataInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBillingAccountBalanceHistory200ResponseDataInner(val *GetBillingAccountBalanceHistory200ResponseDataInner) *NullableGetBillingAccountBalanceHistory200ResponseDataInner { + return &NullableGetBillingAccountBalanceHistory200ResponseDataInner{value: val, isSet: true} +} + +func (v NullableGetBillingAccountBalanceHistory200ResponseDataInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBillingAccountBalanceHistory200ResponseDataInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_get_billing_accounts_200_response.go b/model_get_billing_accounts_200_response.go index c3e344d..4744e5c 100644 --- a/model_get_billing_accounts_200_response.go +++ b/model_get_billing_accounts_200_response.go @@ -20,9 +20,12 @@ var _ MappedNullable = &GetBillingAccounts200Response{} // GetBillingAccounts200Response struct for GetBillingAccounts200Response type GetBillingAccounts200Response struct { - BillingAccounts []BillingAccount `json:"billing_accounts,omitempty"` + BillingAccounts []BillingAccount `json:"billing_accounts,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetBillingAccounts200Response GetBillingAccounts200Response + // NewGetBillingAccounts200Response instantiates a new GetBillingAccounts200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -85,9 +88,35 @@ func (o GetBillingAccounts200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.BillingAccounts) { toSerialize["billing_accounts"] = o.BillingAccounts } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetBillingAccounts200Response) UnmarshalJSON(data []byte) (err error) { + varGetBillingAccounts200Response := _GetBillingAccounts200Response{} + + err = json.Unmarshal(data, &varGetBillingAccounts200Response) + + if err != nil { + return err + } + + *o = GetBillingAccounts200Response(varGetBillingAccounts200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "billing_accounts") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetBillingAccounts200Response struct { value *GetBillingAccounts200Response isSet bool diff --git a/model_get_data_usage_200_response.go b/model_get_data_usage_200_response.go index 091ce8c..8ff6d46 100644 --- a/model_get_data_usage_200_response.go +++ b/model_get_data_usage_200_response.go @@ -21,8 +21,13 @@ var _ MappedNullable = &GetDataUsage200Response{} // GetDataUsage200Response struct for GetDataUsage200Response type GetDataUsage200Response struct { Data []GetDataUsage200ResponseDataInner `json:"data,omitempty"` + // If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure + Truncated *bool `json:"truncated,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetDataUsage200Response GetDataUsage200Response + // NewGetDataUsage200Response instantiates a new GetDataUsage200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -72,6 +77,38 @@ func (o *GetDataUsage200Response) SetData(v []GetDataUsage200ResponseDataInner) o.Data = v } +// GetTruncated returns the Truncated field value if set, zero value otherwise. +func (o *GetDataUsage200Response) GetTruncated() bool { + if o == nil || IsNil(o.Truncated) { + var ret bool + return ret + } + return *o.Truncated +} + +// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDataUsage200Response) GetTruncatedOk() (*bool, bool) { + if o == nil || IsNil(o.Truncated) { + return nil, false + } + return o.Truncated, true +} + +// HasTruncated returns a boolean if a field has been set. +func (o *GetDataUsage200Response) HasTruncated() bool { + if o != nil && !IsNil(o.Truncated) { + return true + } + + return false +} + +// SetTruncated gets a reference to the given bool and assigns it to the Truncated field. +func (o *GetDataUsage200Response) SetTruncated(v bool) { + o.Truncated = &v +} + func (o GetDataUsage200Response) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -85,9 +122,39 @@ func (o GetDataUsage200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Data) { toSerialize["data"] = o.Data } + if !IsNil(o.Truncated) { + toSerialize["truncated"] = o.Truncated + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetDataUsage200Response) UnmarshalJSON(data []byte) (err error) { + varGetDataUsage200Response := _GetDataUsage200Response{} + + err = json.Unmarshal(data, &varGetDataUsage200Response) + + if err != nil { + return err + } + + *o = GetDataUsage200Response(varGetDataUsage200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "truncated") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetDataUsage200Response struct { value *GetDataUsage200Response isSet bool diff --git a/model_get_data_usage_200_response_data_inner.go b/model_get_data_usage_200_response_data_inner.go index ada8073..ec88ab0 100644 --- a/model_get_data_usage_200_response_data_inner.go +++ b/model_get_data_usage_200_response_data_inner.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -31,10 +30,11 @@ type GetDataUsage200ResponseDataInner struct { Fleet *string `json:"fleet,omitempty"` // The ICCID of the cellular SIM card (only present when type is 'cellular') Iccid *string `json:"iccid,omitempty"` - // The IMSI of the satellite device (only present when type is 'satellite') - Imsi *string `json:"imsi,omitempty"` + // The PSID (Packet Service ID) of the satellite (or other packet-based device) + Psid *string `json:"psid,omitempty"` // The type of connectivity - Type string `json:"type"` + Type string `json:"type"` + AdditionalProperties map[string]interface{} } type _GetDataUsage200ResponseDataInner GetDataUsage200ResponseDataInner @@ -210,36 +210,36 @@ func (o *GetDataUsage200ResponseDataInner) SetIccid(v string) { o.Iccid = &v } -// GetImsi returns the Imsi field value if set, zero value otherwise. -func (o *GetDataUsage200ResponseDataInner) GetImsi() string { - if o == nil || IsNil(o.Imsi) { +// GetPsid returns the Psid field value if set, zero value otherwise. +func (o *GetDataUsage200ResponseDataInner) GetPsid() string { + if o == nil || IsNil(o.Psid) { var ret string return ret } - return *o.Imsi + return *o.Psid } -// GetImsiOk returns a tuple with the Imsi field value if set, nil otherwise +// GetPsidOk returns a tuple with the Psid field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetDataUsage200ResponseDataInner) GetImsiOk() (*string, bool) { - if o == nil || IsNil(o.Imsi) { +func (o *GetDataUsage200ResponseDataInner) GetPsidOk() (*string, bool) { + if o == nil || IsNil(o.Psid) { return nil, false } - return o.Imsi, true + return o.Psid, true } -// HasImsi returns a boolean if a field has been set. -func (o *GetDataUsage200ResponseDataInner) HasImsi() bool { - if o != nil && !IsNil(o.Imsi) { +// HasPsid returns a boolean if a field has been set. +func (o *GetDataUsage200ResponseDataInner) HasPsid() bool { + if o != nil && !IsNil(o.Psid) { return true } return false } -// SetImsi gets a reference to the given string and assigns it to the Imsi field. -func (o *GetDataUsage200ResponseDataInner) SetImsi(v string) { - o.Imsi = &v +// SetPsid gets a reference to the given string and assigns it to the Psid field. +func (o *GetDataUsage200ResponseDataInner) SetPsid(v string) { + o.Psid = &v } // GetType returns the Type field value @@ -289,10 +289,15 @@ func (o GetDataUsage200ResponseDataInner) ToMap() (map[string]interface{}, error if !IsNil(o.Iccid) { toSerialize["iccid"] = o.Iccid } - if !IsNil(o.Imsi) { - toSerialize["imsi"] = o.Imsi + if !IsNil(o.Psid) { + toSerialize["psid"] = o.Psid } toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -321,9 +326,7 @@ func (o *GetDataUsage200ResponseDataInner) UnmarshalJSON(data []byte) (err error varGetDataUsage200ResponseDataInner := _GetDataUsage200ResponseDataInner{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDataUsage200ResponseDataInner) + err = json.Unmarshal(data, &varGetDataUsage200ResponseDataInner) if err != nil { return err @@ -331,6 +334,19 @@ func (o *GetDataUsage200ResponseDataInner) UnmarshalJSON(data []byte) (err error *o = GetDataUsage200ResponseDataInner(varGetDataUsage200ResponseDataInner) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "device") + delete(additionalProperties, "device_count") + delete(additionalProperties, "fleet") + delete(additionalProperties, "iccid") + delete(additionalProperties, "psid") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_db_note_200_response.go b/model_get_db_note_200_response.go index 49c1244..8f28c85 100644 --- a/model_get_db_note_200_response.go +++ b/model_get_db_note_200_response.go @@ -25,9 +25,12 @@ type GetDbNote200Response struct { // The note payload Payload *string `json:"payload,omitempty"` // The time the Note was added to the Notecard or Notehub - Time *int32 `json:"time,omitempty"` + Time *int32 `json:"time,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetDbNote200Response GetDbNote200Response + // NewGetDbNote200Response instantiates a new GetDbNote200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o GetDbNote200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Time) { toSerialize["time"] = o.Time } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetDbNote200Response) UnmarshalJSON(data []byte) (err error) { + varGetDbNote200Response := _GetDbNote200Response{} + + err = json.Unmarshal(data, &varGetDbNote200Response) + + if err != nil { + return err + } + + *o = GetDbNote200Response(varGetDbNote200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "body") + delete(additionalProperties, "payload") + delete(additionalProperties, "time") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetDbNote200Response struct { value *GetDbNote200Response isSet bool diff --git a/model_get_device_environment_variables_by_pin_200_response.go b/model_get_device_environment_variables_by_pin_200_response.go index cc94f7b..3fe47f5 100644 --- a/model_get_device_environment_variables_by_pin_200_response.go +++ b/model_get_device_environment_variables_by_pin_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -28,6 +27,7 @@ type GetDeviceEnvironmentVariablesByPin200Response struct { EnvironmentVariablesEffective *map[string]string `json:"environment_variables_effective,omitempty"` // The environment variables that have been set using the env.default request through the Notecard API. EnvironmentVariablesEnvDefault map[string]string `json:"environment_variables_env_default"` + AdditionalProperties map[string]interface{} } type _GetDeviceEnvironmentVariablesByPin200Response GetDeviceEnvironmentVariablesByPin200Response @@ -146,6 +146,11 @@ func (o GetDeviceEnvironmentVariablesByPin200Response) ToMap() (map[string]inter toSerialize["environment_variables_effective"] = o.EnvironmentVariablesEffective } toSerialize["environment_variables_env_default"] = o.EnvironmentVariablesEnvDefault + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -174,9 +179,7 @@ func (o *GetDeviceEnvironmentVariablesByPin200Response) UnmarshalJSON(data []byt varGetDeviceEnvironmentVariablesByPin200Response := _GetDeviceEnvironmentVariablesByPin200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDeviceEnvironmentVariablesByPin200Response) + err = json.Unmarshal(data, &varGetDeviceEnvironmentVariablesByPin200Response) if err != nil { return err @@ -184,6 +187,15 @@ func (o *GetDeviceEnvironmentVariablesByPin200Response) UnmarshalJSON(data []byt *o = GetDeviceEnvironmentVariablesByPin200Response(varGetDeviceEnvironmentVariablesByPin200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "environment_variables") + delete(additionalProperties, "environment_variables_effective") + delete(additionalProperties, "environment_variables_env_default") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_device_fleets_200_response.go b/model_get_device_fleets_200_response.go index 59d9b0c..b2467b7 100644 --- a/model_get_device_fleets_200_response.go +++ b/model_get_device_fleets_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,7 +21,8 @@ var _ MappedNullable = &GetDeviceFleets200Response{} // GetDeviceFleets200Response struct for GetDeviceFleets200Response type GetDeviceFleets200Response struct { - Fleets []Fleet `json:"fleets"` + Fleets []Fleet `json:"fleets"` + AdditionalProperties map[string]interface{} } type _GetDeviceFleets200Response GetDeviceFleets200Response @@ -80,6 +80,11 @@ func (o GetDeviceFleets200Response) MarshalJSON() ([]byte, error) { func (o GetDeviceFleets200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["fleets"] = o.Fleets + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -107,9 +112,7 @@ func (o *GetDeviceFleets200Response) UnmarshalJSON(data []byte) (err error) { varGetDeviceFleets200Response := _GetDeviceFleets200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDeviceFleets200Response) + err = json.Unmarshal(data, &varGetDeviceFleets200Response) if err != nil { return err @@ -117,6 +120,13 @@ func (o *GetDeviceFleets200Response) UnmarshalJSON(data []byte) (err error) { *o = GetDeviceFleets200Response(varGetDeviceFleets200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "fleets") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_device_health_log_200_response.go b/model_get_device_health_log_200_response.go index 7fe82a9..9213754 100644 --- a/model_get_device_health_log_200_response.go +++ b/model_get_device_health_log_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,7 +21,8 @@ var _ MappedNullable = &GetDeviceHealthLog200Response{} // GetDeviceHealthLog200Response struct for GetDeviceHealthLog200Response type GetDeviceHealthLog200Response struct { - HealthLog []GetDeviceHealthLog200ResponseHealthLogInner `json:"health_log"` + HealthLog []GetDeviceHealthLog200ResponseHealthLogInner `json:"health_log"` + AdditionalProperties map[string]interface{} } type _GetDeviceHealthLog200Response GetDeviceHealthLog200Response @@ -80,6 +80,11 @@ func (o GetDeviceHealthLog200Response) MarshalJSON() ([]byte, error) { func (o GetDeviceHealthLog200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["health_log"] = o.HealthLog + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -107,9 +112,7 @@ func (o *GetDeviceHealthLog200Response) UnmarshalJSON(data []byte) (err error) { varGetDeviceHealthLog200Response := _GetDeviceHealthLog200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDeviceHealthLog200Response) + err = json.Unmarshal(data, &varGetDeviceHealthLog200Response) if err != nil { return err @@ -117,6 +120,13 @@ func (o *GetDeviceHealthLog200Response) UnmarshalJSON(data []byte) (err error) { *o = GetDeviceHealthLog200Response(varGetDeviceHealthLog200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "health_log") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_device_health_log_200_response_health_log_inner.go b/model_get_device_health_log_200_response_health_log_inner.go index a4297fb..670005c 100644 --- a/model_get_device_health_log_200_response_health_log_inner.go +++ b/model_get_device_health_log_200_response_health_log_inner.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -23,9 +22,10 @@ var _ MappedNullable = &GetDeviceHealthLog200ResponseHealthLogInner{} // GetDeviceHealthLog200ResponseHealthLogInner struct for GetDeviceHealthLog200ResponseHealthLogInner type GetDeviceHealthLog200ResponseHealthLogInner struct { - Alert bool `json:"alert"` - Text string `json:"text"` - When time.Time `json:"when"` + Alert bool `json:"alert"` + Text string `json:"text"` + When time.Time `json:"when"` + AdditionalProperties map[string]interface{} } type _GetDeviceHealthLog200ResponseHealthLogInner GetDeviceHealthLog200ResponseHealthLogInner @@ -135,6 +135,11 @@ func (o GetDeviceHealthLog200ResponseHealthLogInner) ToMap() (map[string]interfa toSerialize["alert"] = o.Alert toSerialize["text"] = o.Text toSerialize["when"] = o.When + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -164,9 +169,7 @@ func (o *GetDeviceHealthLog200ResponseHealthLogInner) UnmarshalJSON(data []byte) varGetDeviceHealthLog200ResponseHealthLogInner := _GetDeviceHealthLog200ResponseHealthLogInner{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDeviceHealthLog200ResponseHealthLogInner) + err = json.Unmarshal(data, &varGetDeviceHealthLog200ResponseHealthLogInner) if err != nil { return err @@ -174,6 +177,15 @@ func (o *GetDeviceHealthLog200ResponseHealthLogInner) UnmarshalJSON(data []byte) *o = GetDeviceHealthLog200ResponseHealthLogInner(varGetDeviceHealthLog200ResponseHealthLogInner) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "alert") + delete(additionalProperties, "text") + delete(additionalProperties, "when") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_device_latest_events_200_response.go b/model_get_device_latest_events_200_response.go index 135f82f..d823f34 100644 --- a/model_get_device_latest_events_200_response.go +++ b/model_get_device_latest_events_200_response.go @@ -21,9 +21,12 @@ var _ MappedNullable = &GetDeviceLatestEvents200Response{} // GetDeviceLatestEvents200Response struct for GetDeviceLatestEvents200Response type GetDeviceLatestEvents200Response struct { // The set of latest events. Will always include the current \"session.begin\" event. - LatestEvents []Event `json:"latest_events,omitempty"` + LatestEvents []Event `json:"latest_events,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetDeviceLatestEvents200Response GetDeviceLatestEvents200Response + // NewGetDeviceLatestEvents200Response instantiates a new GetDeviceLatestEvents200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o GetDeviceLatestEvents200Response) ToMap() (map[string]interface{}, error if !IsNil(o.LatestEvents) { toSerialize["latest_events"] = o.LatestEvents } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetDeviceLatestEvents200Response) UnmarshalJSON(data []byte) (err error) { + varGetDeviceLatestEvents200Response := _GetDeviceLatestEvents200Response{} + + err = json.Unmarshal(data, &varGetDeviceLatestEvents200Response) + + if err != nil { + return err + } + + *o = GetDeviceLatestEvents200Response(varGetDeviceLatestEvents200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "latest_events") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetDeviceLatestEvents200Response struct { value *GetDeviceLatestEvents200Response isSet bool diff --git a/model_get_device_plans_200_response.go b/model_get_device_plans_200_response.go index 52ab087..58b95a7 100644 --- a/model_get_device_plans_200_response.go +++ b/model_get_device_plans_200_response.go @@ -20,9 +20,12 @@ var _ MappedNullable = &GetDevicePlans200Response{} // GetDevicePlans200Response struct for GetDevicePlans200Response type GetDevicePlans200Response struct { - CellularPlans []CellularPlan `json:"cellular_plans,omitempty"` + CellularPlans []CellularPlan `json:"cellular_plans,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetDevicePlans200Response GetDevicePlans200Response + // NewGetDevicePlans200Response instantiates a new GetDevicePlans200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o GetDevicePlans200Response) ToMap() (map[string]interface{}, error) { if o.CellularPlans != nil { toSerialize["cellular_plans"] = o.CellularPlans } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetDevicePlans200Response) UnmarshalJSON(data []byte) (err error) { + varGetDevicePlans200Response := _GetDevicePlans200Response{} + + err = json.Unmarshal(data, &varGetDevicePlans200Response) + + if err != nil { + return err + } + + *o = GetDevicePlans200Response(varGetDevicePlans200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cellular_plans") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetDevicePlans200Response struct { value *GetDevicePlans200Response isSet bool diff --git a/model_get_device_public_key_200_response.go b/model_get_device_public_key_200_response.go index 26355b0..e837bfe 100644 --- a/model_get_device_public_key_200_response.go +++ b/model_get_device_public_key_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,8 +21,9 @@ var _ MappedNullable = &GetDevicePublicKey200Response{} // GetDevicePublicKey200Response struct for GetDevicePublicKey200Response type GetDevicePublicKey200Response struct { - Key string `json:"key"` - Uid string `json:"uid"` + Key string `json:"key"` + Uid string `json:"uid"` + AdditionalProperties map[string]interface{} } type _GetDevicePublicKey200Response GetDevicePublicKey200Response @@ -107,6 +107,11 @@ func (o GetDevicePublicKey200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["key"] = o.Key toSerialize["uid"] = o.Uid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -135,9 +140,7 @@ func (o *GetDevicePublicKey200Response) UnmarshalJSON(data []byte) (err error) { varGetDevicePublicKey200Response := _GetDevicePublicKey200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDevicePublicKey200Response) + err = json.Unmarshal(data, &varGetDevicePublicKey200Response) if err != nil { return err @@ -145,6 +148,14 @@ func (o *GetDevicePublicKey200Response) UnmarshalJSON(data []byte) (err error) { *o = GetDevicePublicKey200Response(varGetDevicePublicKey200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_device_public_keys_200_response.go b/model_get_device_public_keys_200_response.go index a8aca2b..fb3812b 100644 --- a/model_get_device_public_keys_200_response.go +++ b/model_get_device_public_keys_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,8 +21,9 @@ var _ MappedNullable = &GetDevicePublicKeys200Response{} // GetDevicePublicKeys200Response struct for GetDevicePublicKeys200Response type GetDevicePublicKeys200Response struct { - DevicePublicKeys []GetDevicePublicKeys200ResponseDevicePublicKeysInner `json:"device_public_keys"` - HasMore bool `json:"has_more"` + DevicePublicKeys []GetDevicePublicKeys200ResponseDevicePublicKeysInner `json:"device_public_keys"` + HasMore bool `json:"has_more"` + AdditionalProperties map[string]interface{} } type _GetDevicePublicKeys200Response GetDevicePublicKeys200Response @@ -107,6 +107,11 @@ func (o GetDevicePublicKeys200Response) ToMap() (map[string]interface{}, error) toSerialize := map[string]interface{}{} toSerialize["device_public_keys"] = o.DevicePublicKeys toSerialize["has_more"] = o.HasMore + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -135,9 +140,7 @@ func (o *GetDevicePublicKeys200Response) UnmarshalJSON(data []byte) (err error) varGetDevicePublicKeys200Response := _GetDevicePublicKeys200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDevicePublicKeys200Response) + err = json.Unmarshal(data, &varGetDevicePublicKeys200Response) if err != nil { return err @@ -145,6 +148,14 @@ func (o *GetDevicePublicKeys200Response) UnmarshalJSON(data []byte) (err error) *o = GetDevicePublicKeys200Response(varGetDevicePublicKeys200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_public_keys") + delete(additionalProperties, "has_more") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_device_public_keys_200_response_device_public_keys_inner.go b/model_get_device_public_keys_200_response_device_public_keys_inner.go index 4025863..4c6dd44 100644 --- a/model_get_device_public_keys_200_response_device_public_keys_inner.go +++ b/model_get_device_public_keys_200_response_device_public_keys_inner.go @@ -20,10 +20,13 @@ var _ MappedNullable = &GetDevicePublicKeys200ResponseDevicePublicKeysInner{} // GetDevicePublicKeys200ResponseDevicePublicKeysInner struct for GetDevicePublicKeys200ResponseDevicePublicKeysInner type GetDevicePublicKeys200ResponseDevicePublicKeysInner struct { - Key *string `json:"key,omitempty"` - Uid *string `json:"uid,omitempty"` + Key *string `json:"key,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetDevicePublicKeys200ResponseDevicePublicKeysInner GetDevicePublicKeys200ResponseDevicePublicKeysInner + // NewGetDevicePublicKeys200ResponseDevicePublicKeysInner instantiates a new GetDevicePublicKeys200ResponseDevicePublicKeysInner object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -121,9 +124,36 @@ func (o GetDevicePublicKeys200ResponseDevicePublicKeysInner) ToMap() (map[string if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetDevicePublicKeys200ResponseDevicePublicKeysInner) UnmarshalJSON(data []byte) (err error) { + varGetDevicePublicKeys200ResponseDevicePublicKeysInner := _GetDevicePublicKeys200ResponseDevicePublicKeysInner{} + + err = json.Unmarshal(data, &varGetDevicePublicKeys200ResponseDevicePublicKeysInner) + + if err != nil { + return err + } + + *o = GetDevicePublicKeys200ResponseDevicePublicKeysInner(varGetDevicePublicKeys200ResponseDevicePublicKeysInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetDevicePublicKeys200ResponseDevicePublicKeysInner struct { value *GetDevicePublicKeys200ResponseDevicePublicKeysInner isSet bool diff --git a/model_get_device_sessions_200_response.go b/model_get_device_sessions_200_response.go index d283dd4..4f80d11 100644 --- a/model_get_device_sessions_200_response.go +++ b/model_get_device_sessions_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,8 +21,9 @@ var _ MappedNullable = &GetDeviceSessions200Response{} // GetDeviceSessions200Response struct for GetDeviceSessions200Response type GetDeviceSessions200Response struct { - HasMore bool `json:"has_more"` - Sessions []DeviceSession `json:"sessions"` + HasMore bool `json:"has_more"` + Sessions []DeviceSession `json:"sessions"` + AdditionalProperties map[string]interface{} } type _GetDeviceSessions200Response GetDeviceSessions200Response @@ -107,6 +107,11 @@ func (o GetDeviceSessions200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["has_more"] = o.HasMore toSerialize["sessions"] = o.Sessions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -135,9 +140,7 @@ func (o *GetDeviceSessions200Response) UnmarshalJSON(data []byte) (err error) { varGetDeviceSessions200Response := _GetDeviceSessions200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDeviceSessions200Response) + err = json.Unmarshal(data, &varGetDeviceSessions200Response) if err != nil { return err @@ -145,6 +148,14 @@ func (o *GetDeviceSessions200Response) UnmarshalJSON(data []byte) (err error) { *o = GetDeviceSessions200Response(varGetDeviceSessions200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "has_more") + delete(additionalProperties, "sessions") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_devices_200_response.go b/model_get_devices_200_response.go index 41e5803..d3103af 100644 --- a/model_get_devices_200_response.go +++ b/model_get_devices_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,8 +21,9 @@ var _ MappedNullable = &GetDevices200Response{} // GetDevices200Response struct for GetDevices200Response type GetDevices200Response struct { - Devices []Device `json:"devices"` - HasMore bool `json:"has_more"` + Devices []Device `json:"devices"` + HasMore bool `json:"has_more"` + AdditionalProperties map[string]interface{} } type _GetDevices200Response GetDevices200Response @@ -107,6 +107,11 @@ func (o GetDevices200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["devices"] = o.Devices toSerialize["has_more"] = o.HasMore + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -135,9 +140,7 @@ func (o *GetDevices200Response) UnmarshalJSON(data []byte) (err error) { varGetDevices200Response := _GetDevices200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetDevices200Response) + err = json.Unmarshal(data, &varGetDevices200Response) if err != nil { return err @@ -145,6 +148,14 @@ func (o *GetDevices200Response) UnmarshalJSON(data []byte) (err error) { *o = GetDevices200Response(varGetDevices200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "devices") + delete(additionalProperties, "has_more") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_events_200_response.go b/model_get_events_200_response.go index b63c003..329d24a 100644 --- a/model_get_events_200_response.go +++ b/model_get_events_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -26,7 +25,8 @@ type GetEvents200Response struct { // True if there are more events HasMore bool `json:"has_more"` // The UID of the last event returned - Through *string `json:"through,omitempty"` + Through *string `json:"through,omitempty"` + AdditionalProperties map[string]interface{} } type _GetEvents200Response GetEvents200Response @@ -145,6 +145,11 @@ func (o GetEvents200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Through) { toSerialize["through"] = o.Through } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -173,9 +178,7 @@ func (o *GetEvents200Response) UnmarshalJSON(data []byte) (err error) { varGetEvents200Response := _GetEvents200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetEvents200Response) + err = json.Unmarshal(data, &varGetEvents200Response) if err != nil { return err @@ -183,6 +186,15 @@ func (o *GetEvents200Response) UnmarshalJSON(data []byte) (err error) { *o = GetEvents200Response(varGetEvents200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "events") + delete(additionalProperties, "has_more") + delete(additionalProperties, "through") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_events_by_cursor_200_response.go b/model_get_events_by_cursor_200_response.go index b832de0..502c46d 100644 --- a/model_get_events_by_cursor_200_response.go +++ b/model_get_events_by_cursor_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -26,7 +25,8 @@ type GetEventsByCursor200Response struct { // True if there are more events HasMore bool `json:"has_more"` // The cursor value of the next result, which is intended to be used as the \"cursor\" parameter value of the next call to this method. An empty string is returned if there are no more results after this results set. - NextCursor string `json:"next_cursor"` + NextCursor string `json:"next_cursor"` + AdditionalProperties map[string]interface{} } type _GetEventsByCursor200Response GetEventsByCursor200Response @@ -136,6 +136,11 @@ func (o GetEventsByCursor200Response) ToMap() (map[string]interface{}, error) { toSerialize["events"] = o.Events toSerialize["has_more"] = o.HasMore toSerialize["next_cursor"] = o.NextCursor + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -165,9 +170,7 @@ func (o *GetEventsByCursor200Response) UnmarshalJSON(data []byte) (err error) { varGetEventsByCursor200Response := _GetEventsByCursor200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetEventsByCursor200Response) + err = json.Unmarshal(data, &varGetEventsByCursor200Response) if err != nil { return err @@ -175,6 +178,15 @@ func (o *GetEventsByCursor200Response) UnmarshalJSON(data []byte) (err error) { *o = GetEventsByCursor200Response(varGetEventsByCursor200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "events") + delete(additionalProperties, "has_more") + delete(additionalProperties, "next_cursor") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_notefile_200_response.go b/model_get_notefile_200_response.go index 6c81d43..5bcf5a9 100644 --- a/model_get_notefile_200_response.go +++ b/model_get_notefile_200_response.go @@ -25,9 +25,12 @@ type GetNotefile200Response struct { // An object with a key for each note and a value object with the body of each Note and the time the Note was added. Notes map[string]interface{} `json:"notes,omitempty"` // The total number of notes. - Total *int32 `json:"total,omitempty"` + Total *int32 `json:"total,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetNotefile200Response GetNotefile200Response + // NewGetNotefile200Response instantiates a new GetNotefile200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o GetNotefile200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Total) { toSerialize["total"] = o.Total } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetNotefile200Response) UnmarshalJSON(data []byte) (err error) { + varGetNotefile200Response := _GetNotefile200Response{} + + err = json.Unmarshal(data, &varGetNotefile200Response) + + if err != nil { + return err + } + + *o = GetNotefile200Response(varGetNotefile200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "changes") + delete(additionalProperties, "notes") + delete(additionalProperties, "total") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetNotefile200Response struct { value *GetNotefile200Response isSet bool diff --git a/model_get_products_200_response.go b/model_get_products_200_response.go index 07600f7..cbb49a8 100644 --- a/model_get_products_200_response.go +++ b/model_get_products_200_response.go @@ -20,9 +20,12 @@ var _ MappedNullable = &GetProducts200Response{} // GetProducts200Response struct for GetProducts200Response type GetProducts200Response struct { - Products []Product `json:"products,omitempty"` + Products []Product `json:"products,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetProducts200Response GetProducts200Response + // NewGetProducts200Response instantiates a new GetProducts200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -85,9 +88,35 @@ func (o GetProducts200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Products) { toSerialize["products"] = o.Products } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetProducts200Response) UnmarshalJSON(data []byte) (err error) { + varGetProducts200Response := _GetProducts200Response{} + + err = json.Unmarshal(data, &varGetProducts200Response) + + if err != nil { + return err + } + + *o = GetProducts200Response(varGetProducts200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "products") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetProducts200Response struct { value *GetProducts200Response isSet bool diff --git a/model_get_project_members_200_response.go b/model_get_project_members_200_response.go index ccf08de..e19cb81 100644 --- a/model_get_project_members_200_response.go +++ b/model_get_project_members_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,7 +21,8 @@ var _ MappedNullable = &GetProjectMembers200Response{} // GetProjectMembers200Response struct for GetProjectMembers200Response type GetProjectMembers200Response struct { - Members []ProjectMember `json:"members"` + Members []ProjectMember `json:"members"` + AdditionalProperties map[string]interface{} } type _GetProjectMembers200Response GetProjectMembers200Response @@ -80,6 +80,11 @@ func (o GetProjectMembers200Response) MarshalJSON() ([]byte, error) { func (o GetProjectMembers200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["members"] = o.Members + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -107,9 +112,7 @@ func (o *GetProjectMembers200Response) UnmarshalJSON(data []byte) (err error) { varGetProjectMembers200Response := _GetProjectMembers200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetProjectMembers200Response) + err = json.Unmarshal(data, &varGetProjectMembers200Response) if err != nil { return err @@ -117,6 +120,13 @@ func (o *GetProjectMembers200Response) UnmarshalJSON(data []byte) (err error) { *o = GetProjectMembers200Response(varGetProjectMembers200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "members") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_projects_200_response.go b/model_get_projects_200_response.go index 3b7588a..dd94587 100644 --- a/model_get_projects_200_response.go +++ b/model_get_projects_200_response.go @@ -20,9 +20,12 @@ var _ MappedNullable = &GetProjects200Response{} // GetProjects200Response struct for GetProjects200Response type GetProjects200Response struct { - Projects []Project `json:"projects,omitempty"` + Projects []Project `json:"projects,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetProjects200Response GetProjects200Response + // NewGetProjects200Response instantiates a new GetProjects200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -85,9 +88,35 @@ func (o GetProjects200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Projects) { toSerialize["projects"] = o.Projects } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetProjects200Response) UnmarshalJSON(data []byte) (err error) { + varGetProjects200Response := _GetProjects200Response{} + + err = json.Unmarshal(data, &varGetProjects200Response) + + if err != nil { + return err + } + + *o = GetProjects200Response(varGetProjects200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "projects") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetProjects200Response struct { value *GetProjects200Response isSet bool diff --git a/model_get_route_logs_usage_200_response.go b/model_get_route_logs_usage_200_response.go index a775e9e..1ba36c4 100644 --- a/model_get_route_logs_usage_200_response.go +++ b/model_get_route_logs_usage_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,6 +22,9 @@ var _ MappedNullable = &GetRouteLogsUsage200Response{} // GetRouteLogsUsage200Response struct for GetRouteLogsUsage200Response type GetRouteLogsUsage200Response struct { RouteLogs []UsageRouteLogsData `json:"route_logs"` + // If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure + Truncated *bool `json:"truncated,omitempty"` + AdditionalProperties map[string]interface{} } type _GetRouteLogsUsage200Response GetRouteLogsUsage200Response @@ -69,6 +71,38 @@ func (o *GetRouteLogsUsage200Response) SetRouteLogs(v []UsageRouteLogsData) { o.RouteLogs = v } +// GetTruncated returns the Truncated field value if set, zero value otherwise. +func (o *GetRouteLogsUsage200Response) GetTruncated() bool { + if o == nil || IsNil(o.Truncated) { + var ret bool + return ret + } + return *o.Truncated +} + +// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRouteLogsUsage200Response) GetTruncatedOk() (*bool, bool) { + if o == nil || IsNil(o.Truncated) { + return nil, false + } + return o.Truncated, true +} + +// HasTruncated returns a boolean if a field has been set. +func (o *GetRouteLogsUsage200Response) HasTruncated() bool { + if o != nil && !IsNil(o.Truncated) { + return true + } + + return false +} + +// SetTruncated gets a reference to the given bool and assigns it to the Truncated field. +func (o *GetRouteLogsUsage200Response) SetTruncated(v bool) { + o.Truncated = &v +} + func (o GetRouteLogsUsage200Response) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -80,6 +114,14 @@ func (o GetRouteLogsUsage200Response) MarshalJSON() ([]byte, error) { func (o GetRouteLogsUsage200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["route_logs"] = o.RouteLogs + if !IsNil(o.Truncated) { + toSerialize["truncated"] = o.Truncated + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -107,9 +149,7 @@ func (o *GetRouteLogsUsage200Response) UnmarshalJSON(data []byte) (err error) { varGetRouteLogsUsage200Response := _GetRouteLogsUsage200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetRouteLogsUsage200Response) + err = json.Unmarshal(data, &varGetRouteLogsUsage200Response) if err != nil { return err @@ -117,6 +157,14 @@ func (o *GetRouteLogsUsage200Response) UnmarshalJSON(data []byte) (err error) { *o = GetRouteLogsUsage200Response(varGetRouteLogsUsage200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "route_logs") + delete(additionalProperties, "truncated") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_sessions_usage_200_response.go b/model_get_sessions_usage_200_response.go index e42f088..46adb40 100644 --- a/model_get_sessions_usage_200_response.go +++ b/model_get_sessions_usage_200_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,6 +22,9 @@ var _ MappedNullable = &GetSessionsUsage200Response{} // GetSessionsUsage200Response struct for GetSessionsUsage200Response type GetSessionsUsage200Response struct { Sessions []UsageSessionsData `json:"sessions"` + // If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure + Truncated bool `json:"truncated"` + AdditionalProperties map[string]interface{} } type _GetSessionsUsage200Response GetSessionsUsage200Response @@ -31,9 +33,10 @@ type _GetSessionsUsage200Response GetSessionsUsage200Response // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGetSessionsUsage200Response(sessions []UsageSessionsData) *GetSessionsUsage200Response { +func NewGetSessionsUsage200Response(sessions []UsageSessionsData, truncated bool) *GetSessionsUsage200Response { this := GetSessionsUsage200Response{} this.Sessions = sessions + this.Truncated = truncated return &this } @@ -69,6 +72,30 @@ func (o *GetSessionsUsage200Response) SetSessions(v []UsageSessionsData) { o.Sessions = v } +// GetTruncated returns the Truncated field value +func (o *GetSessionsUsage200Response) GetTruncated() bool { + if o == nil { + var ret bool + return ret + } + + return o.Truncated +} + +// GetTruncatedOk returns a tuple with the Truncated field value +// and a boolean to check if the value has been set. +func (o *GetSessionsUsage200Response) GetTruncatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Truncated, true +} + +// SetTruncated sets field value +func (o *GetSessionsUsage200Response) SetTruncated(v bool) { + o.Truncated = v +} + func (o GetSessionsUsage200Response) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -80,6 +107,12 @@ func (o GetSessionsUsage200Response) MarshalJSON() ([]byte, error) { func (o GetSessionsUsage200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["sessions"] = o.Sessions + toSerialize["truncated"] = o.Truncated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -89,6 +122,7 @@ func (o *GetSessionsUsage200Response) UnmarshalJSON(data []byte) (err error) { // that every required field exists as a key in the generic map. requiredProperties := []string{ "sessions", + "truncated", } allProperties := make(map[string]interface{}) @@ -107,9 +141,7 @@ func (o *GetSessionsUsage200Response) UnmarshalJSON(data []byte) (err error) { varGetSessionsUsage200Response := _GetSessionsUsage200Response{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varGetSessionsUsage200Response) + err = json.Unmarshal(data, &varGetSessionsUsage200Response) if err != nil { return err @@ -117,6 +149,14 @@ func (o *GetSessionsUsage200Response) UnmarshalJSON(data []byte) (err error) { *o = GetSessionsUsage200Response(varGetSessionsUsage200Response) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "sessions") + delete(additionalProperties, "truncated") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_get_webhooks_200_response.go b/model_get_webhooks_200_response.go index 2ae1325..1845320 100644 --- a/model_get_webhooks_200_response.go +++ b/model_get_webhooks_200_response.go @@ -20,9 +20,12 @@ var _ MappedNullable = &GetWebhooks200Response{} // GetWebhooks200Response struct for GetWebhooks200Response type GetWebhooks200Response struct { - Webhooks []WebhookSettings `json:"webhooks,omitempty"` + Webhooks []WebhookSettings `json:"webhooks,omitempty"` + AdditionalProperties map[string]interface{} } +type _GetWebhooks200Response GetWebhooks200Response + // NewGetWebhooks200Response instantiates a new GetWebhooks200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -85,9 +88,35 @@ func (o GetWebhooks200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Webhooks) { toSerialize["webhooks"] = o.Webhooks } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *GetWebhooks200Response) UnmarshalJSON(data []byte) (err error) { + varGetWebhooks200Response := _GetWebhooks200Response{} + + err = json.Unmarshal(data, &varGetWebhooks200Response) + + if err != nil { + return err + } + + *o = GetWebhooks200Response(varGetWebhooks200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "webhooks") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableGetWebhooks200Response struct { value *GetWebhooks200Response isSet bool diff --git a/model_inline_object.go b/model_inline_object.go index cfe5d25..0edce56 100644 --- a/model_inline_object.go +++ b/model_inline_object.go @@ -23,9 +23,12 @@ type InlineObject struct { // true when a template is active on the Notefile. Template *bool `json:"template,omitempty"` // The total number of notes active on the Notefile. - Total *int32 `json:"total,omitempty"` + Total *int32 `json:"total,omitempty"` + AdditionalProperties map[string]interface{} } +type _InlineObject InlineObject + // NewInlineObject instantiates a new InlineObject object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -123,9 +126,36 @@ func (o InlineObject) ToMap() (map[string]interface{}, error) { if !IsNil(o.Total) { toSerialize["total"] = o.Total } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *InlineObject) UnmarshalJSON(data []byte) (err error) { + varInlineObject := _InlineObject{} + + err = json.Unmarshal(data, &varInlineObject) + + if err != nil { + return err + } + + *o = InlineObject(varInlineObject) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "template") + delete(additionalProperties, "total") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableInlineObject struct { value *InlineObject isSet bool diff --git a/model_location.go b/model_location.go index 3935efd..740979e 100644 --- a/model_location.go +++ b/model_location.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,12 +21,13 @@ var _ MappedNullable = &Location{} // Location struct for Location type Location struct { - Country string `json:"country"` - Latitude float64 `json:"latitude"` - Longitude float64 `json:"longitude"` - Name string `json:"name"` - Timezone string `json:"timezone"` - When string `json:"when"` + Country string `json:"country"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + Name string `json:"name"` + Timezone string `json:"timezone"` + When string `json:"when"` + AdditionalProperties map[string]interface{} } type _Location Location @@ -215,6 +215,11 @@ func (o Location) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["timezone"] = o.Timezone toSerialize["when"] = o.When + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -247,9 +252,7 @@ func (o *Location) UnmarshalJSON(data []byte) (err error) { varLocation := _Location{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varLocation) + err = json.Unmarshal(data, &varLocation) if err != nil { return err @@ -257,6 +260,18 @@ func (o *Location) UnmarshalJSON(data []byte) (err error) { *o = Location(varLocation) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "country") + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + delete(additionalProperties, "name") + delete(additionalProperties, "timezone") + delete(additionalProperties, "when") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_login_200_response.go b/model_login_200_response.go index 998528f..6de8dd3 100644 --- a/model_login_200_response.go +++ b/model_login_200_response.go @@ -20,9 +20,12 @@ var _ MappedNullable = &Login200Response{} // Login200Response struct for Login200Response type Login200Response struct { - SessionToken *string `json:"session_token,omitempty"` + SessionToken *string `json:"session_token,omitempty"` + AdditionalProperties map[string]interface{} } +type _Login200Response Login200Response + // NewLogin200Response instantiates a new Login200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -85,9 +88,35 @@ func (o Login200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.SessionToken) { toSerialize["session_token"] = o.SessionToken } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Login200Response) UnmarshalJSON(data []byte) (err error) { + varLogin200Response := _Login200Response{} + + err = json.Unmarshal(data, &varLogin200Response) + + if err != nil { + return err + } + + *o = Login200Response(varLogin200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "session_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableLogin200Response struct { value *Login200Response isSet bool diff --git a/model_login_request.go b/model_login_request.go index 0404107..b94fa32 100644 --- a/model_login_request.go +++ b/model_login_request.go @@ -20,10 +20,13 @@ var _ MappedNullable = &LoginRequest{} // LoginRequest struct for LoginRequest type LoginRequest struct { - Password *string `json:"password,omitempty"` - Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + Username *string `json:"username,omitempty"` + AdditionalProperties map[string]interface{} } +type _LoginRequest LoginRequest + // NewLoginRequest instantiates a new LoginRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -121,9 +124,36 @@ func (o LoginRequest) ToMap() (map[string]interface{}, error) { if !IsNil(o.Username) { toSerialize["username"] = o.Username } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *LoginRequest) UnmarshalJSON(data []byte) (err error) { + varLoginRequest := _LoginRequest{} + + err = json.Unmarshal(data, &varLoginRequest) + + if err != nil { + return err + } + + *o = LoginRequest(varLoginRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "password") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableLoginRequest struct { value *LoginRequest isSet bool diff --git a/model_monitor.go b/model_monitor.go index 1beeaad..ff6a42d 100644 --- a/model_monitor.go +++ b/model_monitor.go @@ -48,10 +48,13 @@ type Monitor struct { // The type of source to monitor. Supported values are \"event\" and \"heartbeat\". SourceType *string `json:"source_type,omitempty"` // The type of condition to apply to the value selected by the source_selector - Threshold *int32 `json:"threshold,omitempty"` - Uid *string `json:"uid,omitempty"` + Threshold *int32 `json:"threshold,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _Monitor Monitor + // NewMonitor instantiates a new Monitor object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -709,9 +712,52 @@ func (o Monitor) ToMap() (map[string]interface{}, error) { if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Monitor) UnmarshalJSON(data []byte) (err error) { + varMonitor := _Monitor{} + + err = json.Unmarshal(data, &varMonitor) + + if err != nil { + return err + } + + *o = Monitor(varMonitor) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "aggregate_function") + delete(additionalProperties, "aggregate_window") + delete(additionalProperties, "alert") + delete(additionalProperties, "alert_routes") + delete(additionalProperties, "condition_type") + delete(additionalProperties, "description") + delete(additionalProperties, "disabled") + delete(additionalProperties, "fleet_filter") + delete(additionalProperties, "last_routed_at") + delete(additionalProperties, "name") + delete(additionalProperties, "notefile_filter") + delete(additionalProperties, "per_device") + delete(additionalProperties, "routing_cooldown_period") + delete(additionalProperties, "silenced") + delete(additionalProperties, "source_selector") + delete(additionalProperties, "source_type") + delete(additionalProperties, "threshold") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableMonitor struct { value *Monitor isSet bool diff --git a/model_note.go b/model_note.go index bfef36b..6ff39ee 100644 --- a/model_note.go +++ b/model_note.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -35,7 +34,8 @@ type Note struct { // Unix epoch seconds. Time int64 `json:"time"` // Optional location/metadata string. - Where *string `json:"where,omitempty"` + Where *string `json:"where,omitempty"` + AdditionalProperties map[string]interface{} } type _Note Note @@ -285,6 +285,11 @@ func (o Note) ToMap() (map[string]interface{}, error) { if !IsNil(o.Where) { toSerialize["where"] = o.Where } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -314,9 +319,7 @@ func (o *Note) UnmarshalJSON(data []byte) (err error) { varNote := _Note{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varNote) + err = json.Unmarshal(data, &varNote) if err != nil { return err @@ -324,6 +327,19 @@ func (o *Note) UnmarshalJSON(data []byte) (err error) { *o = Note(varNote) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "body") + delete(additionalProperties, "edge") + delete(additionalProperties, "id") + delete(additionalProperties, "payload") + delete(additionalProperties, "pending") + delete(additionalProperties, "time") + delete(additionalProperties, "where") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_note_input.go b/model_note_input.go index 6bfffdf..17fe805 100644 --- a/model_note_input.go +++ b/model_note_input.go @@ -23,9 +23,12 @@ type NoteInput struct { // Arbitrary user-defined JSON for the note. Body map[string]interface{} `json:"body,omitempty"` // Optional base64-encoded payload. - Payload *string `json:"payload,omitempty"` + Payload *string `json:"payload,omitempty"` + AdditionalProperties map[string]interface{} } +type _NoteInput NoteInput + // NewNoteInput instantiates a new NoteInput object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -123,9 +126,36 @@ func (o NoteInput) ToMap() (map[string]interface{}, error) { if !IsNil(o.Payload) { toSerialize["payload"] = o.Payload } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *NoteInput) UnmarshalJSON(data []byte) (err error) { + varNoteInput := _NoteInput{} + + err = json.Unmarshal(data, &varNoteInput) + + if err != nil { + return err + } + + *o = NoteInput(varNoteInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "body") + delete(additionalProperties, "payload") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableNoteInput struct { value *NoteInput isSet bool diff --git a/model_notefile.go b/model_notefile.go index f50f4b8..fb657dd 100644 --- a/model_notefile.go +++ b/model_notefile.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,9 +22,10 @@ var _ MappedNullable = &Notefile{} // Notefile struct for Notefile type Notefile struct { // Notefile id (e.g., \"test.qi\", \"config.db\"). - Id string `json:"id"` - Notes []Note `json:"notes"` - Template *string `json:"template,omitempty"` + Id string `json:"id"` + Notes []Note `json:"notes"` + Template *string `json:"template,omitempty"` + AdditionalProperties map[string]interface{} } type _Notefile Notefile @@ -144,6 +144,11 @@ func (o Notefile) ToMap() (map[string]interface{}, error) { if !IsNil(o.Template) { toSerialize["template"] = o.Template } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -172,9 +177,7 @@ func (o *Notefile) UnmarshalJSON(data []byte) (err error) { varNotefile := _Notefile{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varNotefile) + err = json.Unmarshal(data, &varNotefile) if err != nil { return err @@ -182,6 +185,15 @@ func (o *Notefile) UnmarshalJSON(data []byte) (err error) { *o = Notefile(varNotefile) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "notes") + delete(additionalProperties, "template") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_notefile_schema.go b/model_notefile_schema.go index 7b34d2b..0e6fb2d 100644 --- a/model_notefile_schema.go +++ b/model_notefile_schema.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -22,8 +21,9 @@ var _ MappedNullable = &NotefileSchema{} // NotefileSchema struct for NotefileSchema type NotefileSchema struct { - Notefile string `json:"notefile"` - Properties []SchemaProperty `json:"properties"` + Notefile string `json:"notefile"` + Properties []SchemaProperty `json:"properties"` + AdditionalProperties map[string]interface{} } type _NotefileSchema NotefileSchema @@ -107,6 +107,11 @@ func (o NotefileSchema) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["notefile"] = o.Notefile toSerialize["properties"] = o.Properties + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -135,9 +140,7 @@ func (o *NotefileSchema) UnmarshalJSON(data []byte) (err error) { varNotefileSchema := _NotefileSchema{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varNotefileSchema) + err = json.Unmarshal(data, &varNotefileSchema) if err != nil { return err @@ -145,6 +148,14 @@ func (o *NotefileSchema) UnmarshalJSON(data []byte) (err error) { *o = NotefileSchema(varNotefileSchema) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "notefile") + delete(additionalProperties, "properties") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_notehub_route_summary.go b/model_notehub_route_summary.go index ea4e55c..cb7b100 100644 --- a/model_notehub_route_summary.go +++ b/model_notehub_route_summary.go @@ -21,13 +21,16 @@ var _ MappedNullable = &NotehubRouteSummary{} // NotehubRouteSummary struct for NotehubRouteSummary type NotehubRouteSummary struct { - Disabled *bool `json:"disabled,omitempty"` - Label *string `json:"label,omitempty"` - Modified *time.Time `json:"modified,omitempty"` - Type *string `json:"type,omitempty"` - Uid *string `json:"uid,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Label *string `json:"label,omitempty"` + Modified *time.Time `json:"modified,omitempty"` + Type *string `json:"type,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _NotehubRouteSummary NotehubRouteSummary + // NewNotehubRouteSummary instantiates a new NotehubRouteSummary object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -246,9 +249,39 @@ func (o NotehubRouteSummary) ToMap() (map[string]interface{}, error) { if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *NotehubRouteSummary) UnmarshalJSON(data []byte) (err error) { + varNotehubRouteSummary := _NotehubRouteSummary{} + + err = json.Unmarshal(data, &varNotehubRouteSummary) + + if err != nil { + return err + } + + *o = NotehubRouteSummary(varNotehubRouteSummary) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "disabled") + delete(additionalProperties, "label") + delete(additionalProperties, "modified") + delete(additionalProperties, "type") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableNotehubRouteSummary struct { value *NotehubRouteSummary isSet bool diff --git a/model_o_auth2_client_credentials_request.go b/model_o_auth2_client_credentials_request.go new file mode 100644 index 0000000..f47dc26 --- /dev/null +++ b/model_o_auth2_client_credentials_request.go @@ -0,0 +1,263 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuth2ClientCredentialsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ClientCredentialsRequest{} + +// OAuth2ClientCredentialsRequest struct for OAuth2ClientCredentialsRequest +type OAuth2ClientCredentialsRequest struct { + ClientId string `json:"client_id"` + ClientSecret string `json:"client_secret"` + GrantType string `json:"grant_type"` + // Space-delimited scopes. + Scope *string `json:"scope,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuth2ClientCredentialsRequest OAuth2ClientCredentialsRequest + +// NewOAuth2ClientCredentialsRequest instantiates a new OAuth2ClientCredentialsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuth2ClientCredentialsRequest(clientId string, clientSecret string, grantType string) *OAuth2ClientCredentialsRequest { + this := OAuth2ClientCredentialsRequest{} + this.ClientId = clientId + this.ClientSecret = clientSecret + this.GrantType = grantType + return &this +} + +// NewOAuth2ClientCredentialsRequestWithDefaults instantiates a new OAuth2ClientCredentialsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuth2ClientCredentialsRequestWithDefaults() *OAuth2ClientCredentialsRequest { + this := OAuth2ClientCredentialsRequest{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *OAuth2ClientCredentialsRequest) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *OAuth2ClientCredentialsRequest) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *OAuth2ClientCredentialsRequest) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *OAuth2ClientCredentialsRequest) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *OAuth2ClientCredentialsRequest) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *OAuth2ClientCredentialsRequest) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetGrantType returns the GrantType field value +func (o *OAuth2ClientCredentialsRequest) GetGrantType() string { + if o == nil { + var ret string + return ret + } + + return o.GrantType +} + +// GetGrantTypeOk returns a tuple with the GrantType field value +// and a boolean to check if the value has been set. +func (o *OAuth2ClientCredentialsRequest) GetGrantTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GrantType, true +} + +// SetGrantType sets field value +func (o *OAuth2ClientCredentialsRequest) SetGrantType(v string) { + o.GrantType = v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *OAuth2ClientCredentialsRequest) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ClientCredentialsRequest) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *OAuth2ClientCredentialsRequest) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *OAuth2ClientCredentialsRequest) SetScope(v string) { + o.Scope = &v +} + +func (o OAuth2ClientCredentialsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ClientCredentialsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + toSerialize["grant_type"] = o.GrantType + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuth2ClientCredentialsRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + "client_secret", + "grant_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuth2ClientCredentialsRequest := _OAuth2ClientCredentialsRequest{} + + err = json.Unmarshal(data, &varOAuth2ClientCredentialsRequest) + + if err != nil { + return err + } + + *o = OAuth2ClientCredentialsRequest(varOAuth2ClientCredentialsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "grant_type") + delete(additionalProperties, "scope") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuth2ClientCredentialsRequest struct { + value *OAuth2ClientCredentialsRequest + isSet bool +} + +func (v NullableOAuth2ClientCredentialsRequest) Get() *OAuth2ClientCredentialsRequest { + return v.value +} + +func (v *NullableOAuth2ClientCredentialsRequest) Set(val *OAuth2ClientCredentialsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuth2ClientCredentialsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuth2ClientCredentialsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuth2ClientCredentialsRequest(val *OAuth2ClientCredentialsRequest) *NullableOAuth2ClientCredentialsRequest { + return &NullableOAuth2ClientCredentialsRequest{value: val, isSet: true} +} + +func (v NullableOAuth2ClientCredentialsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuth2ClientCredentialsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_o_auth2_error.go b/model_o_auth2_error.go index 027171a..983c4f7 100644 --- a/model_o_auth2_error.go +++ b/model_o_auth2_error.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -25,7 +24,8 @@ type OAuth2Error struct { // RFC 6749 error code. Error string `json:"error"` // Human-readable explanation of the error. - ErrorDescription *string `json:"error_description,omitempty"` + ErrorDescription *string `json:"error_description,omitempty"` + AdditionalProperties map[string]interface{} } type _OAuth2Error OAuth2Error @@ -118,6 +118,11 @@ func (o OAuth2Error) ToMap() (map[string]interface{}, error) { if !IsNil(o.ErrorDescription) { toSerialize["error_description"] = o.ErrorDescription } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -145,9 +150,7 @@ func (o *OAuth2Error) UnmarshalJSON(data []byte) (err error) { varOAuth2Error := _OAuth2Error{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varOAuth2Error) + err = json.Unmarshal(data, &varOAuth2Error) if err != nil { return err @@ -155,6 +158,14 @@ func (o *OAuth2Error) UnmarshalJSON(data []byte) (err error) { *o = OAuth2Error(varOAuth2Error) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "error") + delete(additionalProperties, "error_description") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_o_auth2_token_response.go b/model_o_auth2_token_response.go index 89e9ac9..c9711c7 100644 --- a/model_o_auth2_token_response.go +++ b/model_o_auth2_token_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -29,7 +28,8 @@ type OAuth2TokenResponse struct { // Granted scopes (space-delimited). Scope *string `json:"scope,omitempty"` // Usually 'bearer' - TokenType string `json:"token_type"` + TokenType string `json:"token_type"` + AdditionalProperties map[string]interface{} } type _OAuth2TokenResponse OAuth2TokenResponse @@ -174,6 +174,11 @@ func (o OAuth2TokenResponse) ToMap() (map[string]interface{}, error) { toSerialize["scope"] = o.Scope } toSerialize["token_type"] = o.TokenType + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -203,9 +208,7 @@ func (o *OAuth2TokenResponse) UnmarshalJSON(data []byte) (err error) { varOAuth2TokenResponse := _OAuth2TokenResponse{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varOAuth2TokenResponse) + err = json.Unmarshal(data, &varOAuth2TokenResponse) if err != nil { return err @@ -213,6 +216,16 @@ func (o *OAuth2TokenResponse) UnmarshalJSON(data []byte) (err error) { *o = OAuth2TokenResponse(varOAuth2TokenResponse) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "access_token") + delete(additionalProperties, "expires_in") + delete(additionalProperties, "scope") + delete(additionalProperties, "token_type") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_personal_access_token.go b/model_personal_access_token.go index 2b3e091..391c2c9 100644 --- a/model_personal_access_token.go +++ b/model_personal_access_token.go @@ -35,9 +35,12 @@ type PersonalAccessToken struct { // if true, this token cannot be used Suspended *bool `json:"suspended,omitempty"` // Unique and public identifier - Uid *string `json:"uid,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _PersonalAccessToken PersonalAccessToken + // NewPersonalAccessToken instantiates a new PersonalAccessToken object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -367,9 +370,42 @@ func (o PersonalAccessToken) ToMap() (map[string]interface{}, error) { if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *PersonalAccessToken) UnmarshalJSON(data []byte) (err error) { + varPersonalAccessToken := _PersonalAccessToken{} + + err = json.Unmarshal(data, &varPersonalAccessToken) + + if err != nil { + return err + } + + *o = PersonalAccessToken(varPersonalAccessToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by") + delete(additionalProperties, "description") + delete(additionalProperties, "expires_at") + delete(additionalProperties, "last_used") + delete(additionalProperties, "name") + delete(additionalProperties, "suspended") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePersonalAccessToken struct { value *PersonalAccessToken isSet bool diff --git a/model_personal_access_token_created_by.go b/model_personal_access_token_created_by.go index 3835911..5cefc44 100644 --- a/model_personal_access_token_created_by.go +++ b/model_personal_access_token_created_by.go @@ -20,11 +20,14 @@ var _ MappedNullable = &PersonalAccessTokenCreatedBy{} // PersonalAccessTokenCreatedBy The user that created this key type PersonalAccessTokenCreatedBy struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - Uid *string `json:"uid,omitempty"` + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _PersonalAccessTokenCreatedBy PersonalAccessTokenCreatedBy + // NewPersonalAccessTokenCreatedBy instantiates a new PersonalAccessTokenCreatedBy object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -157,9 +160,37 @@ func (o PersonalAccessTokenCreatedBy) ToMap() (map[string]interface{}, error) { if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *PersonalAccessTokenCreatedBy) UnmarshalJSON(data []byte) (err error) { + varPersonalAccessTokenCreatedBy := _PersonalAccessTokenCreatedBy{} + + err = json.Unmarshal(data, &varPersonalAccessTokenCreatedBy) + + if err != nil { + return err + } + + *o = PersonalAccessTokenCreatedBy(varPersonalAccessTokenCreatedBy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + delete(additionalProperties, "name") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePersonalAccessTokenCreatedBy struct { value *PersonalAccessTokenCreatedBy isSet bool diff --git a/model_personal_access_token_info.go b/model_personal_access_token_info.go index 0db3103..cd812fa 100644 --- a/model_personal_access_token_info.go +++ b/model_personal_access_token_info.go @@ -26,9 +26,12 @@ type PersonalAccessTokenInfo struct { ExpiresAt NullableTime `json:"expires_at,omitempty"` Name *string `json:"name,omitempty"` // if true, the token is temporarily suspended - Suspended *bool `json:"suspended,omitempty"` + Suspended *bool `json:"suspended,omitempty"` + AdditionalProperties map[string]interface{} } +type _PersonalAccessTokenInfo PersonalAccessTokenInfo + // NewPersonalAccessTokenInfo instantiates a new PersonalAccessTokenInfo object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -207,9 +210,38 @@ func (o PersonalAccessTokenInfo) ToMap() (map[string]interface{}, error) { if !IsNil(o.Suspended) { toSerialize["suspended"] = o.Suspended } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *PersonalAccessTokenInfo) UnmarshalJSON(data []byte) (err error) { + varPersonalAccessTokenInfo := _PersonalAccessTokenInfo{} + + err = json.Unmarshal(data, &varPersonalAccessTokenInfo) + + if err != nil { + return err + } + + *o = PersonalAccessTokenInfo(varPersonalAccessTokenInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "expires_at") + delete(additionalProperties, "name") + delete(additionalProperties, "suspended") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePersonalAccessTokenInfo struct { value *PersonalAccessTokenInfo isSet bool diff --git a/model_personal_access_token_secret.go b/model_personal_access_token_secret.go index 633038c..ad61d49 100644 --- a/model_personal_access_token_secret.go +++ b/model_personal_access_token_secret.go @@ -23,9 +23,12 @@ type PersonalAccessTokenSecret struct { // The secret Secret *string `json:"secret,omitempty"` // Unique and public identifier - Uid *string `json:"uid,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _PersonalAccessTokenSecret PersonalAccessTokenSecret + // NewPersonalAccessTokenSecret instantiates a new PersonalAccessTokenSecret object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -123,9 +126,36 @@ func (o PersonalAccessTokenSecret) ToMap() (map[string]interface{}, error) { if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *PersonalAccessTokenSecret) UnmarshalJSON(data []byte) (err error) { + varPersonalAccessTokenSecret := _PersonalAccessTokenSecret{} + + err = json.Unmarshal(data, &varPersonalAccessTokenSecret) + + if err != nil { + return err + } + + *o = PersonalAccessTokenSecret(varPersonalAccessTokenSecret) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "secret") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullablePersonalAccessTokenSecret struct { value *PersonalAccessTokenSecret isSet bool diff --git a/model_product.go b/model_product.go index 1170ffa..9603c48 100644 --- a/model_product.go +++ b/model_product.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -26,6 +25,7 @@ type Product struct { DisableDevicesByDefault bool `json:"disable_devices_by_default"` Label string `json:"label"` Uid string `json:"uid"` + AdditionalProperties map[string]interface{} } type _Product Product @@ -171,6 +171,11 @@ func (o Product) ToMap() (map[string]interface{}, error) { toSerialize["disable_devices_by_default"] = o.DisableDevicesByDefault toSerialize["label"] = o.Label toSerialize["uid"] = o.Uid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -200,9 +205,7 @@ func (o *Product) UnmarshalJSON(data []byte) (err error) { varProduct := _Product{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProduct) + err = json.Unmarshal(data, &varProduct) if err != nil { return err @@ -210,6 +213,16 @@ func (o *Product) UnmarshalJSON(data []byte) (err error) { *o = Product(varProduct) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "auto_provision_fleets") + delete(additionalProperties, "disable_devices_by_default") + delete(additionalProperties, "label") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_project.go b/model_project.go index fb2f1a7..322f34b 100644 --- a/model_project.go +++ b/model_project.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -29,6 +28,7 @@ type Project struct { Role NullableRole `json:"role,omitempty"` TechnicalContact NullableContact `json:"technical_contact,omitempty"` Uid string `json:"uid"` + AdditionalProperties map[string]interface{} } type _Project Project @@ -276,6 +276,11 @@ func (o Project) ToMap() (map[string]interface{}, error) { toSerialize["technical_contact"] = o.TechnicalContact.Get() } toSerialize["uid"] = o.Uid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -305,9 +310,7 @@ func (o *Project) UnmarshalJSON(data []byte) (err error) { varProject := _Project{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProject) + err = json.Unmarshal(data, &varProject) if err != nil { return err @@ -315,6 +318,18 @@ func (o *Project) UnmarshalJSON(data []byte) (err error) { *o = Project(varProject) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "administrative_contact") + delete(additionalProperties, "created") + delete(additionalProperties, "label") + delete(additionalProperties, "role") + delete(additionalProperties, "technical_contact") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_project_member.go b/model_project_member.go index 5796088..e167ab7 100644 --- a/model_project_member.go +++ b/model_project_member.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,9 +22,10 @@ var _ MappedNullable = &ProjectMember{} // ProjectMember struct for ProjectMember type ProjectMember struct { // The email address of the project member. This property will only be populated if the viewer is an owner of the project. - Email string `json:"email"` - Name string `json:"name"` - Role NullableRole `json:"role"` + Email string `json:"email"` + Name string `json:"name"` + Role NullableRole `json:"role"` + AdditionalProperties map[string]interface{} } type _ProjectMember ProjectMember @@ -137,6 +137,11 @@ func (o ProjectMember) ToMap() (map[string]interface{}, error) { toSerialize["email"] = o.Email toSerialize["name"] = o.Name toSerialize["role"] = o.Role.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -166,9 +171,7 @@ func (o *ProjectMember) UnmarshalJSON(data []byte) (err error) { varProjectMember := _ProjectMember{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProjectMember) + err = json.Unmarshal(data, &varProjectMember) if err != nil { return err @@ -176,6 +179,15 @@ func (o *ProjectMember) UnmarshalJSON(data []byte) (err error) { *o = ProjectMember(varProjectMember) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email") + delete(additionalProperties, "name") + delete(additionalProperties, "role") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_provision_device_request.go b/model_provision_device_request.go index 3ff03e5..3edd708 100644 --- a/model_provision_device_request.go +++ b/model_provision_device_request.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -27,7 +26,8 @@ type ProvisionDeviceRequest struct { // The fleetUIDs to provision the device to. FleetUids []string `json:"fleet_uids,omitempty"` // The ProductUID that the device should use. - ProductUid string `json:"product_uid"` + ProductUid string `json:"product_uid"` + AdditionalProperties map[string]interface{} } type _ProvisionDeviceRequest ProvisionDeviceRequest @@ -156,6 +156,11 @@ func (o ProvisionDeviceRequest) ToMap() (map[string]interface{}, error) { toSerialize["fleet_uids"] = o.FleetUids } toSerialize["product_uid"] = o.ProductUid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -183,9 +188,7 @@ func (o *ProvisionDeviceRequest) UnmarshalJSON(data []byte) (err error) { varProvisionDeviceRequest := _ProvisionDeviceRequest{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varProvisionDeviceRequest) + err = json.Unmarshal(data, &varProvisionDeviceRequest) if err != nil { return err @@ -193,6 +196,15 @@ func (o *ProvisionDeviceRequest) UnmarshalJSON(data []byte) (err error) { *o = ProvisionDeviceRequest(varProvisionDeviceRequest) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_sn") + delete(additionalProperties, "fleet_uids") + delete(additionalProperties, "product_uid") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_repository.go b/model_repository.go index c845748..91c896a 100644 --- a/model_repository.go +++ b/model_repository.go @@ -25,9 +25,12 @@ type Repository struct { Name *string `json:"name,omitempty"` ProjectUids []string `json:"project_uids,omitempty"` // The unique identifier for the data repository - Uid *string `json:"uid,omitempty"` + Uid *string `json:"uid,omitempty"` + AdditionalProperties map[string]interface{} } +type _Repository Repository + // NewRepository instantiates a new Repository object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -195,9 +198,38 @@ func (o Repository) ToMap() (map[string]interface{}, error) { if !IsNil(o.Uid) { toSerialize["uid"] = o.Uid } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *Repository) UnmarshalJSON(data []byte) (err error) { + varRepository := _Repository{} + + err = json.Unmarshal(data, &varRepository) + + if err != nil { + return err + } + + *o = Repository(varRepository) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "fleet_uids") + delete(additionalProperties, "name") + delete(additionalProperties, "project_uids") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableRepository struct { value *Repository isSet bool diff --git a/model_route_log.go b/model_route_log.go index 7be7f63..fbb9d15 100644 --- a/model_route_log.go +++ b/model_route_log.go @@ -35,9 +35,12 @@ type RouteLog struct { // The response body of the route. Text *string `json:"text,omitempty"` // The URL of the route. - Url *string `json:"url,omitempty"` + Url *string `json:"url,omitempty"` + AdditionalProperties map[string]interface{} } +type _RouteLog RouteLog + // NewRouteLog instantiates a new RouteLog object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -345,9 +348,42 @@ func (o RouteLog) ToMap() (map[string]interface{}, error) { if !IsNil(o.Url) { toSerialize["url"] = o.Url } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *RouteLog) UnmarshalJSON(data []byte) (err error) { + varRouteLog := _RouteLog{} + + err = json.Unmarshal(data, &varRouteLog) + + if err != nil { + return err + } + + *o = RouteLog(varRouteLog) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "attn") + delete(additionalProperties, "date") + delete(additionalProperties, "duration") + delete(additionalProperties, "event_uid") + delete(additionalProperties, "route_uid") + delete(additionalProperties, "status") + delete(additionalProperties, "text") + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableRouteLog struct { value *RouteLog isSet bool diff --git a/model_route_transform_settings.go b/model_route_transform_settings.go index 76fb282..b17d048 100644 --- a/model_route_transform_settings.go +++ b/model_route_transform_settings.go @@ -25,9 +25,12 @@ type RouteTransformSettings struct { // JSONata expression used to transform the data payload (outgoing). Jsonata *string `json:"jsonata,omitempty"` // JSONata expression used to transform the data payload (incoming). - JsonataIn *string `json:"jsonata_in,omitempty"` + JsonataIn *string `json:"jsonata_in,omitempty"` + AdditionalProperties map[string]interface{} } +type _RouteTransformSettings RouteTransformSettings + // NewRouteTransformSettings instantiates a new RouteTransformSettings object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o RouteTransformSettings) ToMap() (map[string]interface{}, error) { if !IsNil(o.JsonataIn) { toSerialize["jsonata_in"] = o.JsonataIn } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *RouteTransformSettings) UnmarshalJSON(data []byte) (err error) { + varRouteTransformSettings := _RouteTransformSettings{} + + err = json.Unmarshal(data, &varRouteTransformSettings) + + if err != nil { + return err + } + + *o = RouteTransformSettings(varRouteTransformSettings) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "format") + delete(additionalProperties, "jsonata") + delete(additionalProperties, "jsonata_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableRouteTransformSettings struct { value *RouteTransformSettings isSet bool diff --git a/model_satellite_data_usage.go b/model_satellite_data_usage.go new file mode 100644 index 0000000..ec66514 --- /dev/null +++ b/model_satellite_data_usage.go @@ -0,0 +1,258 @@ +/* +Notehub API + +The OpenAPI definition for the Notehub.io API. + +API version: 1.2.0 +Contact: engineering@blues.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package notehub + +import ( + "encoding/json" + "fmt" +) + +// checks if the SatelliteDataUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SatelliteDataUsage{} + +// SatelliteDataUsage struct for SatelliteDataUsage +type SatelliteDataUsage struct { + // Bytes remaining in the plan + BytesRemaining int64 `json:"bytes_remaining"` + // Total bytes included in the plan + BytesTotal int64 `json:"bytes_total"` + // Bytes used to date + BytesUsed int64 `json:"bytes_used"` + // Billable bytes used to date + BytesUsedBillable int64 `json:"bytes_used_billable"` + AdditionalProperties map[string]interface{} +} + +type _SatelliteDataUsage SatelliteDataUsage + +// NewSatelliteDataUsage instantiates a new SatelliteDataUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSatelliteDataUsage(bytesRemaining int64, bytesTotal int64, bytesUsed int64, bytesUsedBillable int64) *SatelliteDataUsage { + this := SatelliteDataUsage{} + this.BytesRemaining = bytesRemaining + this.BytesTotal = bytesTotal + this.BytesUsed = bytesUsed + this.BytesUsedBillable = bytesUsedBillable + return &this +} + +// NewSatelliteDataUsageWithDefaults instantiates a new SatelliteDataUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSatelliteDataUsageWithDefaults() *SatelliteDataUsage { + this := SatelliteDataUsage{} + return &this +} + +// GetBytesRemaining returns the BytesRemaining field value +func (o *SatelliteDataUsage) GetBytesRemaining() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.BytesRemaining +} + +// GetBytesRemainingOk returns a tuple with the BytesRemaining field value +// and a boolean to check if the value has been set. +func (o *SatelliteDataUsage) GetBytesRemainingOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.BytesRemaining, true +} + +// SetBytesRemaining sets field value +func (o *SatelliteDataUsage) SetBytesRemaining(v int64) { + o.BytesRemaining = v +} + +// GetBytesTotal returns the BytesTotal field value +func (o *SatelliteDataUsage) GetBytesTotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.BytesTotal +} + +// GetBytesTotalOk returns a tuple with the BytesTotal field value +// and a boolean to check if the value has been set. +func (o *SatelliteDataUsage) GetBytesTotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.BytesTotal, true +} + +// SetBytesTotal sets field value +func (o *SatelliteDataUsage) SetBytesTotal(v int64) { + o.BytesTotal = v +} + +// GetBytesUsed returns the BytesUsed field value +func (o *SatelliteDataUsage) GetBytesUsed() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.BytesUsed +} + +// GetBytesUsedOk returns a tuple with the BytesUsed field value +// and a boolean to check if the value has been set. +func (o *SatelliteDataUsage) GetBytesUsedOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.BytesUsed, true +} + +// SetBytesUsed sets field value +func (o *SatelliteDataUsage) SetBytesUsed(v int64) { + o.BytesUsed = v +} + +// GetBytesUsedBillable returns the BytesUsedBillable field value +func (o *SatelliteDataUsage) GetBytesUsedBillable() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.BytesUsedBillable +} + +// GetBytesUsedBillableOk returns a tuple with the BytesUsedBillable field value +// and a boolean to check if the value has been set. +func (o *SatelliteDataUsage) GetBytesUsedBillableOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.BytesUsedBillable, true +} + +// SetBytesUsedBillable sets field value +func (o *SatelliteDataUsage) SetBytesUsedBillable(v int64) { + o.BytesUsedBillable = v +} + +func (o SatelliteDataUsage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SatelliteDataUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bytes_remaining"] = o.BytesRemaining + toSerialize["bytes_total"] = o.BytesTotal + toSerialize["bytes_used"] = o.BytesUsed + toSerialize["bytes_used_billable"] = o.BytesUsedBillable + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SatelliteDataUsage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bytes_remaining", + "bytes_total", + "bytes_used", + "bytes_used_billable", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSatelliteDataUsage := _SatelliteDataUsage{} + + err = json.Unmarshal(data, &varSatelliteDataUsage) + + if err != nil { + return err + } + + *o = SatelliteDataUsage(varSatelliteDataUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "bytes_remaining") + delete(additionalProperties, "bytes_total") + delete(additionalProperties, "bytes_used") + delete(additionalProperties, "bytes_used_billable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSatelliteDataUsage struct { + value *SatelliteDataUsage + isSet bool +} + +func (v NullableSatelliteDataUsage) Get() *SatelliteDataUsage { + return v.value +} + +func (v *NullableSatelliteDataUsage) Set(val *SatelliteDataUsage) { + v.value = val + v.isSet = true +} + +func (v NullableSatelliteDataUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableSatelliteDataUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSatelliteDataUsage(val *SatelliteDataUsage) *NullableSatelliteDataUsage { + return &NullableSatelliteDataUsage{value: val, isSet: true} +} + +func (v NullableSatelliteDataUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSatelliteDataUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/model_satellite_plan.go b/model_satellite_plan.go index e524db8..7e6ae4e 100644 --- a/model_satellite_plan.go +++ b/model_satellite_plan.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,14 +22,17 @@ var _ MappedNullable = &SatellitePlan{} // SatellitePlan struct for SatellitePlan type SatellitePlan struct { // Activation date of the satellite plan as Unix timestamp - Activated int64 `json:"activated"` - BillableBytes *DataUsage `json:"billable_bytes,omitempty"` - // Time this plan information was last updated - LastUpdated *int64 `json:"last_updated,omitempty"` + Activated int64 `json:"activated"` + // When this Starnote last had a session + LastSessionAt *int64 `json:"last_session_at,omitempty"` + // Minimum billable bytes + MinimumBillableBytes *int64 `json:"minimum_billable_bytes,omitempty"` // Non-Terrestrial Network provider name NtnProvider string `json:"ntn_provider"` // Provider-specific identifier for the satellite subscription - Psid string `json:"psid"` + Psid string `json:"psid"` + SatelliteDataUsage *SatelliteDataUsage `json:"satellite_data_usage,omitempty"` + AdditionalProperties map[string]interface{} } type _SatellitePlan SatellitePlan @@ -79,68 +81,68 @@ func (o *SatellitePlan) SetActivated(v int64) { o.Activated = v } -// GetBillableBytes returns the BillableBytes field value if set, zero value otherwise. -func (o *SatellitePlan) GetBillableBytes() DataUsage { - if o == nil || IsNil(o.BillableBytes) { - var ret DataUsage +// GetLastSessionAt returns the LastSessionAt field value if set, zero value otherwise. +func (o *SatellitePlan) GetLastSessionAt() int64 { + if o == nil || IsNil(o.LastSessionAt) { + var ret int64 return ret } - return *o.BillableBytes + return *o.LastSessionAt } -// GetBillableBytesOk returns a tuple with the BillableBytes field value if set, nil otherwise +// GetLastSessionAtOk returns a tuple with the LastSessionAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SatellitePlan) GetBillableBytesOk() (*DataUsage, bool) { - if o == nil || IsNil(o.BillableBytes) { +func (o *SatellitePlan) GetLastSessionAtOk() (*int64, bool) { + if o == nil || IsNil(o.LastSessionAt) { return nil, false } - return o.BillableBytes, true + return o.LastSessionAt, true } -// HasBillableBytes returns a boolean if a field has been set. -func (o *SatellitePlan) HasBillableBytes() bool { - if o != nil && !IsNil(o.BillableBytes) { +// HasLastSessionAt returns a boolean if a field has been set. +func (o *SatellitePlan) HasLastSessionAt() bool { + if o != nil && !IsNil(o.LastSessionAt) { return true } return false } -// SetBillableBytes gets a reference to the given DataUsage and assigns it to the BillableBytes field. -func (o *SatellitePlan) SetBillableBytes(v DataUsage) { - o.BillableBytes = &v +// SetLastSessionAt gets a reference to the given int64 and assigns it to the LastSessionAt field. +func (o *SatellitePlan) SetLastSessionAt(v int64) { + o.LastSessionAt = &v } -// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise. -func (o *SatellitePlan) GetLastUpdated() int64 { - if o == nil || IsNil(o.LastUpdated) { +// GetMinimumBillableBytes returns the MinimumBillableBytes field value if set, zero value otherwise. +func (o *SatellitePlan) GetMinimumBillableBytes() int64 { + if o == nil || IsNil(o.MinimumBillableBytes) { var ret int64 return ret } - return *o.LastUpdated + return *o.MinimumBillableBytes } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise +// GetMinimumBillableBytesOk returns a tuple with the MinimumBillableBytes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SatellitePlan) GetLastUpdatedOk() (*int64, bool) { - if o == nil || IsNil(o.LastUpdated) { +func (o *SatellitePlan) GetMinimumBillableBytesOk() (*int64, bool) { + if o == nil || IsNil(o.MinimumBillableBytes) { return nil, false } - return o.LastUpdated, true + return o.MinimumBillableBytes, true } -// HasLastUpdated returns a boolean if a field has been set. -func (o *SatellitePlan) HasLastUpdated() bool { - if o != nil && !IsNil(o.LastUpdated) { +// HasMinimumBillableBytes returns a boolean if a field has been set. +func (o *SatellitePlan) HasMinimumBillableBytes() bool { + if o != nil && !IsNil(o.MinimumBillableBytes) { return true } return false } -// SetLastUpdated gets a reference to the given int64 and assigns it to the LastUpdated field. -func (o *SatellitePlan) SetLastUpdated(v int64) { - o.LastUpdated = &v +// SetMinimumBillableBytes gets a reference to the given int64 and assigns it to the MinimumBillableBytes field. +func (o *SatellitePlan) SetMinimumBillableBytes(v int64) { + o.MinimumBillableBytes = &v } // GetNtnProvider returns the NtnProvider field value @@ -191,6 +193,38 @@ func (o *SatellitePlan) SetPsid(v string) { o.Psid = v } +// GetSatelliteDataUsage returns the SatelliteDataUsage field value if set, zero value otherwise. +func (o *SatellitePlan) GetSatelliteDataUsage() SatelliteDataUsage { + if o == nil || IsNil(o.SatelliteDataUsage) { + var ret SatelliteDataUsage + return ret + } + return *o.SatelliteDataUsage +} + +// GetSatelliteDataUsageOk returns a tuple with the SatelliteDataUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SatellitePlan) GetSatelliteDataUsageOk() (*SatelliteDataUsage, bool) { + if o == nil || IsNil(o.SatelliteDataUsage) { + return nil, false + } + return o.SatelliteDataUsage, true +} + +// HasSatelliteDataUsage returns a boolean if a field has been set. +func (o *SatellitePlan) HasSatelliteDataUsage() bool { + if o != nil && !IsNil(o.SatelliteDataUsage) { + return true + } + + return false +} + +// SetSatelliteDataUsage gets a reference to the given SatelliteDataUsage and assigns it to the SatelliteDataUsage field. +func (o *SatellitePlan) SetSatelliteDataUsage(v SatelliteDataUsage) { + o.SatelliteDataUsage = &v +} + func (o SatellitePlan) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -202,14 +236,22 @@ func (o SatellitePlan) MarshalJSON() ([]byte, error) { func (o SatellitePlan) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["activated"] = o.Activated - if !IsNil(o.BillableBytes) { - toSerialize["billable_bytes"] = o.BillableBytes + if !IsNil(o.LastSessionAt) { + toSerialize["last_session_at"] = o.LastSessionAt } - if !IsNil(o.LastUpdated) { - toSerialize["last_updated"] = o.LastUpdated + if !IsNil(o.MinimumBillableBytes) { + toSerialize["minimum_billable_bytes"] = o.MinimumBillableBytes } toSerialize["ntn_provider"] = o.NtnProvider toSerialize["psid"] = o.Psid + if !IsNil(o.SatelliteDataUsage) { + toSerialize["satellite_data_usage"] = o.SatelliteDataUsage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -239,9 +281,7 @@ func (o *SatellitePlan) UnmarshalJSON(data []byte) (err error) { varSatellitePlan := _SatellitePlan{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varSatellitePlan) + err = json.Unmarshal(data, &varSatellitePlan) if err != nil { return err @@ -249,6 +289,18 @@ func (o *SatellitePlan) UnmarshalJSON(data []byte) (err error) { *o = SatellitePlan(varSatellitePlan) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "activated") + delete(additionalProperties, "last_session_at") + delete(additionalProperties, "minimum_billable_bytes") + delete(additionalProperties, "ntn_provider") + delete(additionalProperties, "psid") + delete(additionalProperties, "satellite_data_usage") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_schema_property.go b/model_schema_property.go index ef47f2d..bc9ce6b 100644 --- a/model_schema_property.go +++ b/model_schema_property.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -28,9 +27,10 @@ type SchemaProperty struct { // Name of the field (optional for array/object children) Name *string `json:"name,omitempty"` // Used if type is object - Properties []SchemaProperty `json:"properties,omitempty"` - Type string `json:"type"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` + Properties []SchemaProperty `json:"properties,omitempty"` + Type string `json:"type"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} } type _SchemaProperty SchemaProperty @@ -228,6 +228,11 @@ func (o SchemaProperty) ToMap() (map[string]interface{}, error) { if !IsNil(o.UpdatedAt) { toSerialize["updated_at"] = o.UpdatedAt } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -255,9 +260,7 @@ func (o *SchemaProperty) UnmarshalJSON(data []byte) (err error) { varSchemaProperty := _SchemaProperty{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varSchemaProperty) + err = json.Unmarshal(data, &varSchemaProperty) if err != nil { return err @@ -265,6 +268,17 @@ func (o *SchemaProperty) UnmarshalJSON(data []byte) (err error) { *o = SchemaProperty(varSchemaProperty) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "items") + delete(additionalProperties, "name") + delete(additionalProperties, "properties") + delete(additionalProperties, "type") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_signal_device_200_response.go b/model_signal_device_200_response.go index 1446b97..f423e04 100644 --- a/model_signal_device_200_response.go +++ b/model_signal_device_200_response.go @@ -21,9 +21,12 @@ var _ MappedNullable = &SignalDevice200Response{} // SignalDevice200Response struct for SignalDevice200Response type SignalDevice200Response struct { // true if the Notecard is connected to Notehub. - Connected *bool `json:"connected,omitempty"` + Connected *bool `json:"connected,omitempty"` + AdditionalProperties map[string]interface{} } +type _SignalDevice200Response SignalDevice200Response + // NewSignalDevice200Response instantiates a new SignalDevice200Response object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -86,9 +89,35 @@ func (o SignalDevice200Response) ToMap() (map[string]interface{}, error) { if !IsNil(o.Connected) { toSerialize["connected"] = o.Connected } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *SignalDevice200Response) UnmarshalJSON(data []byte) (err error) { + varSignalDevice200Response := _SignalDevice200Response{} + + err = json.Unmarshal(data, &varSignalDevice200Response) + + if err != nil { + return err + } + + *o = SignalDevice200Response(varSignalDevice200Response) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connected") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSignalDevice200Response struct { value *SignalDevice200Response isSet bool diff --git a/model_sim_usage.go b/model_sim_usage.go index 9b570fb..6f3255c 100644 --- a/model_sim_usage.go +++ b/model_sim_usage.go @@ -29,9 +29,12 @@ type SimUsage struct { // Limit in bytes of the SIMs current data plan Limit *int64 `json:"limit,omitempty"` // Bytes used on the SIMs current data plan - Used *int64 `json:"used,omitempty"` + Used *int64 `json:"used,omitempty"` + AdditionalProperties map[string]interface{} } +type _SimUsage SimUsage + // NewSimUsage instantiates a new SimUsage object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -234,9 +237,39 @@ func (o SimUsage) ToMap() (map[string]interface{}, error) { if !IsNil(o.Used) { toSerialize["used"] = o.Used } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *SimUsage) UnmarshalJSON(data []byte) (err error) { + varSimUsage := _SimUsage{} + + err = json.Unmarshal(data, &varSimUsage) + + if err != nil { + return err + } + + *o = SimUsage(varSimUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "iccid") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "lifetime_used") + delete(additionalProperties, "limit") + delete(additionalProperties, "used") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSimUsage struct { value *SimUsage isSet bool diff --git a/model_slack_bearer_notification.go b/model_slack_bearer_notification.go index 041fc79..781d96a 100644 --- a/model_slack_bearer_notification.go +++ b/model_slack_bearer_notification.go @@ -27,9 +27,12 @@ type SlackBearerNotification struct { // The text of the message, or the blocks definition Text *string `json:"text,omitempty"` // The bearer token for the Slack app. - Token *string `json:"token,omitempty"` + Token *string `json:"token,omitempty"` + AdditionalProperties map[string]interface{} } +type _SlackBearerNotification SlackBearerNotification + // NewSlackBearerNotification instantiates a new SlackBearerNotification object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -197,9 +200,38 @@ func (o SlackBearerNotification) ToMap() (map[string]interface{}, error) { if !IsNil(o.Token) { toSerialize["token"] = o.Token } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *SlackBearerNotification) UnmarshalJSON(data []byte) (err error) { + varSlackBearerNotification := _SlackBearerNotification{} + + err = json.Unmarshal(data, &varSlackBearerNotification) + + if err != nil { + return err + } + + *o = SlackBearerNotification(varSlackBearerNotification) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "channel") + delete(additionalProperties, "message_type") + delete(additionalProperties, "text") + delete(additionalProperties, "token") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSlackBearerNotification struct { value *SlackBearerNotification isSet bool diff --git a/model_slack_web_hook_notification.go b/model_slack_web_hook_notification.go index fcb862f..f4deb67 100644 --- a/model_slack_web_hook_notification.go +++ b/model_slack_web_hook_notification.go @@ -25,9 +25,12 @@ type SlackWebHookNotification struct { // The text of the message, or the blocks definition Text *string `json:"text,omitempty"` // The URL of the Slack webhook. - Url *string `json:"url,omitempty"` + Url *string `json:"url,omitempty"` + AdditionalProperties map[string]interface{} } +type _SlackWebHookNotification SlackWebHookNotification + // NewSlackWebHookNotification instantiates a new SlackWebHookNotification object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o SlackWebHookNotification) ToMap() (map[string]interface{}, error) { if !IsNil(o.Url) { toSerialize["url"] = o.Url } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *SlackWebHookNotification) UnmarshalJSON(data []byte) (err error) { + varSlackWebHookNotification := _SlackWebHookNotification{} + + err = json.Unmarshal(data, &varSlackWebHookNotification) + + if err != nil { + return err + } + + *o = SlackWebHookNotification(varSlackWebHookNotification) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message_type") + delete(additionalProperties, "text") + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableSlackWebHookNotification struct { value *SlackWebHookNotification isSet bool diff --git a/model_tower_location.go b/model_tower_location.go index 650ce52..55ed187 100644 --- a/model_tower_location.go +++ b/model_tower_location.go @@ -47,9 +47,12 @@ type TowerLocation struct { // Timezone ID Z *int32 `json:"z,omitempty"` // Timezone name - Zone *string `json:"zone,omitempty"` + Zone *string `json:"zone,omitempty"` + AdditionalProperties map[string]interface{} } +type _TowerLocation TowerLocation + // NewTowerLocation instantiates a new TowerLocation object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -567,9 +570,48 @@ func (o TowerLocation) ToMap() (map[string]interface{}, error) { if !IsNil(o.Zone) { toSerialize["zone"] = o.Zone } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *TowerLocation) UnmarshalJSON(data []byte) (err error) { + varTowerLocation := _TowerLocation{} + + err = json.Unmarshal(data, &varTowerLocation) + + if err != nil { + return err + } + + *o = TowerLocation(varTowerLocation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "c") + delete(additionalProperties, "cid") + delete(additionalProperties, "l") + delete(additionalProperties, "lac") + delete(additionalProperties, "lat") + delete(additionalProperties, "lon") + delete(additionalProperties, "mcc") + delete(additionalProperties, "mnc") + delete(additionalProperties, "n") + delete(additionalProperties, "source") + delete(additionalProperties, "time") + delete(additionalProperties, "towers") + delete(additionalProperties, "z") + delete(additionalProperties, "zone") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableTowerLocation struct { value *TowerLocation isSet bool diff --git a/model_update_fleet_request.go b/model_update_fleet_request.go index 3a3fab3..7ad3dc7 100644 --- a/model_update_fleet_request.go +++ b/model_update_fleet_request.go @@ -31,9 +31,12 @@ type UpdateFleetRequest struct { SmartRule *string `json:"smart_rule,omitempty"` SmartRuleEnabled *bool `json:"smart_rule_enabled,omitempty"` // A watchdog timer is used to generate an event every N minutes of inactivity. 0 means no watchdog - WatchdogMins *int64 `json:"watchdog_mins,omitempty"` + WatchdogMins *int64 `json:"watchdog_mins,omitempty"` + AdditionalProperties map[string]interface{} } +type _UpdateFleetRequest UpdateFleetRequest + // NewUpdateFleetRequest instantiates a new UpdateFleetRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -317,9 +320,41 @@ func (o UpdateFleetRequest) ToMap() (map[string]interface{}, error) { if !IsNil(o.WatchdogMins) { toSerialize["watchdog_mins"] = o.WatchdogMins } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *UpdateFleetRequest) UnmarshalJSON(data []byte) (err error) { + varUpdateFleetRequest := _UpdateFleetRequest{} + + err = json.Unmarshal(data, &varUpdateFleetRequest) + + if err != nil { + return err + } + + *o = UpdateFleetRequest(varUpdateFleetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "addDevices") + delete(additionalProperties, "connectivity_assurance") + delete(additionalProperties, "label") + delete(additionalProperties, "removeDevices") + delete(additionalProperties, "smart_rule") + delete(additionalProperties, "smart_rule_enabled") + delete(additionalProperties, "watchdog_mins") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableUpdateFleetRequest struct { value *UpdateFleetRequest isSet bool diff --git a/model_upload_metadata.go b/model_upload_metadata.go index 97e7823..dd6ad48 100644 --- a/model_upload_metadata.go +++ b/model_upload_metadata.go @@ -34,9 +34,12 @@ type UploadMetadata struct { Tags *string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` // User-specified version string provided at time of upload - Version *string `json:"version,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} } +type _UploadMetadata UploadMetadata + // NewUploadMetadata instantiates a new UploadMetadata object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -565,9 +568,48 @@ func (o UploadMetadata) ToMap() (map[string]interface{}, error) { if !IsNil(o.Version) { toSerialize["version"] = o.Version } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *UploadMetadata) UnmarshalJSON(data []byte) (err error) { + varUploadMetadata := _UploadMetadata{} + + err = json.Unmarshal(data, &varUploadMetadata) + + if err != nil { + return err + } + + *o = UploadMetadata(varUploadMetadata) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "contains") + delete(additionalProperties, "crc32") + delete(additionalProperties, "created") + delete(additionalProperties, "firmware") + delete(additionalProperties, "found") + delete(additionalProperties, "length") + delete(additionalProperties, "md5") + delete(additionalProperties, "modified") + delete(additionalProperties, "name") + delete(additionalProperties, "notes") + delete(additionalProperties, "source") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableUploadMetadata struct { value *UploadMetadata isSet bool diff --git a/model_usage_data.go b/model_usage_data.go index 33e641e..592aeb3 100644 --- a/model_usage_data.go +++ b/model_usage_data.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -23,10 +22,21 @@ var _ MappedNullable = &UsageData{} // UsageData struct for UsageData type UsageData struct { - BytesReceived *int64 `json:"bytes_received,omitempty"` - BytesSent *int64 `json:"bytes_sent,omitempty"` - Period time.Time `json:"period"` - TotalBytes int64 `json:"total_bytes"` + // Total billable bytes (only for packet-based protocols) + BillableBytesTotal *int64 `json:"billable_bytes_total,omitempty"` + DownlinkBytes *int64 `json:"downlink_bytes,omitempty"` + // Billable downlink bytes (only for packet-based protocols) + DownlinkBytesBillable *int64 `json:"downlink_bytes_billable,omitempty"` + // Downlink packets (only for packet-based protocols) + DownlinkPackets *int64 `json:"downlink_packets,omitempty"` + Period time.Time `json:"period"` + TotalBytes int64 `json:"total_bytes"` + UplinkBytes *int64 `json:"uplink_bytes,omitempty"` + // Billable uplink bytes (only for packet-based protocols) + UplinkBytesBillable *int64 `json:"uplink_bytes_billable,omitempty"` + // Uplink packets (only for packet-based protocols) + UplinkPackets *int64 `json:"uplink_packets,omitempty"` + AdditionalProperties map[string]interface{} } type _UsageData UsageData @@ -50,68 +60,132 @@ func NewUsageDataWithDefaults() *UsageData { return &this } -// GetBytesReceived returns the BytesReceived field value if set, zero value otherwise. -func (o *UsageData) GetBytesReceived() int64 { - if o == nil || IsNil(o.BytesReceived) { +// GetBillableBytesTotal returns the BillableBytesTotal field value if set, zero value otherwise. +func (o *UsageData) GetBillableBytesTotal() int64 { + if o == nil || IsNil(o.BillableBytesTotal) { var ret int64 return ret } - return *o.BytesReceived + return *o.BillableBytesTotal } -// GetBytesReceivedOk returns a tuple with the BytesReceived field value if set, nil otherwise +// GetBillableBytesTotalOk returns a tuple with the BillableBytesTotal field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UsageData) GetBytesReceivedOk() (*int64, bool) { - if o == nil || IsNil(o.BytesReceived) { +func (o *UsageData) GetBillableBytesTotalOk() (*int64, bool) { + if o == nil || IsNil(o.BillableBytesTotal) { return nil, false } - return o.BytesReceived, true + return o.BillableBytesTotal, true } -// HasBytesReceived returns a boolean if a field has been set. -func (o *UsageData) HasBytesReceived() bool { - if o != nil && !IsNil(o.BytesReceived) { +// HasBillableBytesTotal returns a boolean if a field has been set. +func (o *UsageData) HasBillableBytesTotal() bool { + if o != nil && !IsNil(o.BillableBytesTotal) { return true } return false } -// SetBytesReceived gets a reference to the given int64 and assigns it to the BytesReceived field. -func (o *UsageData) SetBytesReceived(v int64) { - o.BytesReceived = &v +// SetBillableBytesTotal gets a reference to the given int64 and assigns it to the BillableBytesTotal field. +func (o *UsageData) SetBillableBytesTotal(v int64) { + o.BillableBytesTotal = &v } -// GetBytesSent returns the BytesSent field value if set, zero value otherwise. -func (o *UsageData) GetBytesSent() int64 { - if o == nil || IsNil(o.BytesSent) { +// GetDownlinkBytes returns the DownlinkBytes field value if set, zero value otherwise. +func (o *UsageData) GetDownlinkBytes() int64 { + if o == nil || IsNil(o.DownlinkBytes) { var ret int64 return ret } - return *o.BytesSent + return *o.DownlinkBytes } -// GetBytesSentOk returns a tuple with the BytesSent field value if set, nil otherwise +// GetDownlinkBytesOk returns a tuple with the DownlinkBytes field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UsageData) GetBytesSentOk() (*int64, bool) { - if o == nil || IsNil(o.BytesSent) { +func (o *UsageData) GetDownlinkBytesOk() (*int64, bool) { + if o == nil || IsNil(o.DownlinkBytes) { return nil, false } - return o.BytesSent, true + return o.DownlinkBytes, true } -// HasBytesSent returns a boolean if a field has been set. -func (o *UsageData) HasBytesSent() bool { - if o != nil && !IsNil(o.BytesSent) { +// HasDownlinkBytes returns a boolean if a field has been set. +func (o *UsageData) HasDownlinkBytes() bool { + if o != nil && !IsNil(o.DownlinkBytes) { return true } return false } -// SetBytesSent gets a reference to the given int64 and assigns it to the BytesSent field. -func (o *UsageData) SetBytesSent(v int64) { - o.BytesSent = &v +// SetDownlinkBytes gets a reference to the given int64 and assigns it to the DownlinkBytes field. +func (o *UsageData) SetDownlinkBytes(v int64) { + o.DownlinkBytes = &v +} + +// GetDownlinkBytesBillable returns the DownlinkBytesBillable field value if set, zero value otherwise. +func (o *UsageData) GetDownlinkBytesBillable() int64 { + if o == nil || IsNil(o.DownlinkBytesBillable) { + var ret int64 + return ret + } + return *o.DownlinkBytesBillable +} + +// GetDownlinkBytesBillableOk returns a tuple with the DownlinkBytesBillable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageData) GetDownlinkBytesBillableOk() (*int64, bool) { + if o == nil || IsNil(o.DownlinkBytesBillable) { + return nil, false + } + return o.DownlinkBytesBillable, true +} + +// HasDownlinkBytesBillable returns a boolean if a field has been set. +func (o *UsageData) HasDownlinkBytesBillable() bool { + if o != nil && !IsNil(o.DownlinkBytesBillable) { + return true + } + + return false +} + +// SetDownlinkBytesBillable gets a reference to the given int64 and assigns it to the DownlinkBytesBillable field. +func (o *UsageData) SetDownlinkBytesBillable(v int64) { + o.DownlinkBytesBillable = &v +} + +// GetDownlinkPackets returns the DownlinkPackets field value if set, zero value otherwise. +func (o *UsageData) GetDownlinkPackets() int64 { + if o == nil || IsNil(o.DownlinkPackets) { + var ret int64 + return ret + } + return *o.DownlinkPackets +} + +// GetDownlinkPacketsOk returns a tuple with the DownlinkPackets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageData) GetDownlinkPacketsOk() (*int64, bool) { + if o == nil || IsNil(o.DownlinkPackets) { + return nil, false + } + return o.DownlinkPackets, true +} + +// HasDownlinkPackets returns a boolean if a field has been set. +func (o *UsageData) HasDownlinkPackets() bool { + if o != nil && !IsNil(o.DownlinkPackets) { + return true + } + + return false +} + +// SetDownlinkPackets gets a reference to the given int64 and assigns it to the DownlinkPackets field. +func (o *UsageData) SetDownlinkPackets(v int64) { + o.DownlinkPackets = &v } // GetPeriod returns the Period field value @@ -162,6 +236,102 @@ func (o *UsageData) SetTotalBytes(v int64) { o.TotalBytes = v } +// GetUplinkBytes returns the UplinkBytes field value if set, zero value otherwise. +func (o *UsageData) GetUplinkBytes() int64 { + if o == nil || IsNil(o.UplinkBytes) { + var ret int64 + return ret + } + return *o.UplinkBytes +} + +// GetUplinkBytesOk returns a tuple with the UplinkBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageData) GetUplinkBytesOk() (*int64, bool) { + if o == nil || IsNil(o.UplinkBytes) { + return nil, false + } + return o.UplinkBytes, true +} + +// HasUplinkBytes returns a boolean if a field has been set. +func (o *UsageData) HasUplinkBytes() bool { + if o != nil && !IsNil(o.UplinkBytes) { + return true + } + + return false +} + +// SetUplinkBytes gets a reference to the given int64 and assigns it to the UplinkBytes field. +func (o *UsageData) SetUplinkBytes(v int64) { + o.UplinkBytes = &v +} + +// GetUplinkBytesBillable returns the UplinkBytesBillable field value if set, zero value otherwise. +func (o *UsageData) GetUplinkBytesBillable() int64 { + if o == nil || IsNil(o.UplinkBytesBillable) { + var ret int64 + return ret + } + return *o.UplinkBytesBillable +} + +// GetUplinkBytesBillableOk returns a tuple with the UplinkBytesBillable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageData) GetUplinkBytesBillableOk() (*int64, bool) { + if o == nil || IsNil(o.UplinkBytesBillable) { + return nil, false + } + return o.UplinkBytesBillable, true +} + +// HasUplinkBytesBillable returns a boolean if a field has been set. +func (o *UsageData) HasUplinkBytesBillable() bool { + if o != nil && !IsNil(o.UplinkBytesBillable) { + return true + } + + return false +} + +// SetUplinkBytesBillable gets a reference to the given int64 and assigns it to the UplinkBytesBillable field. +func (o *UsageData) SetUplinkBytesBillable(v int64) { + o.UplinkBytesBillable = &v +} + +// GetUplinkPackets returns the UplinkPackets field value if set, zero value otherwise. +func (o *UsageData) GetUplinkPackets() int64 { + if o == nil || IsNil(o.UplinkPackets) { + var ret int64 + return ret + } + return *o.UplinkPackets +} + +// GetUplinkPacketsOk returns a tuple with the UplinkPackets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageData) GetUplinkPacketsOk() (*int64, bool) { + if o == nil || IsNil(o.UplinkPackets) { + return nil, false + } + return o.UplinkPackets, true +} + +// HasUplinkPackets returns a boolean if a field has been set. +func (o *UsageData) HasUplinkPackets() bool { + if o != nil && !IsNil(o.UplinkPackets) { + return true + } + + return false +} + +// SetUplinkPackets gets a reference to the given int64 and assigns it to the UplinkPackets field. +func (o *UsageData) SetUplinkPackets(v int64) { + o.UplinkPackets = &v +} + func (o UsageData) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -172,14 +342,34 @@ func (o UsageData) MarshalJSON() ([]byte, error) { func (o UsageData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.BytesReceived) { - toSerialize["bytes_received"] = o.BytesReceived + if !IsNil(o.BillableBytesTotal) { + toSerialize["billable_bytes_total"] = o.BillableBytesTotal + } + if !IsNil(o.DownlinkBytes) { + toSerialize["downlink_bytes"] = o.DownlinkBytes } - if !IsNil(o.BytesSent) { - toSerialize["bytes_sent"] = o.BytesSent + if !IsNil(o.DownlinkBytesBillable) { + toSerialize["downlink_bytes_billable"] = o.DownlinkBytesBillable + } + if !IsNil(o.DownlinkPackets) { + toSerialize["downlink_packets"] = o.DownlinkPackets } toSerialize["period"] = o.Period toSerialize["total_bytes"] = o.TotalBytes + if !IsNil(o.UplinkBytes) { + toSerialize["uplink_bytes"] = o.UplinkBytes + } + if !IsNil(o.UplinkBytesBillable) { + toSerialize["uplink_bytes_billable"] = o.UplinkBytesBillable + } + if !IsNil(o.UplinkPackets) { + toSerialize["uplink_packets"] = o.UplinkPackets + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -208,9 +398,7 @@ func (o *UsageData) UnmarshalJSON(data []byte) (err error) { varUsageData := _UsageData{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageData) + err = json.Unmarshal(data, &varUsageData) if err != nil { return err @@ -218,6 +406,21 @@ func (o *UsageData) UnmarshalJSON(data []byte) (err error) { *o = UsageData(varUsageData) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "billable_bytes_total") + delete(additionalProperties, "downlink_bytes") + delete(additionalProperties, "downlink_bytes_billable") + delete(additionalProperties, "downlink_packets") + delete(additionalProperties, "period") + delete(additionalProperties, "total_bytes") + delete(additionalProperties, "uplink_bytes") + delete(additionalProperties, "uplink_bytes_billable") + delete(additionalProperties, "uplink_packets") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_usage_events_data.go b/model_usage_events_data.go index 86b4873..2cf8fc0 100644 --- a/model_usage_events_data.go +++ b/model_usage_events_data.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -23,19 +22,24 @@ var _ MappedNullable = &UsageEventsData{} // UsageEventsData struct for UsageEventsData type UsageEventsData struct { - Device *string `json:"device,omitempty"` - Fleet *string `json:"fleet,omitempty"` + // Events that are billable, this include all events except platform events + BillableEvents *int64 `json:"billable_events,omitempty"` + Device *string `json:"device,omitempty"` + Fleet *string `json:"fleet,omitempty"` // Count of events per notefile. Only present when includeNotefiles=true is specified. Notefiles *map[string]int64 `json:"notefiles,omitempty"` Period time.Time `json:"period"` // Total platform events. Platform events are _log, _session, _health, and _geolocate events some of which are send from the device, some generated by notehub. These events are not billed. PlatformEvents int64 `json:"platform_events"` + // The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future. + TotalDaysInPeriod *int32 `json:"total_days_in_period,omitempty"` // Total devices represented in this count TotalDevices int64 `json:"total_devices"` // Total events the device sent to notehub, including associated notehub generated events TotalEvents int64 `json:"total_events"` // Watchdog events are events generated by notehub when a watchdog timer is configured for a device to indicate is has not been online for a period of time. These events are billed but should not be used to indicate a device is active, or connected, at this time. - WatchdogEvents int64 `json:"watchdog_events"` + WatchdogEvents int64 `json:"watchdog_events"` + AdditionalProperties map[string]interface{} } type _UsageEventsData UsageEventsData @@ -62,6 +66,38 @@ func NewUsageEventsDataWithDefaults() *UsageEventsData { return &this } +// GetBillableEvents returns the BillableEvents field value if set, zero value otherwise. +func (o *UsageEventsData) GetBillableEvents() int64 { + if o == nil || IsNil(o.BillableEvents) { + var ret int64 + return ret + } + return *o.BillableEvents +} + +// GetBillableEventsOk returns a tuple with the BillableEvents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageEventsData) GetBillableEventsOk() (*int64, bool) { + if o == nil || IsNil(o.BillableEvents) { + return nil, false + } + return o.BillableEvents, true +} + +// HasBillableEvents returns a boolean if a field has been set. +func (o *UsageEventsData) HasBillableEvents() bool { + if o != nil && !IsNil(o.BillableEvents) { + return true + } + + return false +} + +// SetBillableEvents gets a reference to the given int64 and assigns it to the BillableEvents field. +func (o *UsageEventsData) SetBillableEvents(v int64) { + o.BillableEvents = &v +} + // GetDevice returns the Device field value if set, zero value otherwise. func (o *UsageEventsData) GetDevice() string { if o == nil || IsNil(o.Device) { @@ -206,6 +242,38 @@ func (o *UsageEventsData) SetPlatformEvents(v int64) { o.PlatformEvents = v } +// GetTotalDaysInPeriod returns the TotalDaysInPeriod field value if set, zero value otherwise. +func (o *UsageEventsData) GetTotalDaysInPeriod() int32 { + if o == nil || IsNil(o.TotalDaysInPeriod) { + var ret int32 + return ret + } + return *o.TotalDaysInPeriod +} + +// GetTotalDaysInPeriodOk returns a tuple with the TotalDaysInPeriod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageEventsData) GetTotalDaysInPeriodOk() (*int32, bool) { + if o == nil || IsNil(o.TotalDaysInPeriod) { + return nil, false + } + return o.TotalDaysInPeriod, true +} + +// HasTotalDaysInPeriod returns a boolean if a field has been set. +func (o *UsageEventsData) HasTotalDaysInPeriod() bool { + if o != nil && !IsNil(o.TotalDaysInPeriod) { + return true + } + + return false +} + +// SetTotalDaysInPeriod gets a reference to the given int32 and assigns it to the TotalDaysInPeriod field. +func (o *UsageEventsData) SetTotalDaysInPeriod(v int32) { + o.TotalDaysInPeriod = &v +} + // GetTotalDevices returns the TotalDevices field value func (o *UsageEventsData) GetTotalDevices() int64 { if o == nil { @@ -288,6 +356,9 @@ func (o UsageEventsData) MarshalJSON() ([]byte, error) { func (o UsageEventsData) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.BillableEvents) { + toSerialize["billable_events"] = o.BillableEvents + } if !IsNil(o.Device) { toSerialize["device"] = o.Device } @@ -299,9 +370,17 @@ func (o UsageEventsData) ToMap() (map[string]interface{}, error) { } toSerialize["period"] = o.Period toSerialize["platform_events"] = o.PlatformEvents + if !IsNil(o.TotalDaysInPeriod) { + toSerialize["total_days_in_period"] = o.TotalDaysInPeriod + } toSerialize["total_devices"] = o.TotalDevices toSerialize["total_events"] = o.TotalEvents toSerialize["watchdog_events"] = o.WatchdogEvents + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -333,9 +412,7 @@ func (o *UsageEventsData) UnmarshalJSON(data []byte) (err error) { varUsageEventsData := _UsageEventsData{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageEventsData) + err = json.Unmarshal(data, &varUsageEventsData) if err != nil { return err @@ -343,6 +420,22 @@ func (o *UsageEventsData) UnmarshalJSON(data []byte) (err error) { *o = UsageEventsData(varUsageEventsData) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "billable_events") + delete(additionalProperties, "device") + delete(additionalProperties, "fleet") + delete(additionalProperties, "notefiles") + delete(additionalProperties, "period") + delete(additionalProperties, "platform_events") + delete(additionalProperties, "total_days_in_period") + delete(additionalProperties, "total_devices") + delete(additionalProperties, "total_events") + delete(additionalProperties, "watchdog_events") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_usage_events_response.go b/model_usage_events_response.go index b647ef7..a7143fd 100644 --- a/model_usage_events_response.go +++ b/model_usage_events_response.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" ) @@ -23,6 +22,9 @@ var _ MappedNullable = &UsageEventsResponse{} // UsageEventsResponse struct for UsageEventsResponse type UsageEventsResponse struct { Data []UsageEventsData `json:"data"` + // If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure + Truncated *bool `json:"truncated,omitempty"` + AdditionalProperties map[string]interface{} } type _UsageEventsResponse UsageEventsResponse @@ -69,6 +71,38 @@ func (o *UsageEventsResponse) SetData(v []UsageEventsData) { o.Data = v } +// GetTruncated returns the Truncated field value if set, zero value otherwise. +func (o *UsageEventsResponse) GetTruncated() bool { + if o == nil || IsNil(o.Truncated) { + var ret bool + return ret + } + return *o.Truncated +} + +// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageEventsResponse) GetTruncatedOk() (*bool, bool) { + if o == nil || IsNil(o.Truncated) { + return nil, false + } + return o.Truncated, true +} + +// HasTruncated returns a boolean if a field has been set. +func (o *UsageEventsResponse) HasTruncated() bool { + if o != nil && !IsNil(o.Truncated) { + return true + } + + return false +} + +// SetTruncated gets a reference to the given bool and assigns it to the Truncated field. +func (o *UsageEventsResponse) SetTruncated(v bool) { + o.Truncated = &v +} + func (o UsageEventsResponse) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -80,6 +114,14 @@ func (o UsageEventsResponse) MarshalJSON() ([]byte, error) { func (o UsageEventsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["data"] = o.Data + if !IsNil(o.Truncated) { + toSerialize["truncated"] = o.Truncated + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -107,9 +149,7 @@ func (o *UsageEventsResponse) UnmarshalJSON(data []byte) (err error) { varUsageEventsResponse := _UsageEventsResponse{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageEventsResponse) + err = json.Unmarshal(data, &varUsageEventsResponse) if err != nil { return err @@ -117,6 +157,14 @@ func (o *UsageEventsResponse) UnmarshalJSON(data []byte) (err error) { *o = UsageEventsResponse(varUsageEventsResponse) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "truncated") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_usage_route_logs_data.go b/model_usage_route_logs_data.go index 5b4e8c2..477808f 100644 --- a/model_usage_route_logs_data.go +++ b/model_usage_route_logs_data.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -26,9 +25,10 @@ type UsageRouteLogsData struct { FailedRoutes int64 `json:"failed_routes"` Period time.Time `json:"period"` // The route UID (only present when aggregate is 'route') - Route *string `json:"route,omitempty"` - SuccessfulRoutes int64 `json:"successful_routes"` - TotalRoutes int64 `json:"total_routes"` + Route *string `json:"route,omitempty"` + SuccessfulRoutes int64 `json:"successful_routes"` + TotalRoutes int64 `json:"total_routes"` + AdditionalProperties map[string]interface{} } type _UsageRouteLogsData UsageRouteLogsData @@ -199,6 +199,11 @@ func (o UsageRouteLogsData) ToMap() (map[string]interface{}, error) { } toSerialize["successful_routes"] = o.SuccessfulRoutes toSerialize["total_routes"] = o.TotalRoutes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -229,9 +234,7 @@ func (o *UsageRouteLogsData) UnmarshalJSON(data []byte) (err error) { varUsageRouteLogsData := _UsageRouteLogsData{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageRouteLogsData) + err = json.Unmarshal(data, &varUsageRouteLogsData) if err != nil { return err @@ -239,6 +242,17 @@ func (o *UsageRouteLogsData) UnmarshalJSON(data []byte) (err error) { *o = UsageRouteLogsData(varUsageRouteLogsData) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "failed_routes") + delete(additionalProperties, "period") + delete(additionalProperties, "route") + delete(additionalProperties, "successful_routes") + delete(additionalProperties, "total_routes") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_usage_sessions_data.go b/model_usage_sessions_data.go index c26dadc..34926f1 100644 --- a/model_usage_sessions_data.go +++ b/model_usage_sessions_data.go @@ -12,7 +12,6 @@ Contact: engineering@blues.io package notehub import ( - "bytes" "encoding/json" "fmt" "time" @@ -23,12 +22,15 @@ var _ MappedNullable = &UsageSessionsData{} // UsageSessionsData struct for UsageSessionsData type UsageSessionsData struct { - Device *string `json:"device,omitempty"` - Fleet *string `json:"fleet,omitempty"` - Period time.Time `json:"period"` - Sessions int64 `json:"sessions"` - TotalBytes int64 `json:"total_bytes"` - TotalDevices int64 `json:"total_devices"` + Device *string `json:"device,omitempty"` + // Number of first sync sessions in this period + FirstSyncSessions int64 `json:"first_sync_sessions"` + Fleet *string `json:"fleet,omitempty"` + Period time.Time `json:"period"` + Sessions int64 `json:"sessions"` + TotalBytes int64 `json:"total_bytes"` + TotalDevices int64 `json:"total_devices"` + AdditionalProperties map[string]interface{} } type _UsageSessionsData UsageSessionsData @@ -37,8 +39,9 @@ type _UsageSessionsData UsageSessionsData // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewUsageSessionsData(period time.Time, sessions int64, totalBytes int64, totalDevices int64) *UsageSessionsData { +func NewUsageSessionsData(firstSyncSessions int64, period time.Time, sessions int64, totalBytes int64, totalDevices int64) *UsageSessionsData { this := UsageSessionsData{} + this.FirstSyncSessions = firstSyncSessions this.Period = period this.Sessions = sessions this.TotalBytes = totalBytes @@ -86,6 +89,30 @@ func (o *UsageSessionsData) SetDevice(v string) { o.Device = &v } +// GetFirstSyncSessions returns the FirstSyncSessions field value +func (o *UsageSessionsData) GetFirstSyncSessions() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.FirstSyncSessions +} + +// GetFirstSyncSessionsOk returns a tuple with the FirstSyncSessions field value +// and a boolean to check if the value has been set. +func (o *UsageSessionsData) GetFirstSyncSessionsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.FirstSyncSessions, true +} + +// SetFirstSyncSessions sets field value +func (o *UsageSessionsData) SetFirstSyncSessions(v int64) { + o.FirstSyncSessions = v +} + // GetFleet returns the Fleet field value if set, zero value otherwise. func (o *UsageSessionsData) GetFleet() string { if o == nil || IsNil(o.Fleet) { @@ -227,6 +254,7 @@ func (o UsageSessionsData) ToMap() (map[string]interface{}, error) { if !IsNil(o.Device) { toSerialize["device"] = o.Device } + toSerialize["first_sync_sessions"] = o.FirstSyncSessions if !IsNil(o.Fleet) { toSerialize["fleet"] = o.Fleet } @@ -234,6 +262,11 @@ func (o UsageSessionsData) ToMap() (map[string]interface{}, error) { toSerialize["sessions"] = o.Sessions toSerialize["total_bytes"] = o.TotalBytes toSerialize["total_devices"] = o.TotalDevices + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } @@ -242,6 +275,7 @@ func (o *UsageSessionsData) UnmarshalJSON(data []byte) (err error) { // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ + "first_sync_sessions", "period", "sessions", "total_bytes", @@ -264,9 +298,7 @@ func (o *UsageSessionsData) UnmarshalJSON(data []byte) (err error) { varUsageSessionsData := _UsageSessionsData{} - decoder := json.NewDecoder(bytes.NewReader(data)) - decoder.DisallowUnknownFields() - err = decoder.Decode(&varUsageSessionsData) + err = json.Unmarshal(data, &varUsageSessionsData) if err != nil { return err @@ -274,6 +306,19 @@ func (o *UsageSessionsData) UnmarshalJSON(data []byte) (err error) { *o = UsageSessionsData(varUsageSessionsData) + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "first_sync_sessions") + delete(additionalProperties, "fleet") + delete(additionalProperties, "period") + delete(additionalProperties, "sessions") + delete(additionalProperties, "total_bytes") + delete(additionalProperties, "total_devices") + o.AdditionalProperties = additionalProperties + } + return err } diff --git a/model_user_dfu_state_machine.go b/model_user_dfu_state_machine.go index d6017f2..d428de9 100644 --- a/model_user_dfu_state_machine.go +++ b/model_user_dfu_state_machine.go @@ -21,12 +21,15 @@ var _ MappedNullable = &UserDfuStateMachine{} // UserDfuStateMachine struct for UserDfuStateMachine type UserDfuStateMachine struct { - Created NullableTime `json:"created,omitempty"` - FromVersion *string `json:"from_version,omitempty"` - Metadata *UploadMetadata `json:"metadata,omitempty"` - Status *UserDfuStateMachineStatus `json:"status,omitempty"` + Created NullableTime `json:"created,omitempty"` + FromVersion *string `json:"from_version,omitempty"` + Metadata *UploadMetadata `json:"metadata,omitempty"` + Status *UserDfuStateMachineStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _UserDfuStateMachine UserDfuStateMachine + // NewUserDfuStateMachine instantiates a new UserDfuStateMachine object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -205,9 +208,38 @@ func (o UserDfuStateMachine) ToMap() (map[string]interface{}, error) { if !IsNil(o.Status) { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *UserDfuStateMachine) UnmarshalJSON(data []byte) (err error) { + varUserDfuStateMachine := _UserDfuStateMachine{} + + err = json.Unmarshal(data, &varUserDfuStateMachine) + + if err != nil { + return err + } + + *o = UserDfuStateMachine(varUserDfuStateMachine) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "created") + delete(additionalProperties, "from_version") + delete(additionalProperties, "metadata") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableUserDfuStateMachine struct { value *UserDfuStateMachine isSet bool diff --git a/model_user_dfu_state_machine_status.go b/model_user_dfu_state_machine_status.go index 7b33928..ebb159b 100644 --- a/model_user_dfu_state_machine_status.go +++ b/model_user_dfu_state_machine_status.go @@ -21,12 +21,15 @@ var _ MappedNullable = &UserDfuStateMachineStatus{} // UserDfuStateMachineStatus struct for UserDfuStateMachineStatus type UserDfuStateMachineStatus struct { - Date NullableTime `json:"date,omitempty"` - Phase *string `json:"phase,omitempty"` - PhaseDescription *string `json:"phase_description,omitempty"` - Status *string `json:"status,omitempty"` + Date NullableTime `json:"date,omitempty"` + Phase *string `json:"phase,omitempty"` + PhaseDescription *string `json:"phase_description,omitempty"` + Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } +type _UserDfuStateMachineStatus UserDfuStateMachineStatus + // NewUserDfuStateMachineStatus instantiates a new UserDfuStateMachineStatus object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -205,9 +208,38 @@ func (o UserDfuStateMachineStatus) ToMap() (map[string]interface{}, error) { if !IsNil(o.Status) { toSerialize["status"] = o.Status } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *UserDfuStateMachineStatus) UnmarshalJSON(data []byte) (err error) { + varUserDfuStateMachineStatus := _UserDfuStateMachineStatus{} + + err = json.Unmarshal(data, &varUserDfuStateMachineStatus) + + if err != nil { + return err + } + + *o = UserDfuStateMachineStatus(varUserDfuStateMachineStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "date") + delete(additionalProperties, "phase") + delete(additionalProperties, "phase_description") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableUserDfuStateMachineStatus struct { value *UserDfuStateMachineStatus isSet bool diff --git a/model_user_firmware_info.go b/model_user_firmware_info.go index 0950db7..f6fe15e 100644 --- a/model_user_firmware_info.go +++ b/model_user_firmware_info.go @@ -20,10 +20,13 @@ var _ MappedNullable = &UserFirmwareInfo{} // UserFirmwareInfo struct for UserFirmwareInfo type UserFirmwareInfo struct { - CurrentFirmware *CurrentFirmware `json:"current_firmware,omitempty"` - FirmwareUpdate *UserDfuStateMachine `json:"firmware_update,omitempty"` + CurrentFirmware *CurrentFirmware `json:"current_firmware,omitempty"` + FirmwareUpdate *UserDfuStateMachine `json:"firmware_update,omitempty"` + AdditionalProperties map[string]interface{} } +type _UserFirmwareInfo UserFirmwareInfo + // NewUserFirmwareInfo instantiates a new UserFirmwareInfo object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -121,9 +124,36 @@ func (o UserFirmwareInfo) ToMap() (map[string]interface{}, error) { if !IsNil(o.FirmwareUpdate) { toSerialize["firmware_update"] = o.FirmwareUpdate } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *UserFirmwareInfo) UnmarshalJSON(data []byte) (err error) { + varUserFirmwareInfo := _UserFirmwareInfo{} + + err = json.Unmarshal(data, &varUserFirmwareInfo) + + if err != nil { + return err + } + + *o = UserFirmwareInfo(varUserFirmwareInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current_firmware") + delete(additionalProperties, "firmware_update") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableUserFirmwareInfo struct { value *UserFirmwareInfo isSet bool diff --git a/model_webhook_settings.go b/model_webhook_settings.go index 25c34d4..7bf48c2 100644 --- a/model_webhook_settings.go +++ b/model_webhook_settings.go @@ -25,9 +25,12 @@ type WebhookSettings struct { // Webhook ID Id *string `json:"id,omitempty"` // Transformation to be applied to the event - Transform *string `json:"transform,omitempty"` + Transform *string `json:"transform,omitempty"` + AdditionalProperties map[string]interface{} } +type _WebhookSettings WebhookSettings + // NewWebhookSettings instantiates a new WebhookSettings object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -160,9 +163,37 @@ func (o WebhookSettings) ToMap() (map[string]interface{}, error) { if !IsNil(o.Transform) { toSerialize["transform"] = o.Transform } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return toSerialize, nil } +func (o *WebhookSettings) UnmarshalJSON(data []byte) (err error) { + varWebhookSettings := _WebhookSettings{} + + err = json.Unmarshal(data, &varWebhookSettings) + + if err != nil { + return err + } + + *o = WebhookSettings(varWebhookSettings) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "disabled") + delete(additionalProperties, "id") + delete(additionalProperties, "transform") + o.AdditionalProperties = additionalProperties + } + + return err +} + type NullableWebhookSettings struct { value *WebhookSettings isSet bool diff --git a/openapi.yaml b/openapi.yaml index b9fd0ba..0a55143 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -143,6 +143,90 @@ paths: - personalAccessToken: [] tags: - billing_account + '/v1/billing-accounts/{billingAccountUID}': + get: + operationId: GetBillingAccount + description: Get Billing Account Information + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + name: + type: string + owner: + type: string + plan: + type: object + properties: + current_balance: + type: integer + format: int64 + end_date: + type: string + format: date-time + event_capacity: + type: integer + format: int64 + start_date: + type: string + format: date-time + type: + type: string + enum: + - Enterprise + - Essentials + suspended: + type: boolean + uid: + type: string + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account + '/v1/billing-accounts/{billingAccountUID}/balance-history': + get: + operationId: GetBillingAccountBalanceHistory + description: 'Get Billing Account Balance history, only enterprise supported' + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + properties: + period: + type: string + format: date-time + remaining_event_capacity: + type: integer + format: int64 + required: + - remaining_event_capacity + - period + type: object + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account '/v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin': get: operationId: GetDeviceEnvironmentVariablesByPin @@ -375,6 +459,28 @@ paths: - personalAccessToken: [] tags: - alert + '/v1/projects/{projectOrProductUID}/aws-role-config': + get: + operationId: GetAWSRoleConfig + summary: Get AWS role configuration for role-based authentication + description: | + Returns the AWS Account ID and External ID needed to configure an IAM role + trust policy for role-based authentication on AWS routes. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + '200': + description: AWS role configuration + content: + application/json: + schema: + $ref: '#/components/schemas/AWSRoleConfig' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project '/v1/projects/{projectOrProductUID}/clone': post: operationId: CloneProject @@ -829,6 +935,23 @@ paths: - personalAccessToken: [] tags: - device + '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}': + post: + operationId: CreateNotefile + description: Creates an empty Notefile on the device. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + responses: + '200': + description: An empty object means success + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device '/v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}': get: operationId: GetNotefile @@ -1108,6 +1231,7 @@ paths: - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/firstSyncParam' responses: '200': $ref: '#/components/responses/SessionResponse' @@ -1479,6 +1603,31 @@ paths: tags: - project '/v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}': + get: + operationId: DownloadFirmware + description: Download firmware binary + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' + - name: filename + in: path + required: true + schema: + type: string + responses: + '200': + description: Firmware binary + content: + application/octet-stream: + schema: + type: string + format: binary + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project put: operationId: UploadFirmware description: Upload firmware binary @@ -2373,6 +2522,7 @@ paths: - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2413,6 +2563,7 @@ paths: - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2480,6 +2631,7 @@ paths: - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/routeUIDParamQuery' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2526,6 +2678,7 @@ paths: - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2674,6 +2827,13 @@ paths: - webhook components: parameters: + billingAccountUIDParam: + example: 00000000-0000-0000-000000000001 + in: path + name: billingAccountUID + required: true + schema: + type: string cursorParam: description: | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. @@ -2896,6 +3056,14 @@ components: required: false schema: type: string + firstSyncParam: + description: 'When true, filters results to only show first sync sessions' + in: query + name: firstSync + required: false + schema: + type: boolean + default: false fleetUIDFilterQueryParam: description: Filter by Fleet UID explode: true @@ -3262,6 +3430,16 @@ components: required: false schema: type: boolean + usageLimitQueryParam: + description: Limit the number of data points returned + in: query + name: limit + required: false + schema: + type: integer + default: 200000 + maximum: 400000 + minimum: 1 versionQueryParam: in: query name: version @@ -3284,6 +3462,19 @@ components: schema: type: string schemas: + AWSRoleConfig: + description: Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes + type: object + properties: + aws_account_id: + description: The Blues AWS Account ID to trust in your IAM role's trust policy + type: string + external_id: + description: The External ID to use in your IAM role's trust policy condition + type: string + required: + - aws_account_id + - external_id Alert: type: object properties: @@ -3407,6 +3598,9 @@ components: type: string region: type: string + role_arn: + description: IAM Role ARN for role-based authentication via STS AssumeRole + type: string throttle_ms: type: integer timeout: @@ -4645,6 +4839,7 @@ components: - less_than_or_equal_to - equal_to - not_equal_to + - count description: type: string disabled: @@ -5213,7 +5408,7 @@ components: description: Total bytes included in the plan type: integer format: int64 - example: 18650 + example: 10000 bytes_used: description: Bytes used to date type: integer @@ -5558,32 +5753,20 @@ components: UsageData: type: object properties: - billable_bytes_received: - description: Billable bytes received (only for packet-based protocols) - type: integer - format: int64 - billable_bytes_sent: - description: Billable bytes sent (only for packet-based protocols) - type: integer - format: int64 billable_bytes_total: description: Total billable bytes (only for packet-based protocols) type: integer format: int64 - bytes_received: - type: integer - format: int64 - example: 524288 - bytes_sent: + downlink_bytes: type: integer format: int64 example: 524288 - packets_received: - description: Packets received (only for packet-based protocols) + downlink_bytes_billable: + description: Billable downlink bytes (only for packet-based protocols) type: integer format: int64 - packets_sent: - description: Packets sent (only for packet-based protocols) + downlink_packets: + description: Downlink packets (only for packet-based protocols) type: integer format: int64 period: @@ -5594,12 +5777,29 @@ components: type: integer format: int64 example: 1048576 + uplink_bytes: + type: integer + format: int64 + example: 524288 + uplink_bytes_billable: + description: Billable uplink bytes (only for packet-based protocols) + type: integer + format: int64 + uplink_packets: + description: Uplink packets (only for packet-based protocols) + type: integer + format: int64 required: - period - total_bytes UsageEventsData: type: object properties: + billable_events: + description: 'Events that are billable, this include all events except platform events' + type: integer + format: int64 + example: 10 device: type: string example: 'dev:123456789012345' @@ -5625,6 +5825,10 @@ components: type: integer format: int64 example: 15 + total_days_in_period: + description: 'The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future.' + type: integer + format: int32 total_devices: description: Total devices represented in this count type: integer @@ -5652,6 +5856,8 @@ components: type: array items: $ref: '#/components/schemas/UsageEventsData' + truncated: + $ref: '#/components/schemas/UsageTruncatedField' required: - data UsageRouteLogsData: @@ -5688,6 +5894,11 @@ components: device: type: string example: 'dev:123456789012345' + first_sync_sessions: + description: Number of first sync sessions in this period + type: integer + format: int64 + example: 2 fleet: type: string example: 'fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d' @@ -5710,8 +5921,13 @@ components: required: - period - sessions + - first_sync_sessions - total_bytes - total_devices + UsageTruncatedField: + description: 'If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure' + type: boolean + properties: {} UserDfuStateMachine: type: object properties: @@ -6199,6 +6415,8 @@ components: - type - data type: object + truncated: + $ref: '#/components/schemas/UsageTruncatedField' UsageRouteLogsResponse: description: Response body for Route Log Usage content: @@ -6210,6 +6428,8 @@ components: type: array items: $ref: '#/components/schemas/UsageRouteLogsData' + truncated: + $ref: '#/components/schemas/UsageTruncatedField' required: - route_logs UsageSessionsResponse: @@ -6223,8 +6443,11 @@ components: type: array items: $ref: '#/components/schemas/UsageSessionsData' + truncated: + $ref: '#/components/schemas/UsageTruncatedField' required: - sessions + - truncated securitySchemes: personalAccessToken: description: | diff --git a/openapi_filtered.yaml b/openapi_filtered.yaml index ac666ae..6c4d02d 100644 --- a/openapi_filtered.yaml +++ b/openapi_filtered.yaml @@ -143,6 +143,90 @@ paths: - personalAccessToken: [] tags: - billing_account + /v1/billing-accounts/{billingAccountUID}: + get: + operationId: GetBillingAccount + description: Get Billing Account Information + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + responses: + "200": + description: Successful operation + content: + application/json: + schema: + type: object + properties: + name: + type: string + owner: + type: string + plan: + type: object + properties: + current_balance: + type: integer + format: int64 + end_date: + type: string + format: date-time + event_capacity: + type: integer + format: int64 + start_date: + type: string + format: date-time + type: + type: string + enum: + - Enterprise + - Essentials + suspended: + type: boolean + uid: + type: string + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account + /v1/billing-accounts/{billingAccountUID}/balance-history: + get: + operationId: GetBillingAccountBalanceHistory + description: Get Billing Account Balance history, only enterprise supported + parameters: + - $ref: '#/components/parameters/billingAccountUIDParam' + - $ref: '#/components/parameters/startDateParam' + - $ref: '#/components/parameters/endDateParam' + responses: + "200": + description: Successful operation + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + properties: + period: + type: string + format: date-time + remaining_event_capacity: + type: integer + format: int64 + required: + - remaining_event_capacity + - period + type: object + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - billing_account /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin: get: operationId: GetDeviceEnvironmentVariablesByPin @@ -375,6 +459,28 @@ paths: - personalAccessToken: [] tags: - alert + /v1/projects/{projectOrProductUID}/aws-role-config: + get: + operationId: GetAWSRoleConfig + summary: Get AWS role configuration for role-based authentication + description: | + Returns the AWS Account ID and External ID needed to configure an IAM role + trust policy for role-based authentication on AWS routes. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + responses: + "200": + description: AWS role configuration + content: + application/json: + schema: + $ref: '#/components/schemas/AWSRoleConfig' + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project /v1/projects/{projectOrProductUID}/clone: post: operationId: CloneProject @@ -533,22 +639,6 @@ paths: - personalAccessToken: [] tags: - device - /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable-connectivity-assurance: - post: - operationId: DisableDeviceConnectivityAssurance - description: Disable Connectivity Assurance - parameters: - - $ref: '#/components/parameters/projectOrProductUIDParam' - - $ref: '#/components/parameters/deviceUIDParam' - responses: - "200": - description: Successful operation - default: - $ref: '#/components/responses/ErrorResponse' - security: - - personalAccessToken: [] - tags: - - device /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable: post: operationId: EnableDevice @@ -565,22 +655,6 @@ paths: - personalAccessToken: [] tags: - device - /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable-connectivity-assurance: - post: - operationId: EnableDeviceConnectivityAssurance - description: Enable Connectivity Assurance - parameters: - - $ref: '#/components/parameters/projectOrProductUIDParam' - - $ref: '#/components/parameters/deviceUIDParam' - responses: - "200": - description: Successful operation - default: - $ref: '#/components/responses/ErrorResponse' - security: - - personalAccessToken: [] - tags: - - device /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy: get: operationId: GetDeviceEnvironmentHierarchy @@ -861,6 +935,23 @@ paths: - personalAccessToken: [] tags: - device + /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}: + post: + operationId: CreateNotefile + description: Creates an empty Notefile on the device. + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/deviceUIDParam' + - $ref: '#/components/parameters/notefileIDParam' + responses: + "200": + description: An empty object means success + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - device /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}: get: operationId: GetNotefile @@ -1140,6 +1231,7 @@ paths: - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' + - $ref: '#/components/parameters/firstSyncParam' responses: "200": $ref: '#/components/responses/SessionResponse' @@ -1477,6 +1569,8 @@ paths: - $ref: '#/components/parameters/filenameQueryParam' - $ref: '#/components/parameters/md5QueryParam' - $ref: '#/components/parameters/unpublishedQueryParam' + - $ref: '#/components/parameters/firmwareSortByParam' + - $ref: '#/components/parameters/firmwareSortOrderParam' responses: "200": description: Success @@ -1493,6 +1587,31 @@ paths: tags: - project /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename}: + get: + operationId: DownloadFirmware + description: Download firmware binary + parameters: + - $ref: '#/components/parameters/projectOrProductUIDParam' + - $ref: '#/components/parameters/firmwareTypeParam' + - name: filename + in: path + required: true + schema: + type: string + responses: + "200": + description: Firmware binary + content: + application/octet-stream: + schema: + type: string + format: binary + default: + $ref: '#/components/responses/ErrorResponse' + security: + - personalAccessToken: [] + tags: + - project put: operationId: UploadFirmware description: Upload firmware binary @@ -2327,6 +2446,8 @@ paths: - $ref: '#/components/parameters/systemFilesOnlyParam' - $ref: '#/components/parameters/mostRecentOnlyParam' - $ref: '#/components/parameters/filesQueryParam' + - $ref: '#/components/parameters/routingStatusParam' + - $ref: '#/components/parameters/responseStatusParam' responses: "200": description: Successful operation @@ -2369,6 +2490,7 @@ paths: - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2409,6 +2531,7 @@ paths: - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2476,6 +2599,7 @@ paths: - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/routeUIDParamQuery' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2522,6 +2646,7 @@ paths: - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/fleetUIDFilterQueryParam' + - $ref: '#/components/parameters/usageLimitQueryParam' - name: period in: query description: Period type for aggregation @@ -2670,6 +2795,13 @@ paths: - webhook components: parameters: + billingAccountUIDParam: + example: 00000000-0000-0000-000000000001 + in: path + name: billingAccountUID + required: true + schema: + type: string cursorParam: description: | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. @@ -2853,6 +2985,30 @@ components: required: false schema: type: string + firmwareSortByParam: + description: Field to sort by + in: query + name: sortBy + required: false + schema: + type: string + default: created + enum: + - created + - name + - version + - length + firmwareSortOrderParam: + description: Sort order (asc for ascending, desc for descending) + in: query + name: sortOrder + required: false + schema: + type: string + default: desc + enum: + - asc + - desc firmwareTypeParam: in: path name: firmwareType @@ -2868,6 +3024,14 @@ components: required: false schema: type: string + firstSyncParam: + description: When true, filters results to only show first sync sessions + in: query + name: firstSync + required: false + schema: + type: boolean + default: false fleetUIDFilterQueryParam: description: Filter by Fleet UID explode: true @@ -3059,6 +3223,15 @@ components: schema: type: string example: rid:2606f411-dea6-44a0-9743-1130f57d77d8 + responseStatusParam: + example: 500 + in: query + name: responseStatus + required: false + schema: + type: array + items: + type: string routeLogsSortByParam: in: query name: sortBy @@ -3097,6 +3270,18 @@ components: items: type: string style: form + routingStatusParam: + example: failure + in: query + name: routingStatus + required: false + schema: + type: array + items: + enum: + - success + - failure + type: string selectFieldsParam: description: Comma-separated list of fields to select from JSON payload (e.g., "field1,field2.subfield,field3"), this will reflect the columns in the CSV output. in: query @@ -3213,6 +3398,16 @@ components: required: false schema: type: boolean + usageLimitQueryParam: + description: Limit the number of data points returned + in: query + name: limit + required: false + schema: + type: integer + default: 200000 + maximum: 400000 + minimum: 1 versionQueryParam: in: query name: version @@ -3235,6 +3430,19 @@ components: schema: type: string schemas: + AWSRoleConfig: + description: Configuration needed to set up an IAM role trust policy for role-based authentication on AWS routes + type: object + properties: + aws_account_id: + description: The Blues AWS Account ID to trust in your IAM role's trust policy + type: string + external_id: + description: The External ID to use in your IAM role's trust policy condition + type: string + required: + - aws_account_id + - external_id Alert: type: object properties: @@ -3358,6 +3566,9 @@ components: type: string region: type: string + role_arn: + description: IAM Role ARN for role-based authentication via STS AssumeRole + type: string throttle_ms: type: integer timeout: @@ -4596,6 +4807,7 @@ components: - less_than_or_equal_to - equal_to - not_equal_to + - count description: type: string disabled: @@ -5152,6 +5364,34 @@ components: type: string format: uri additionalProperties: false + SatelliteDataUsage: + type: object + properties: + bytes_remaining: + description: Bytes remaining in the plan + type: integer + format: int64 + example: 18600 + bytes_total: + description: Total bytes included in the plan + type: integer + format: int64 + example: 10000 + bytes_used: + description: Bytes used to date + type: integer + format: int64 + example: 49 + bytes_used_billable: + description: Billable bytes used to date + type: integer + format: int64 + example: 50 + required: + - bytes_total + - bytes_used + - bytes_used_billable + - bytes_remaining SatellitePlan: type: object properties: @@ -5160,13 +5400,16 @@ components: type: integer format: int64 example: 1609459200 - billable_bytes: - $ref: '#/components/schemas/DataUsage' - last_updated: - description: Time this plan information was last updated + last_session_at: + description: When this Starnote last had a session type: integer format: int64 - example: 1656010061 + example: 1808675309 + minimum_billable_bytes: + description: Minimum billable bytes + type: integer + format: int64 + example: 50 ntn_provider: description: Non-Terrestrial Network provider name type: string @@ -5175,6 +5418,8 @@ components: description: Provider-specific identifier for the satellite subscription type: string example: skylo:5746354465786 + satellite_data_usage: + $ref: '#/components/schemas/SatelliteDataUsage' nullable: true required: - ntn_provider @@ -5476,14 +5721,22 @@ components: UsageData: type: object properties: - bytes_received: + billable_bytes_total: + description: Total billable bytes (only for packet-based protocols) type: integer format: int64 - example: 524288 - bytes_sent: + downlink_bytes: type: integer format: int64 example: 524288 + downlink_bytes_billable: + description: Billable downlink bytes (only for packet-based protocols) + type: integer + format: int64 + downlink_packets: + description: Downlink packets (only for packet-based protocols) + type: integer + format: int64 period: type: string format: date-time @@ -5492,12 +5745,29 @@ components: type: integer format: int64 example: 1048576 + uplink_bytes: + type: integer + format: int64 + example: 524288 + uplink_bytes_billable: + description: Billable uplink bytes (only for packet-based protocols) + type: integer + format: int64 + uplink_packets: + description: Uplink packets (only for packet-based protocols) + type: integer + format: int64 required: - period - total_bytes UsageEventsData: type: object properties: + billable_events: + description: Events that are billable, this include all events except platform events + type: integer + format: int64 + example: 10 device: type: string example: dev:123456789012345 @@ -5523,6 +5793,10 @@ components: type: integer format: int64 example: 15 + total_days_in_period: + description: The total number of days in this period. Useful for calculating daily averages for month period. Note that the current period will be the total number of days in the current period, including days in the future. + type: integer + format: int32 total_devices: description: Total devices represented in this count type: integer @@ -5550,6 +5824,8 @@ components: type: array items: $ref: '#/components/schemas/UsageEventsData' + truncated: + $ref: '#/components/schemas/UsageTruncatedField' required: - data UsageRouteLogsData: @@ -5586,6 +5862,11 @@ components: device: type: string example: dev:123456789012345 + first_sync_sessions: + description: Number of first sync sessions in this period + type: integer + format: int64 + example: 2 fleet: type: string example: fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d @@ -5608,8 +5889,13 @@ components: required: - period - sessions + - first_sync_sessions - total_bytes - total_devices + UsageTruncatedField: + description: If the data is truncated that means that the parameters selected resulted in a response of over | the requested limit of data points, in order to ensure + type: boolean + properties: {} UserDfuStateMachine: type: object properties: @@ -6083,10 +6369,10 @@ components: description: The ICCID of the cellular SIM card (only present when type is 'cellular') type: string example: "12345678901234567890" - imsi: - description: The IMSI of the satellite device (only present when type is 'satellite') + psid: + description: The PSID (Packet Service ID) of the satellite (or other packet-based device) type: string - example: "123456789012345" + example: skylo:5746354465786 type: description: The type of connectivity type: string @@ -6097,6 +6383,8 @@ components: - type - data type: object + truncated: + $ref: '#/components/schemas/UsageTruncatedField' UsageRouteLogsResponse: description: Response body for Route Log Usage content: @@ -6108,6 +6396,8 @@ components: type: array items: $ref: '#/components/schemas/UsageRouteLogsData' + truncated: + $ref: '#/components/schemas/UsageTruncatedField' required: - route_logs UsageSessionsResponse: @@ -6121,8 +6411,11 @@ components: type: array items: $ref: '#/components/schemas/UsageSessionsData' + truncated: + $ref: '#/components/schemas/UsageTruncatedField' required: - sessions + - truncated securitySchemes: personalAccessToken: description: | diff --git a/scripts.sh b/scripts.sh index 588337b..941470a 100755 --- a/scripts.sh +++ b/scripts.sh @@ -308,6 +308,9 @@ generate_and_format() { local output_dir="${1:-.}" + # Remove test files so the generator produces fresh tests matching the current spec + rm -rf test/ + remove_deprecated_parameters "openapi.yaml" "openapi_filtered.yaml" generate_package "openapi_filtered.yaml" "$output_dir" format_code diff --git a/test/api_billing_account_test.go b/test/api_billing_account_test.go index 06f9e70..20dd4f4 100644 --- a/test/api_billing_account_test.go +++ b/test/api_billing_account_test.go @@ -23,6 +23,34 @@ func Test_notehub_BillingAccountAPIService(t *testing.T) { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) + t.Run("Test BillingAccountAPIService GetBillingAccount", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var billingAccountUID string + + resp, httpRes, err := apiClient.BillingAccountAPI.GetBillingAccount(context.Background(), billingAccountUID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test BillingAccountAPIService GetBillingAccountBalanceHistory", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var billingAccountUID string + + resp, httpRes, err := apiClient.BillingAccountAPI.GetBillingAccountBalanceHistory(context.Background(), billingAccountUID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test BillingAccountAPIService GetBillingAccounts", func(t *testing.T) { t.Skip("skip test") // remove to run test diff --git a/test/api_device_test.go b/test/api_device_test.go index 92ea8a9..5218e6c 100644 --- a/test/api_device_test.go +++ b/test/api_device_test.go @@ -54,6 +54,21 @@ func Test_notehub_DeviceAPIService(t *testing.T) { }) + t.Run("Test DeviceAPIService CreateNotefile", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var projectOrProductUID string + var deviceUID string + var notefileID string + + httpRes, err := apiClient.DeviceAPI.CreateNotefile(context.Background(), projectOrProductUID, deviceUID, notefileID).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test DeviceAPIService DeleteDevice", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -128,20 +143,6 @@ func Test_notehub_DeviceAPIService(t *testing.T) { }) - t.Run("Test DeviceAPIService DisableDeviceConnectivityAssurance", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var projectOrProductUID string - var deviceUID string - - httpRes, err := apiClient.DeviceAPI.DisableDeviceConnectivityAssurance(context.Background(), projectOrProductUID, deviceUID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - t.Run("Test DeviceAPIService EnableDevice", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -156,20 +157,6 @@ func Test_notehub_DeviceAPIService(t *testing.T) { }) - t.Run("Test DeviceAPIService EnableDeviceConnectivityAssurance", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var projectOrProductUID string - var deviceUID string - - httpRes, err := apiClient.DeviceAPI.EnableDeviceConnectivityAssurance(context.Background(), projectOrProductUID, deviceUID).Execute() - - require.Nil(t, err) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - t.Run("Test DeviceAPIService GetDbNote", func(t *testing.T) { t.Skip("skip test") // remove to run test diff --git a/test/api_project_test.go b/test/api_project_test.go index a7d10b8..89f0d37 100644 --- a/test/api_project_test.go +++ b/test/api_project_test.go @@ -192,6 +192,22 @@ func Test_notehub_ProjectAPIService(t *testing.T) { }) + t.Run("Test ProjectAPIService DownloadFirmware", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var projectOrProductUID string + var firmwareType string + var filename string + + resp, httpRes, err := apiClient.ProjectAPI.DownloadFirmware(context.Background(), projectOrProductUID, firmwareType, filename).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test ProjectAPIService EnableGlobalEventTransformation", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -205,6 +221,20 @@ func Test_notehub_ProjectAPIService(t *testing.T) { }) + t.Run("Test ProjectAPIService GetAWSRoleConfig", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var projectOrProductUID string + + resp, httpRes, err := apiClient.ProjectAPI.GetAWSRoleConfig(context.Background(), projectOrProductUID).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test ProjectAPIService GetDeviceDfuHistory", func(t *testing.T) { t.Skip("skip test") // remove to run test