/* * A Bit of Everything * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * API version: 1.0 * Contact: none@example.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package abe import ( "context" "io/ioutil" "net/http" "net/url" "strings" "fmt" "github.com/antihax/optional" ) // Linger please var ( _ context.Context ) type ABitOfEverythingServiceApiService service /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param singleNestedName name is nested field. * @param floatValue Float value field * @param optional nil or *ABitOfEverythingServiceCheckGetQueryParamsOpts - Optional Parameters: * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "Uuid" (optional.String) - * @param "DoubleValue" (optional.Float64) - * @param "Int64Value" (optional.String) - * @param "Uint64Value" (optional.String) - * @param "Int32Value" (optional.Int32) - * @param "Fixed64Value" (optional.String) - * @param "Fixed32Value" (optional.Int64) - * @param "BoolValue" (optional.Bool) - * @param "StringValue" (optional.String) - * @param "BytesValue" (optional.String) - * @param "Uint32Value" (optional.Int64) - * @param "EnumValue" (optional.String) - - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "PathEnumValue" (optional.String) - * @param "NestedPathEnumValue" (optional.String) - * @param "Sfixed32Value" (optional.Int32) - * @param "Sfixed64Value" (optional.String) - * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - * @param "OneofString" (optional.String) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedEnumAnnotation" (optional.Interface of []string) - Repeated numeric enum title. Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "EnumValueAnnotation" (optional.String) - Numeric enum title. Numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedStringAnnotation" (optional.Interface of []string) - Repeated string title. Repeated string description. * @param "NestedAnnotationAmount" (optional.Int64) - * @param "NestedAnnotationOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "Int64OverrideType" (optional.Int64) - @return ExamplepbABitOfEverything */ type ABitOfEverythingServiceCheckGetQueryParamsOpts struct { SingleNestedAmount optional.Int64 SingleNestedOk optional.String Uuid optional.String DoubleValue optional.Float64 Int64Value optional.String Uint64Value optional.String Int32Value optional.Int32 Fixed64Value optional.String Fixed32Value optional.Int64 BoolValue optional.Bool StringValue optional.String BytesValue optional.String Uint32Value optional.Int64 EnumValue optional.String PathEnumValue optional.String NestedPathEnumValue optional.String Sfixed32Value optional.Int32 Sfixed64Value optional.String Sint32Value optional.Int32 Sint64Value optional.String RepeatedStringValue optional.Interface OneofString optional.String NonConventionalNameValue optional.String TimestampValue optional.Time RepeatedEnumValue optional.Interface RepeatedEnumAnnotation optional.Interface EnumValueAnnotation optional.String RepeatedStringAnnotation optional.Interface NestedAnnotationAmount optional.Int64 NestedAnnotationOk optional.String Int64OverrideType optional.Int64 } func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckGetQueryParams(ctx context.Context, singleNestedName string, floatValue float32, localVarOptionals *ABitOfEverythingServiceCheckGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/params/get/{single_nested.name}" localVarPath = strings.Replace(localVarPath, "{"+"single_nested.name"+"}", fmt.Sprintf("%v", singleNestedName), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.SingleNestedAmount.IsSet() { localVarQueryParams.Add("single_nested.amount", parameterToString(localVarOptionals.SingleNestedAmount.Value(), "")) } if localVarOptionals != nil && localVarOptionals.SingleNestedOk.IsSet() { localVarQueryParams.Add("single_nested.ok", parameterToString(localVarOptionals.SingleNestedOk.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uuid.IsSet() { localVarQueryParams.Add("uuid", parameterToString(localVarOptionals.Uuid.Value(), "")) } localVarQueryParams.Add("float_value", parameterToString(floatValue, "")) if localVarOptionals != nil && localVarOptionals.DoubleValue.IsSet() { localVarQueryParams.Add("double_value", parameterToString(localVarOptionals.DoubleValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int64Value.IsSet() { localVarQueryParams.Add("int64_value", parameterToString(localVarOptionals.Int64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uint64Value.IsSet() { localVarQueryParams.Add("uint64_value", parameterToString(localVarOptionals.Uint64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int32Value.IsSet() { localVarQueryParams.Add("int32_value", parameterToString(localVarOptionals.Int32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Fixed64Value.IsSet() { localVarQueryParams.Add("fixed64_value", parameterToString(localVarOptionals.Fixed64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Fixed32Value.IsSet() { localVarQueryParams.Add("fixed32_value", parameterToString(localVarOptionals.Fixed32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.BoolValue.IsSet() { localVarQueryParams.Add("bool_value", parameterToString(localVarOptionals.BoolValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.StringValue.IsSet() { localVarQueryParams.Add("string_value", parameterToString(localVarOptionals.StringValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.BytesValue.IsSet() { localVarQueryParams.Add("bytes_value", parameterToString(localVarOptionals.BytesValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uint32Value.IsSet() { localVarQueryParams.Add("uint32_value", parameterToString(localVarOptionals.Uint32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.EnumValue.IsSet() { localVarQueryParams.Add("enum_value", parameterToString(localVarOptionals.EnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.PathEnumValue.IsSet() { localVarQueryParams.Add("path_enum_value", parameterToString(localVarOptionals.PathEnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedPathEnumValue.IsSet() { localVarQueryParams.Add("nested_path_enum_value", parameterToString(localVarOptionals.NestedPathEnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sfixed32Value.IsSet() { localVarQueryParams.Add("sfixed32_value", parameterToString(localVarOptionals.Sfixed32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sfixed64Value.IsSet() { localVarQueryParams.Add("sfixed64_value", parameterToString(localVarOptionals.Sfixed64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sint32Value.IsSet() { localVarQueryParams.Add("sint32_value", parameterToString(localVarOptionals.Sint32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sint64Value.IsSet() { localVarQueryParams.Add("sint64_value", parameterToString(localVarOptionals.Sint64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedStringValue.IsSet() { localVarQueryParams.Add("repeated_string_value", parameterToString(localVarOptionals.RepeatedStringValue.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.OneofString.IsSet() { localVarQueryParams.Add("oneof_string", parameterToString(localVarOptionals.OneofString.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NonConventionalNameValue.IsSet() { localVarQueryParams.Add("nonConventionalNameValue", parameterToString(localVarOptionals.NonConventionalNameValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.TimestampValue.IsSet() { localVarQueryParams.Add("timestamp_value", parameterToString(localVarOptionals.TimestampValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedEnumValue.IsSet() { localVarQueryParams.Add("repeated_enum_value", parameterToString(localVarOptionals.RepeatedEnumValue.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.RepeatedEnumAnnotation.IsSet() { localVarQueryParams.Add("repeated_enum_annotation", parameterToString(localVarOptionals.RepeatedEnumAnnotation.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.EnumValueAnnotation.IsSet() { localVarQueryParams.Add("enum_value_annotation", parameterToString(localVarOptionals.EnumValueAnnotation.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedStringAnnotation.IsSet() { localVarQueryParams.Add("repeated_string_annotation", parameterToString(localVarOptionals.RepeatedStringAnnotation.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationAmount.IsSet() { localVarQueryParams.Add("nested_annotation.amount", parameterToString(localVarOptionals.NestedAnnotationAmount.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationOk.IsSet() { localVarQueryParams.Add("nested_annotation.ok", parameterToString(localVarOptionals.NestedAnnotationOk.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int64OverrideType.IsSet() { localVarQueryParams.Add("int64_override_type", parameterToString(localVarOptionals.Int64OverrideType.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param singleNestedOk DeepEnum description. * @param floatValue Float value field * @param optional nil or *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "Uuid" (optional.String) - * @param "DoubleValue" (optional.Float64) - * @param "Int64Value" (optional.String) - * @param "Uint64Value" (optional.String) - * @param "Int32Value" (optional.Int32) - * @param "Fixed64Value" (optional.String) - * @param "Fixed32Value" (optional.Int64) - * @param "BoolValue" (optional.Bool) - * @param "StringValue" (optional.String) - * @param "BytesValue" (optional.String) - * @param "Uint32Value" (optional.Int64) - * @param "EnumValue" (optional.String) - - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "PathEnumValue" (optional.String) - * @param "NestedPathEnumValue" (optional.String) - * @param "Sfixed32Value" (optional.Int32) - * @param "Sfixed64Value" (optional.String) - * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - * @param "OneofString" (optional.String) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedEnumAnnotation" (optional.Interface of []string) - Repeated numeric enum title. Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "EnumValueAnnotation" (optional.String) - Numeric enum title. Numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedStringAnnotation" (optional.Interface of []string) - Repeated string title. Repeated string description. * @param "NestedAnnotationName" (optional.String) - name is nested field. * @param "NestedAnnotationAmount" (optional.Int64) - * @param "Int64OverrideType" (optional.Int64) - @return ExamplepbABitOfEverything */ type ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts struct { SingleNestedName optional.String SingleNestedAmount optional.Int64 Uuid optional.String DoubleValue optional.Float64 Int64Value optional.String Uint64Value optional.String Int32Value optional.Int32 Fixed64Value optional.String Fixed32Value optional.Int64 BoolValue optional.Bool StringValue optional.String BytesValue optional.String Uint32Value optional.Int64 EnumValue optional.String PathEnumValue optional.String NestedPathEnumValue optional.String Sfixed32Value optional.Int32 Sfixed64Value optional.String Sint32Value optional.Int32 Sint64Value optional.String RepeatedStringValue optional.Interface OneofString optional.String NonConventionalNameValue optional.String TimestampValue optional.Time RepeatedEnumValue optional.Interface RepeatedEnumAnnotation optional.Interface EnumValueAnnotation optional.String RepeatedStringAnnotation optional.Interface NestedAnnotationName optional.String NestedAnnotationAmount optional.Int64 Int64OverrideType optional.Int64 } func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckNestedEnumGetQueryParams(ctx context.Context, singleNestedOk string, floatValue float32, localVarOptionals *ABitOfEverythingServiceCheckNestedEnumGetQueryParamsOpts) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/params/get/nested_enum/{single_nested.ok}" localVarPath = strings.Replace(localVarPath, "{"+"single_nested.ok"+"}", fmt.Sprintf("%v", singleNestedOk), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.SingleNestedName.IsSet() { localVarQueryParams.Add("single_nested.name", parameterToString(localVarOptionals.SingleNestedName.Value(), "")) } if localVarOptionals != nil && localVarOptionals.SingleNestedAmount.IsSet() { localVarQueryParams.Add("single_nested.amount", parameterToString(localVarOptionals.SingleNestedAmount.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uuid.IsSet() { localVarQueryParams.Add("uuid", parameterToString(localVarOptionals.Uuid.Value(), "")) } localVarQueryParams.Add("float_value", parameterToString(floatValue, "")) if localVarOptionals != nil && localVarOptionals.DoubleValue.IsSet() { localVarQueryParams.Add("double_value", parameterToString(localVarOptionals.DoubleValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int64Value.IsSet() { localVarQueryParams.Add("int64_value", parameterToString(localVarOptionals.Int64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uint64Value.IsSet() { localVarQueryParams.Add("uint64_value", parameterToString(localVarOptionals.Uint64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int32Value.IsSet() { localVarQueryParams.Add("int32_value", parameterToString(localVarOptionals.Int32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Fixed64Value.IsSet() { localVarQueryParams.Add("fixed64_value", parameterToString(localVarOptionals.Fixed64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Fixed32Value.IsSet() { localVarQueryParams.Add("fixed32_value", parameterToString(localVarOptionals.Fixed32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.BoolValue.IsSet() { localVarQueryParams.Add("bool_value", parameterToString(localVarOptionals.BoolValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.StringValue.IsSet() { localVarQueryParams.Add("string_value", parameterToString(localVarOptionals.StringValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.BytesValue.IsSet() { localVarQueryParams.Add("bytes_value", parameterToString(localVarOptionals.BytesValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uint32Value.IsSet() { localVarQueryParams.Add("uint32_value", parameterToString(localVarOptionals.Uint32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.EnumValue.IsSet() { localVarQueryParams.Add("enum_value", parameterToString(localVarOptionals.EnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.PathEnumValue.IsSet() { localVarQueryParams.Add("path_enum_value", parameterToString(localVarOptionals.PathEnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedPathEnumValue.IsSet() { localVarQueryParams.Add("nested_path_enum_value", parameterToString(localVarOptionals.NestedPathEnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sfixed32Value.IsSet() { localVarQueryParams.Add("sfixed32_value", parameterToString(localVarOptionals.Sfixed32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sfixed64Value.IsSet() { localVarQueryParams.Add("sfixed64_value", parameterToString(localVarOptionals.Sfixed64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sint32Value.IsSet() { localVarQueryParams.Add("sint32_value", parameterToString(localVarOptionals.Sint32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sint64Value.IsSet() { localVarQueryParams.Add("sint64_value", parameterToString(localVarOptionals.Sint64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedStringValue.IsSet() { localVarQueryParams.Add("repeated_string_value", parameterToString(localVarOptionals.RepeatedStringValue.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.OneofString.IsSet() { localVarQueryParams.Add("oneof_string", parameterToString(localVarOptionals.OneofString.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NonConventionalNameValue.IsSet() { localVarQueryParams.Add("nonConventionalNameValue", parameterToString(localVarOptionals.NonConventionalNameValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.TimestampValue.IsSet() { localVarQueryParams.Add("timestamp_value", parameterToString(localVarOptionals.TimestampValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedEnumValue.IsSet() { localVarQueryParams.Add("repeated_enum_value", parameterToString(localVarOptionals.RepeatedEnumValue.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.RepeatedEnumAnnotation.IsSet() { localVarQueryParams.Add("repeated_enum_annotation", parameterToString(localVarOptionals.RepeatedEnumAnnotation.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.EnumValueAnnotation.IsSet() { localVarQueryParams.Add("enum_value_annotation", parameterToString(localVarOptionals.EnumValueAnnotation.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedStringAnnotation.IsSet() { localVarQueryParams.Add("repeated_string_annotation", parameterToString(localVarOptionals.RepeatedStringAnnotation.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationName.IsSet() { localVarQueryParams.Add("nested_annotation.name", parameterToString(localVarOptionals.NestedAnnotationName.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationAmount.IsSet() { localVarQueryParams.Add("nested_annotation.amount", parameterToString(localVarOptionals.NestedAnnotationAmount.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int64OverrideType.IsSet() { localVarQueryParams.Add("int64_override_type", parameterToString(localVarOptionals.Int64OverrideType.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param stringValue * @param body @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCheckPostQueryParams(ctx context.Context, stringValue string, body ABitOfEverythingNested) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/params/post/{string_value}" localVarPath = strings.Replace(localVarPath, "{"+"string_value"+"}", fmt.Sprintf("%v", stringValue), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService Create a new ABitOfEverything This API creates a new ABitOfEverything * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param floatValue Float value field * @param doubleValue * @param int64Value * @param uint64Value * @param int32Value * @param fixed64Value * @param fixed32Value * @param boolValue * @param stringValue * @param uint32Value * @param sfixed32Value * @param sfixed64Value * @param sint32Value * @param sint64Value * @param nonConventionalNameValue * @param enumValue * @param pathEnumValue * @param nestedPathEnumValue * @param enumValueAnnotation Numeric enum description. @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCreate(ctx context.Context, floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string, enumValue string, pathEnumValue string, nestedPathEnumValue string, enumValueAnnotation string) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{enum_value_annotation}" localVarPath = strings.Replace(localVarPath, "{"+"float_value"+"}", fmt.Sprintf("%v", floatValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"double_value"+"}", fmt.Sprintf("%v", doubleValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"int64_value"+"}", fmt.Sprintf("%v", int64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"uint64_value"+"}", fmt.Sprintf("%v", uint64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"int32_value"+"}", fmt.Sprintf("%v", int32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"fixed64_value"+"}", fmt.Sprintf("%v", fixed64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"fixed32_value"+"}", fmt.Sprintf("%v", fixed32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"bool_value"+"}", fmt.Sprintf("%v", boolValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"string_value"+"}", fmt.Sprintf("%v", stringValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"uint32_value"+"}", fmt.Sprintf("%v", uint32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"sfixed32_value"+"}", fmt.Sprintf("%v", sfixed32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"sfixed64_value"+"}", fmt.Sprintf("%v", sfixed64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"sint32_value"+"}", fmt.Sprintf("%v", sint32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"sint64_value"+"}", fmt.Sprintf("%v", sint64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"nonConventionalNameValue"+"}", fmt.Sprintf("%v", nonConventionalNameValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"enum_value"+"}", fmt.Sprintf("%v", enumValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_enum_value"+"}", fmt.Sprintf("%v", pathEnumValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"nested_path_enum_value"+"}", fmt.Sprintf("%v", nestedPathEnumValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"enum_value_annotation"+"}", fmt.Sprintf("%v", enumValueAnnotation), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceCreateBody(ctx context.Context, body ExamplepbABitOfEverything) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param singleNestedName name is nested field. * @param body @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceDeepPathEcho(ctx context.Context, singleNestedName string, body ExamplepbABitOfEverything) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/{single_nested.name}" localVarPath = strings.Replace(localVarPath, "{"+"single_nested.name"+"}", fmt.Sprintf("%v", singleNestedName), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceDelete(ctx context.Context, uuid string) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/{uuid}" localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", fmt.Sprintf("%v", uuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceErrorWithDetails(ctx context.Context) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/errorwithdetails" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param id * @param body @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetMessageWithBody(ctx context.Context, id string, body ExamplepbBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/withbody/{id}" localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid * @param floatValue Float value field * @param optional nil or *ABitOfEverythingServiceGetQueryOpts - Optional Parameters: * @param "SingleNestedName" (optional.String) - name is nested field. * @param "SingleNestedAmount" (optional.Int64) - * @param "SingleNestedOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "DoubleValue" (optional.Float64) - * @param "Int64Value" (optional.String) - * @param "Uint64Value" (optional.String) - * @param "Int32Value" (optional.Int32) - * @param "Fixed64Value" (optional.String) - * @param "Fixed32Value" (optional.Int64) - * @param "BoolValue" (optional.Bool) - * @param "StringValue" (optional.String) - * @param "BytesValue" (optional.String) - * @param "Uint32Value" (optional.Int64) - * @param "EnumValue" (optional.String) - - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "PathEnumValue" (optional.String) - * @param "NestedPathEnumValue" (optional.String) - * @param "Sfixed32Value" (optional.Int32) - * @param "Sfixed64Value" (optional.String) - * @param "Sint32Value" (optional.Int32) - * @param "Sint64Value" (optional.String) - * @param "RepeatedStringValue" (optional.Interface of []string) - * @param "OneofString" (optional.String) - * @param "NonConventionalNameValue" (optional.String) - * @param "TimestampValue" (optional.Time) - * @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedEnumAnnotation" (optional.Interface of []string) - Repeated numeric enum title. Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "EnumValueAnnotation" (optional.String) - Numeric enum title. Numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1 * @param "RepeatedStringAnnotation" (optional.Interface of []string) - Repeated string title. Repeated string description. * @param "NestedAnnotationName" (optional.String) - name is nested field. * @param "NestedAnnotationAmount" (optional.Int64) - * @param "NestedAnnotationOk" (optional.String) - DeepEnum description. - FALSE: FALSE is false. - TRUE: TRUE is true. * @param "Int64OverrideType" (optional.Int64) - @return interface{} */ type ABitOfEverythingServiceGetQueryOpts struct { SingleNestedName optional.String SingleNestedAmount optional.Int64 SingleNestedOk optional.String DoubleValue optional.Float64 Int64Value optional.String Uint64Value optional.String Int32Value optional.Int32 Fixed64Value optional.String Fixed32Value optional.Int64 BoolValue optional.Bool StringValue optional.String BytesValue optional.String Uint32Value optional.Int64 EnumValue optional.String PathEnumValue optional.String NestedPathEnumValue optional.String Sfixed32Value optional.Int32 Sfixed64Value optional.String Sint32Value optional.Int32 Sint64Value optional.String RepeatedStringValue optional.Interface OneofString optional.String NonConventionalNameValue optional.String TimestampValue optional.Time RepeatedEnumValue optional.Interface RepeatedEnumAnnotation optional.Interface EnumValueAnnotation optional.String RepeatedStringAnnotation optional.Interface NestedAnnotationName optional.String NestedAnnotationAmount optional.Int64 NestedAnnotationOk optional.String Int64OverrideType optional.Int64 } func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetQuery(ctx context.Context, uuid string, floatValue float32, localVarOptionals *ABitOfEverythingServiceGetQueryOpts) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/query/{uuid}" localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", fmt.Sprintf("%v", uuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if localVarOptionals != nil && localVarOptionals.SingleNestedName.IsSet() { localVarQueryParams.Add("single_nested.name", parameterToString(localVarOptionals.SingleNestedName.Value(), "")) } if localVarOptionals != nil && localVarOptionals.SingleNestedAmount.IsSet() { localVarQueryParams.Add("single_nested.amount", parameterToString(localVarOptionals.SingleNestedAmount.Value(), "")) } if localVarOptionals != nil && localVarOptionals.SingleNestedOk.IsSet() { localVarQueryParams.Add("single_nested.ok", parameterToString(localVarOptionals.SingleNestedOk.Value(), "")) } localVarQueryParams.Add("float_value", parameterToString(floatValue, "")) if localVarOptionals != nil && localVarOptionals.DoubleValue.IsSet() { localVarQueryParams.Add("double_value", parameterToString(localVarOptionals.DoubleValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int64Value.IsSet() { localVarQueryParams.Add("int64_value", parameterToString(localVarOptionals.Int64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uint64Value.IsSet() { localVarQueryParams.Add("uint64_value", parameterToString(localVarOptionals.Uint64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int32Value.IsSet() { localVarQueryParams.Add("int32_value", parameterToString(localVarOptionals.Int32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Fixed64Value.IsSet() { localVarQueryParams.Add("fixed64_value", parameterToString(localVarOptionals.Fixed64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Fixed32Value.IsSet() { localVarQueryParams.Add("fixed32_value", parameterToString(localVarOptionals.Fixed32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.BoolValue.IsSet() { localVarQueryParams.Add("bool_value", parameterToString(localVarOptionals.BoolValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.StringValue.IsSet() { localVarQueryParams.Add("string_value", parameterToString(localVarOptionals.StringValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.BytesValue.IsSet() { localVarQueryParams.Add("bytes_value", parameterToString(localVarOptionals.BytesValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Uint32Value.IsSet() { localVarQueryParams.Add("uint32_value", parameterToString(localVarOptionals.Uint32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.EnumValue.IsSet() { localVarQueryParams.Add("enum_value", parameterToString(localVarOptionals.EnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.PathEnumValue.IsSet() { localVarQueryParams.Add("path_enum_value", parameterToString(localVarOptionals.PathEnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedPathEnumValue.IsSet() { localVarQueryParams.Add("nested_path_enum_value", parameterToString(localVarOptionals.NestedPathEnumValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sfixed32Value.IsSet() { localVarQueryParams.Add("sfixed32_value", parameterToString(localVarOptionals.Sfixed32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sfixed64Value.IsSet() { localVarQueryParams.Add("sfixed64_value", parameterToString(localVarOptionals.Sfixed64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sint32Value.IsSet() { localVarQueryParams.Add("sint32_value", parameterToString(localVarOptionals.Sint32Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Sint64Value.IsSet() { localVarQueryParams.Add("sint64_value", parameterToString(localVarOptionals.Sint64Value.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedStringValue.IsSet() { localVarQueryParams.Add("repeated_string_value", parameterToString(localVarOptionals.RepeatedStringValue.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.OneofString.IsSet() { localVarQueryParams.Add("oneof_string", parameterToString(localVarOptionals.OneofString.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NonConventionalNameValue.IsSet() { localVarQueryParams.Add("nonConventionalNameValue", parameterToString(localVarOptionals.NonConventionalNameValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.TimestampValue.IsSet() { localVarQueryParams.Add("timestamp_value", parameterToString(localVarOptionals.TimestampValue.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedEnumValue.IsSet() { localVarQueryParams.Add("repeated_enum_value", parameterToString(localVarOptionals.RepeatedEnumValue.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.RepeatedEnumAnnotation.IsSet() { localVarQueryParams.Add("repeated_enum_annotation", parameterToString(localVarOptionals.RepeatedEnumAnnotation.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.EnumValueAnnotation.IsSet() { localVarQueryParams.Add("enum_value_annotation", parameterToString(localVarOptionals.EnumValueAnnotation.Value(), "")) } if localVarOptionals != nil && localVarOptionals.RepeatedStringAnnotation.IsSet() { localVarQueryParams.Add("repeated_string_annotation", parameterToString(localVarOptionals.RepeatedStringAnnotation.Value(), "multi")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationName.IsSet() { localVarQueryParams.Add("nested_annotation.name", parameterToString(localVarOptionals.NestedAnnotationName.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationAmount.IsSet() { localVarQueryParams.Add("nested_annotation.amount", parameterToString(localVarOptionals.NestedAnnotationAmount.Value(), "")) } if localVarOptionals != nil && localVarOptionals.NestedAnnotationOk.IsSet() { localVarQueryParams.Add("nested_annotation.ok", parameterToString(localVarOptionals.NestedAnnotationOk.Value(), "")) } if localVarOptionals != nil && localVarOptionals.Int64OverrideType.IsSet() { localVarQueryParams.Add("int64_override_type", parameterToString(localVarOptionals.Int64OverrideType.Value(), "")) } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param pathRepeatedFloatValue repeated values. they are comma-separated in path * @param pathRepeatedDoubleValue * @param pathRepeatedInt64Value * @param pathRepeatedUint64Value * @param pathRepeatedInt32Value * @param pathRepeatedFixed64Value * @param pathRepeatedFixed32Value * @param pathRepeatedBoolValue * @param pathRepeatedStringValue * @param pathRepeatedBytesValue * @param pathRepeatedUint32Value * @param pathRepeatedEnumValue * @param pathRepeatedSfixed32Value * @param pathRepeatedSfixed64Value * @param pathRepeatedSint32Value * @param pathRepeatedSint64Value @return ExamplepbABitOfEverythingRepeated */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetRepeatedQuery(ctx context.Context, pathRepeatedFloatValue []float32, pathRepeatedDoubleValue []float64, pathRepeatedInt64Value []string, pathRepeatedUint64Value []string, pathRepeatedInt32Value []int32, pathRepeatedFixed64Value []string, pathRepeatedFixed32Value []int64, pathRepeatedBoolValue []bool, pathRepeatedStringValue []string, pathRepeatedBytesValue []string, pathRepeatedUint32Value []int64, pathRepeatedEnumValue []string, pathRepeatedSfixed32Value []int32, pathRepeatedSfixed64Value []string, pathRepeatedSint32Value []int32, pathRepeatedSint64Value []string) (ExamplepbABitOfEverythingRepeated, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverythingRepeated ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything_repeated/{path_repeated_float_value}/{path_repeated_double_value}/{path_repeated_int64_value}/{path_repeated_uint64_value}/{path_repeated_int32_value}/{path_repeated_fixed64_value}/{path_repeated_fixed32_value}/{path_repeated_bool_value}/{path_repeated_string_value}/{path_repeated_bytes_value}/{path_repeated_uint32_value}/{path_repeated_enum_value}/{path_repeated_sfixed32_value}/{path_repeated_sfixed64_value}/{path_repeated_sint32_value}/{path_repeated_sint64_value}" localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_float_value"+"}", fmt.Sprintf("%v", pathRepeatedFloatValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_double_value"+"}", fmt.Sprintf("%v", pathRepeatedDoubleValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_int64_value"+"}", fmt.Sprintf("%v", pathRepeatedInt64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_uint64_value"+"}", fmt.Sprintf("%v", pathRepeatedUint64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_int32_value"+"}", fmt.Sprintf("%v", pathRepeatedInt32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_fixed64_value"+"}", fmt.Sprintf("%v", pathRepeatedFixed64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_fixed32_value"+"}", fmt.Sprintf("%v", pathRepeatedFixed32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_bool_value"+"}", fmt.Sprintf("%v", pathRepeatedBoolValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_string_value"+"}", fmt.Sprintf("%v", pathRepeatedStringValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_bytes_value"+"}", fmt.Sprintf("%v", pathRepeatedBytesValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_uint32_value"+"}", fmt.Sprintf("%v", pathRepeatedUint32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_enum_value"+"}", fmt.Sprintf("%v", pathRepeatedEnumValue), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_sfixed32_value"+"}", fmt.Sprintf("%v", pathRepeatedSfixed32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_sfixed64_value"+"}", fmt.Sprintf("%v", pathRepeatedSfixed64Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_sint32_value"+"}", fmt.Sprintf("%v", pathRepeatedSint32Value), -1) localVarPath = strings.Replace(localVarPath, "{"+"path_repeated_sint64_value"+"}", fmt.Sprintf("%v", pathRepeatedSint64Value), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if len(pathRepeatedFloatValue) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedFloatValue must have at least 1 elements") } if len(pathRepeatedDoubleValue) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedDoubleValue must have at least 1 elements") } if len(pathRepeatedInt64Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedInt64Value must have at least 1 elements") } if len(pathRepeatedUint64Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedUint64Value must have at least 1 elements") } if len(pathRepeatedInt32Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedInt32Value must have at least 1 elements") } if len(pathRepeatedFixed64Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedFixed64Value must have at least 1 elements") } if len(pathRepeatedFixed32Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedFixed32Value must have at least 1 elements") } if len(pathRepeatedBoolValue) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedBoolValue must have at least 1 elements") } if len(pathRepeatedStringValue) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedStringValue must have at least 1 elements") } if len(pathRepeatedBytesValue) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedBytesValue must have at least 1 elements") } if len(pathRepeatedUint32Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedUint32Value must have at least 1 elements") } if len(pathRepeatedEnumValue) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedEnumValue must have at least 1 elements") } if len(pathRepeatedSfixed32Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedSfixed32Value must have at least 1 elements") } if len(pathRepeatedSfixed64Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedSfixed64Value must have at least 1 elements") } if len(pathRepeatedSint32Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedSint32Value must have at least 1 elements") } if len(pathRepeatedSint64Value) < 1 { return localVarReturnValue, nil, reportError("pathRepeatedSint64Value must have at least 1 elements") } // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverythingRepeated err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid @return ExamplepbABitOfEverything */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceLookup(ctx context.Context, uuid string) (ExamplepbABitOfEverything, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/{uuid}" localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", fmt.Sprintf("%v", uuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return string */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteResponseContentType(ctx context.Context) (string, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue string ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/overwriteresponsecontenttype" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/text"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param name * @param body @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServicePostWithEmptyBody(ctx context.Context, name string, body ExamplepbBody) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/postwithemptybody/{name}" localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceTimeout(ctx context.Context) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/timeout" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param uuid * @param body @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdate(ctx context.Context, uuid string, body ExamplepbABitOfEverything) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything/{uuid}" localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", fmt.Sprintf("%v", uuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param abeUuid * @param body @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV2(ctx context.Context, abeUuid string, body ExamplepbABitOfEverything) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/a_bit_of_everything/{abe.uuid}" localVarPath = strings.Replace(localVarPath, "{"+"abe.uuid"+"}", fmt.Sprintf("%v", abeUuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param abeUuid * @param body @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV22(ctx context.Context, abeUuid string, body ExamplepbABitOfEverything) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2/example/a_bit_of_everything/{abe.uuid}" localVarPath = strings.Replace(localVarPath, "{"+"abe.uuid"+"}", fmt.Sprintf("%v", abeUuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil } /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param abeUuid * @param body @return interface{} */ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceUpdateV23(ctx context.Context, abeUuid string, body ExamplepbUpdateV2Request) (interface{}, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte localVarReturnValue interface{} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/v2a/example/a_bit_of_everything/{abe.uuid}" localVarPath = strings.Replace(localVarPath, "{"+"abe.uuid"+"}", fmt.Sprintf("%v", abeUuid), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { var key string if auth.Prefix != "" { key = auth.Prefix + " " + auth.Key } else { key = auth.Key } localVarHeaderParams["X-API-Key"] = key } } r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return localVarReturnValue, localVarHttpResponse, err } localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) localVarHttpResponse.Body.Close() if err != nil { return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err == nil { return localVarReturnValue, localVarHttpResponse, err } } if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ body: localVarBody, error: localVarHttpResponse.Status, } if localVarHttpResponse.StatusCode == 200 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 403 { var v interface{} err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 404 { var v string err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 418 { var v ExamplepbNumericEnum err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } if localVarHttpResponse.StatusCode == 0 { var v RuntimeError err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHttpResponse, newErr } newErr.model = v return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, newErr } return localVarReturnValue, localVarHttpResponse, nil }