diff --git a/examples/internal/clients/abe/BUILD.bazel b/examples/internal/clients/abe/BUILD.bazel index 57f5cb2da9e..39a7279e3e9 100644 --- a/examples/internal/clients/abe/BUILD.bazel +++ b/examples/internal/clients/abe/BUILD.bazel @@ -5,6 +5,7 @@ package(default_visibility = ["//visibility:public"]) go_library( name = "abe", srcs = [ + "api_a_bit_of_everything.go", "api_a_bit_of_everything_service.go", "api_camel_case_service_name.go", "api_echo_rpc.go", diff --git a/examples/internal/clients/abe/api/swagger.yaml b/examples/internal/clients/abe/api/swagger.yaml index 0b8f9d79ca5..99b2e05010f 100644 --- a/examples/internal/clients/abe/api/swagger.yaml +++ b/examples/internal/clients/abe/api/swagger.yaml @@ -15,7 +15,7 @@ tags: - name: "echo rpc" description: "Echo Rpc description" x-traitTag: true -- name: "ABitOfEverythingService" +- name: "ABitOfEverything" description: "ABitOfEverythingService description -- which should not be used in\ \ place of the documentation comment!" externalDocs: @@ -1401,7 +1401,7 @@ paths: /v1/example/a_bit_of_everything/query/{uuidName}: get: tags: - - "ABitOfEverythingService" + - "ABitOfEverything" operationId: "ABitOfEverythingService_GetQuery" parameters: - name: "uuidName" @@ -4049,7 +4049,7 @@ paths: $ref: "#/definitions/rpcStatus" delete: tags: - - "ABitOfEverythingService" + - "ABitOfEverything" operationId: "ABitOfEverythingService_Delete" parameters: - name: "uuid" @@ -4869,7 +4869,7 @@ paths: /v2/example/overwriterequestcontenttype: post: tags: - - "ABitOfEverythingService" + - "ABitOfEverything" operationId: "ABitOfEverythingService_OverwriteRequestContentType" consumes: - "application/x-bar-mime" @@ -4909,7 +4909,7 @@ paths: /v2/example/overwriteresponsecontenttype: get: tags: - - "ABitOfEverythingService" + - "ABitOfEverything" operationId: "ABitOfEverythingService_OverwriteResponseContentType" produces: - "application/text" diff --git a/examples/internal/clients/abe/api_a_bit_of_everything.go b/examples/internal/clients/abe/api_a_bit_of_everything.go new file mode 100644 index 00000000000..b914a38663d --- /dev/null +++ b/examples/internal/clients/abe/api_a_bit_of_everything.go @@ -0,0 +1,874 @@ +/* + * 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 ABitOfEverythingApiService service + +/* +ABitOfEverythingApiService + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uuid + +@return interface{} +*/ +func (a *ABitOfEverythingApiService) 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 == 500 { + var v ExamplepbErrorResponse + 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 RpcStatus + 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 +} + +/* +ABitOfEverythingApiService + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uuidName + * @param floatValue Float value field + * @param doubleValue + * @param int64Value + * @param requiredStringViaFieldBehaviorAnnotation mark a field as required in Open API definition + * @param requiredStringField1 + * @param requiredStringField2 + * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields + * @param requiredFieldSchemaJsonNameCustom + * @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 "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 "OneofEmpty" (optional.Interface of map[string]string) - + * @param "OneofString" (optional.String) - + * @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 + * @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 + * @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 + * @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) - + * @param "OutputOnlyStringViaFieldBehaviorAnnotation" (optional.String) - mark a field as readonly in Open API definition + * @param "OptionalStringValue" (optional.String) - + * @param "ProductId" (optional.Interface of []string) - Test openapiv2 generation of repeated fields Only digits are allowed. + * @param "OptionalStringField" (optional.String) - Test openapiv2 generation of required fields with annotation and jsonschema to reproduce + * @param "TrailingOnly" (optional.String) - Trailing only + * @param "TrailingOnlyDot" (optional.String) - Trailing only dot. + * @param "TrailingBoth" (optional.String) - Leading both Trailing both. + * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. + * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + +@return interface{} +*/ + +type ABitOfEverythingServiceGetQueryOpts struct { + SingleNestedName optional.String + SingleNestedAmount optional.Int64 + SingleNestedOk 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 + OneofEmpty optional.Interface + OneofString optional.String + MapValue optional.Interface + MappedStringValue optional.String + MappedNestedValue optional.Interface + 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 + OutputOnlyStringViaFieldBehaviorAnnotation optional.String + OptionalStringValue optional.String + ProductId optional.Interface + OptionalStringField optional.String + TrailingOnly optional.String + TrailingOnlyDot optional.String + TrailingBoth optional.String + TrailingMultiline optional.String + Uuids optional.Interface +} + +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceGetQuery(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, 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/{uuidName}" + localVarPath = strings.Replace(localVarPath, "{"+"uuidName"+"}", fmt.Sprintf("%v", uuidName), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.SingleNestedName.IsSet() { + localVarQueryParams.Add("singleNested.name", parameterToString(localVarOptionals.SingleNestedName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SingleNestedAmount.IsSet() { + localVarQueryParams.Add("singleNested.amount", parameterToString(localVarOptionals.SingleNestedAmount.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SingleNestedOk.IsSet() { + localVarQueryParams.Add("singleNested.ok", parameterToString(localVarOptionals.SingleNestedOk.Value(), "")) + } + localVarQueryParams.Add("floatValue", parameterToString(floatValue, "")) + localVarQueryParams.Add("doubleValue", parameterToString(doubleValue, "")) + localVarQueryParams.Add("int64Value", parameterToString(int64Value, "")) + if localVarOptionals != nil && localVarOptionals.Uint64Value.IsSet() { + localVarQueryParams.Add("uint64Value", parameterToString(localVarOptionals.Uint64Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Int32Value.IsSet() { + localVarQueryParams.Add("int32Value", parameterToString(localVarOptionals.Int32Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Fixed64Value.IsSet() { + localVarQueryParams.Add("fixed64Value", parameterToString(localVarOptionals.Fixed64Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Fixed32Value.IsSet() { + localVarQueryParams.Add("fixed32Value", parameterToString(localVarOptionals.Fixed32Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.BoolValue.IsSet() { + localVarQueryParams.Add("boolValue", parameterToString(localVarOptionals.BoolValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.StringValue.IsSet() { + localVarQueryParams.Add("stringValue", parameterToString(localVarOptionals.StringValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.BytesValue.IsSet() { + localVarQueryParams.Add("bytesValue", parameterToString(localVarOptionals.BytesValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Uint32Value.IsSet() { + localVarQueryParams.Add("uint32Value", parameterToString(localVarOptionals.Uint32Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.EnumValue.IsSet() { + localVarQueryParams.Add("enumValue", parameterToString(localVarOptionals.EnumValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PathEnumValue.IsSet() { + localVarQueryParams.Add("pathEnumValue", parameterToString(localVarOptionals.PathEnumValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.NestedPathEnumValue.IsSet() { + localVarQueryParams.Add("nestedPathEnumValue", parameterToString(localVarOptionals.NestedPathEnumValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sfixed32Value.IsSet() { + localVarQueryParams.Add("sfixed32Value", parameterToString(localVarOptionals.Sfixed32Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sfixed64Value.IsSet() { + localVarQueryParams.Add("sfixed64Value", parameterToString(localVarOptionals.Sfixed64Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sint32Value.IsSet() { + localVarQueryParams.Add("sint32Value", parameterToString(localVarOptionals.Sint32Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sint64Value.IsSet() { + localVarQueryParams.Add("sint64Value", parameterToString(localVarOptionals.Sint64Value.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.RepeatedStringValue.IsSet() { + localVarQueryParams.Add("repeatedStringValue", parameterToString(localVarOptionals.RepeatedStringValue.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.OneofEmpty.IsSet() { + localVarQueryParams.Add("oneofEmpty", parameterToString(localVarOptionals.OneofEmpty.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.OneofString.IsSet() { + localVarQueryParams.Add("oneofString", parameterToString(localVarOptionals.OneofString.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MapValue.IsSet() { + localVarQueryParams.Add("mapValue", parameterToString(localVarOptionals.MapValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MappedStringValue.IsSet() { + localVarQueryParams.Add("mappedStringValue", parameterToString(localVarOptionals.MappedStringValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MappedNestedValue.IsSet() { + localVarQueryParams.Add("mappedNestedValue", parameterToString(localVarOptionals.MappedNestedValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.NonConventionalNameValue.IsSet() { + localVarQueryParams.Add("nonConventionalNameValue", parameterToString(localVarOptionals.NonConventionalNameValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TimestampValue.IsSet() { + localVarQueryParams.Add("timestampValue", parameterToString(localVarOptionals.TimestampValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.RepeatedEnumValue.IsSet() { + localVarQueryParams.Add("repeatedEnumValue", parameterToString(localVarOptionals.RepeatedEnumValue.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.RepeatedEnumAnnotation.IsSet() { + localVarQueryParams.Add("repeatedEnumAnnotation", parameterToString(localVarOptionals.RepeatedEnumAnnotation.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.EnumValueAnnotation.IsSet() { + localVarQueryParams.Add("enumValueAnnotation", parameterToString(localVarOptionals.EnumValueAnnotation.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.RepeatedStringAnnotation.IsSet() { + localVarQueryParams.Add("repeatedStringAnnotation", parameterToString(localVarOptionals.RepeatedStringAnnotation.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.NestedAnnotationName.IsSet() { + localVarQueryParams.Add("nestedAnnotation.name", parameterToString(localVarOptionals.NestedAnnotationName.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.NestedAnnotationAmount.IsSet() { + localVarQueryParams.Add("nestedAnnotation.amount", parameterToString(localVarOptionals.NestedAnnotationAmount.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.NestedAnnotationOk.IsSet() { + localVarQueryParams.Add("nestedAnnotation.ok", parameterToString(localVarOptionals.NestedAnnotationOk.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Int64OverrideType.IsSet() { + localVarQueryParams.Add("int64OverrideType", parameterToString(localVarOptionals.Int64OverrideType.Value(), "")) + } + localVarQueryParams.Add("requiredStringViaFieldBehaviorAnnotation", parameterToString(requiredStringViaFieldBehaviorAnnotation, "")) + if localVarOptionals != nil && localVarOptionals.OutputOnlyStringViaFieldBehaviorAnnotation.IsSet() { + localVarQueryParams.Add("outputOnlyStringViaFieldBehaviorAnnotation", parameterToString(localVarOptionals.OutputOnlyStringViaFieldBehaviorAnnotation.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.OptionalStringValue.IsSet() { + localVarQueryParams.Add("optionalStringValue", parameterToString(localVarOptionals.OptionalStringValue.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ProductId.IsSet() { + localVarQueryParams.Add("productId", parameterToString(localVarOptionals.ProductId.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.OptionalStringField.IsSet() { + localVarQueryParams.Add("optionalStringField", parameterToString(localVarOptionals.OptionalStringField.Value(), "")) + } + localVarQueryParams.Add("requiredStringField1", parameterToString(requiredStringField1, "")) + localVarQueryParams.Add("requiredStringField2", parameterToString(requiredStringField2, "")) + localVarQueryParams.Add("required_field_behavior_json_name_custom", parameterToString(requiredFieldBehaviorJsonNameCustom, "")) + localVarQueryParams.Add("required_field_schema_json_name_custom", parameterToString(requiredFieldSchemaJsonNameCustom, "")) + if localVarOptionals != nil && localVarOptionals.TrailingOnly.IsSet() { + localVarQueryParams.Add("trailingOnly", parameterToString(localVarOptionals.TrailingOnly.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TrailingOnlyDot.IsSet() { + localVarQueryParams.Add("trailingOnlyDot", parameterToString(localVarOptionals.TrailingOnlyDot.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TrailingBoth.IsSet() { + localVarQueryParams.Add("trailingBoth", parameterToString(localVarOptionals.TrailingBoth.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.TrailingMultiline.IsSet() { + localVarQueryParams.Add("trailingMultiline", parameterToString(localVarOptionals.TrailingMultiline.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Uuids.IsSet() { + localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) + } + // 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 == 500 { + var v ExamplepbErrorResponse + 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 RpcStatus + 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 +} + +/* +ABitOfEverythingApiService + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body + +@return interface{} +*/ +func (a *ABitOfEverythingApiService) ABitOfEverythingServiceOverwriteRequestContentType(ctx context.Context, 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/overwriterequestcontenttype" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/x-bar-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 == 500 { + var v ExamplepbErrorResponse + 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 RpcStatus + 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 +} + +/* +ABitOfEverythingApiService + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + +@return string +*/ +func (a *ABitOfEverythingApiService) 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 == 500 { + var v ExamplepbErrorResponse + 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 RpcStatus + 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 +} diff --git a/examples/internal/clients/abe/api_a_bit_of_everything_service.go b/examples/internal/clients/abe/api_a_bit_of_everything_service.go index 8153f7f8c3b..6b736033e99 100644 --- a/examples/internal/clients/abe/api_a_bit_of_everything_service.go +++ b/examples/internal/clients/abe/api_a_bit_of_everything_service.go @@ -3208,162 +3208,6 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceDeepPathEcho( 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 == 500 { - var v ExamplepbErrorResponse - 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 RpcStatus - 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(). @@ -4420,797 +4264,107 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetMessageWit /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param uuidName - * @param floatValue Float value field - * @param doubleValue - * @param int64Value - * @param requiredStringViaFieldBehaviorAnnotation mark a field as required in Open API definition - * @param requiredStringField1 - * @param requiredStringField2 - * @param requiredFieldBehaviorJsonNameCustom Test openapiv2 handling of required json_name fields - * @param requiredFieldSchemaJsonNameCustom - * @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 "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 "OneofEmpty" (optional.Interface of map[string]string) - - * @param "OneofString" (optional.String) - - * @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 - * @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 - * @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18 - * @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) - - * @param "OutputOnlyStringViaFieldBehaviorAnnotation" (optional.String) - mark a field as readonly in Open API definition - * @param "OptionalStringValue" (optional.String) - - * @param "ProductId" (optional.Interface of []string) - Test openapiv2 generation of repeated fields Only digits are allowed. - * @param "OptionalStringField" (optional.String) - Test openapiv2 generation of required fields with annotation and jsonschema to reproduce - * @param "TrailingOnly" (optional.String) - Trailing only - * @param "TrailingOnlyDot" (optional.String) - Trailing only dot. - * @param "TrailingBoth" (optional.String) - Leading both Trailing both. - * @param "TrailingMultiline" (optional.String) - Leading multiline This is an example of a multi-line comment. Trailing multiline. - * @param "Uuids" (optional.Interface of []string) - Specify a custom format of repeated field items + * @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 interface{} +@return ExamplepbABitOfEverythingRepeated */ - -type ABitOfEverythingServiceGetQueryOpts struct { - SingleNestedName optional.String - SingleNestedAmount optional.Int64 - SingleNestedOk 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 - OneofEmpty optional.Interface - OneofString optional.String - MapValue optional.Interface - MappedStringValue optional.String - MappedNestedValue optional.Interface - 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 - OutputOnlyStringViaFieldBehaviorAnnotation optional.String - OptionalStringValue optional.String - ProductId optional.Interface - OptionalStringField optional.String - TrailingOnly optional.String - TrailingOnlyDot optional.String - TrailingBoth optional.String - TrailingMultiline optional.String - Uuids optional.Interface -} - -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceGetQuery(ctx context.Context, uuidName string, floatValue float32, doubleValue float64, int64Value string, requiredStringViaFieldBehaviorAnnotation string, requiredStringField1 string, requiredStringField2 string, requiredFieldBehaviorJsonNameCustom string, requiredFieldSchemaJsonNameCustom string, 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/{uuidName}" - localVarPath = strings.Replace(localVarPath, "{"+"uuidName"+"}", fmt.Sprintf("%v", uuidName), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if localVarOptionals != nil && localVarOptionals.SingleNestedName.IsSet() { - localVarQueryParams.Add("singleNested.name", parameterToString(localVarOptionals.SingleNestedName.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.SingleNestedAmount.IsSet() { - localVarQueryParams.Add("singleNested.amount", parameterToString(localVarOptionals.SingleNestedAmount.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.SingleNestedOk.IsSet() { - localVarQueryParams.Add("singleNested.ok", parameterToString(localVarOptionals.SingleNestedOk.Value(), "")) - } - localVarQueryParams.Add("floatValue", parameterToString(floatValue, "")) - localVarQueryParams.Add("doubleValue", parameterToString(doubleValue, "")) - localVarQueryParams.Add("int64Value", parameterToString(int64Value, "")) - if localVarOptionals != nil && localVarOptionals.Uint64Value.IsSet() { - localVarQueryParams.Add("uint64Value", parameterToString(localVarOptionals.Uint64Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Int32Value.IsSet() { - localVarQueryParams.Add("int32Value", parameterToString(localVarOptionals.Int32Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Fixed64Value.IsSet() { - localVarQueryParams.Add("fixed64Value", parameterToString(localVarOptionals.Fixed64Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Fixed32Value.IsSet() { - localVarQueryParams.Add("fixed32Value", parameterToString(localVarOptionals.Fixed32Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.BoolValue.IsSet() { - localVarQueryParams.Add("boolValue", parameterToString(localVarOptionals.BoolValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.StringValue.IsSet() { - localVarQueryParams.Add("stringValue", parameterToString(localVarOptionals.StringValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.BytesValue.IsSet() { - localVarQueryParams.Add("bytesValue", parameterToString(localVarOptionals.BytesValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Uint32Value.IsSet() { - localVarQueryParams.Add("uint32Value", parameterToString(localVarOptionals.Uint32Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.EnumValue.IsSet() { - localVarQueryParams.Add("enumValue", parameterToString(localVarOptionals.EnumValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.PathEnumValue.IsSet() { - localVarQueryParams.Add("pathEnumValue", parameterToString(localVarOptionals.PathEnumValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NestedPathEnumValue.IsSet() { - localVarQueryParams.Add("nestedPathEnumValue", parameterToString(localVarOptionals.NestedPathEnumValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Sfixed32Value.IsSet() { - localVarQueryParams.Add("sfixed32Value", parameterToString(localVarOptionals.Sfixed32Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Sfixed64Value.IsSet() { - localVarQueryParams.Add("sfixed64Value", parameterToString(localVarOptionals.Sfixed64Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Sint32Value.IsSet() { - localVarQueryParams.Add("sint32Value", parameterToString(localVarOptionals.Sint32Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Sint64Value.IsSet() { - localVarQueryParams.Add("sint64Value", parameterToString(localVarOptionals.Sint64Value.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.RepeatedStringValue.IsSet() { - localVarQueryParams.Add("repeatedStringValue", parameterToString(localVarOptionals.RepeatedStringValue.Value(), "multi")) - } - if localVarOptionals != nil && localVarOptionals.OneofEmpty.IsSet() { - localVarQueryParams.Add("oneofEmpty", parameterToString(localVarOptionals.OneofEmpty.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.OneofString.IsSet() { - localVarQueryParams.Add("oneofString", parameterToString(localVarOptionals.OneofString.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.MapValue.IsSet() { - localVarQueryParams.Add("mapValue", parameterToString(localVarOptionals.MapValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.MappedStringValue.IsSet() { - localVarQueryParams.Add("mappedStringValue", parameterToString(localVarOptionals.MappedStringValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.MappedNestedValue.IsSet() { - localVarQueryParams.Add("mappedNestedValue", parameterToString(localVarOptionals.MappedNestedValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NonConventionalNameValue.IsSet() { - localVarQueryParams.Add("nonConventionalNameValue", parameterToString(localVarOptionals.NonConventionalNameValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.TimestampValue.IsSet() { - localVarQueryParams.Add("timestampValue", parameterToString(localVarOptionals.TimestampValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.RepeatedEnumValue.IsSet() { - localVarQueryParams.Add("repeatedEnumValue", parameterToString(localVarOptionals.RepeatedEnumValue.Value(), "multi")) - } - if localVarOptionals != nil && localVarOptionals.RepeatedEnumAnnotation.IsSet() { - localVarQueryParams.Add("repeatedEnumAnnotation", parameterToString(localVarOptionals.RepeatedEnumAnnotation.Value(), "multi")) - } - if localVarOptionals != nil && localVarOptionals.EnumValueAnnotation.IsSet() { - localVarQueryParams.Add("enumValueAnnotation", parameterToString(localVarOptionals.EnumValueAnnotation.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.RepeatedStringAnnotation.IsSet() { - localVarQueryParams.Add("repeatedStringAnnotation", parameterToString(localVarOptionals.RepeatedStringAnnotation.Value(), "multi")) - } - if localVarOptionals != nil && localVarOptionals.NestedAnnotationName.IsSet() { - localVarQueryParams.Add("nestedAnnotation.name", parameterToString(localVarOptionals.NestedAnnotationName.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NestedAnnotationAmount.IsSet() { - localVarQueryParams.Add("nestedAnnotation.amount", parameterToString(localVarOptionals.NestedAnnotationAmount.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.NestedAnnotationOk.IsSet() { - localVarQueryParams.Add("nestedAnnotation.ok", parameterToString(localVarOptionals.NestedAnnotationOk.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Int64OverrideType.IsSet() { - localVarQueryParams.Add("int64OverrideType", parameterToString(localVarOptionals.Int64OverrideType.Value(), "")) - } - localVarQueryParams.Add("requiredStringViaFieldBehaviorAnnotation", parameterToString(requiredStringViaFieldBehaviorAnnotation, "")) - if localVarOptionals != nil && localVarOptionals.OutputOnlyStringViaFieldBehaviorAnnotation.IsSet() { - localVarQueryParams.Add("outputOnlyStringViaFieldBehaviorAnnotation", parameterToString(localVarOptionals.OutputOnlyStringViaFieldBehaviorAnnotation.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.OptionalStringValue.IsSet() { - localVarQueryParams.Add("optionalStringValue", parameterToString(localVarOptionals.OptionalStringValue.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.ProductId.IsSet() { - localVarQueryParams.Add("productId", parameterToString(localVarOptionals.ProductId.Value(), "multi")) - } - if localVarOptionals != nil && localVarOptionals.OptionalStringField.IsSet() { - localVarQueryParams.Add("optionalStringField", parameterToString(localVarOptionals.OptionalStringField.Value(), "")) - } - localVarQueryParams.Add("requiredStringField1", parameterToString(requiredStringField1, "")) - localVarQueryParams.Add("requiredStringField2", parameterToString(requiredStringField2, "")) - localVarQueryParams.Add("required_field_behavior_json_name_custom", parameterToString(requiredFieldBehaviorJsonNameCustom, "")) - localVarQueryParams.Add("required_field_schema_json_name_custom", parameterToString(requiredFieldSchemaJsonNameCustom, "")) - if localVarOptionals != nil && localVarOptionals.TrailingOnly.IsSet() { - localVarQueryParams.Add("trailingOnly", parameterToString(localVarOptionals.TrailingOnly.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.TrailingOnlyDot.IsSet() { - localVarQueryParams.Add("trailingOnlyDot", parameterToString(localVarOptionals.TrailingOnlyDot.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.TrailingBoth.IsSet() { - localVarQueryParams.Add("trailingBoth", parameterToString(localVarOptionals.TrailingBoth.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.TrailingMultiline.IsSet() { - localVarQueryParams.Add("trailingMultiline", parameterToString(localVarOptionals.TrailingMultiline.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Uuids.IsSet() { - localVarQueryParams.Add("uuids", parameterToString(localVarOptionals.Uuids.Value(), "multi")) - } - // 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 == 500 { - var v ExamplepbErrorResponse - 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 RpcStatus - 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/{pathRepeatedFloatValue}/{pathRepeatedDoubleValue}/{pathRepeatedInt64Value}/{pathRepeatedUint64Value}/{pathRepeatedInt32Value}/{pathRepeatedFixed64Value}/{pathRepeatedFixed32Value}/{pathRepeatedBoolValue}/{pathRepeatedStringValue}/{pathRepeatedBytesValue}/{pathRepeatedUint32Value}/{pathRepeatedEnumValue}/{pathRepeatedSfixed32Value}/{pathRepeatedSfixed64Value}/{pathRepeatedSint32Value}/{pathRepeatedSint64Value}" - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedFloatValue"+"}", fmt.Sprintf("%v", pathRepeatedFloatValue), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedDoubleValue"+"}", fmt.Sprintf("%v", pathRepeatedDoubleValue), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedInt64Value"+"}", fmt.Sprintf("%v", pathRepeatedInt64Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedUint64Value"+"}", fmt.Sprintf("%v", pathRepeatedUint64Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedInt32Value"+"}", fmt.Sprintf("%v", pathRepeatedInt32Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedFixed64Value"+"}", fmt.Sprintf("%v", pathRepeatedFixed64Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedFixed32Value"+"}", fmt.Sprintf("%v", pathRepeatedFixed32Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedBoolValue"+"}", fmt.Sprintf("%v", pathRepeatedBoolValue), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedStringValue"+"}", fmt.Sprintf("%v", pathRepeatedStringValue), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedBytesValue"+"}", fmt.Sprintf("%v", pathRepeatedBytesValue), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedUint32Value"+"}", fmt.Sprintf("%v", pathRepeatedUint32Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedEnumValue"+"}", fmt.Sprintf("%v", pathRepeatedEnumValue), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSfixed32Value"+"}", fmt.Sprintf("%v", pathRepeatedSfixed32Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSfixed64Value"+"}", fmt.Sprintf("%v", pathRepeatedSfixed64Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSint32Value"+"}", fmt.Sprintf("%v", pathRepeatedSint32Value), -1) - localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSint64Value"+"}", 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 == 500 { - var v ExamplepbErrorResponse - 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 RpcStatus - 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 - ) +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/{uuid}" - localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", fmt.Sprintf("%v", uuid), -1) + localVarPath := a.client.cfg.BasePath + "/v1/example/a_bit_of_everything_repeated/{pathRepeatedFloatValue}/{pathRepeatedDoubleValue}/{pathRepeatedInt64Value}/{pathRepeatedUint64Value}/{pathRepeatedInt32Value}/{pathRepeatedFixed64Value}/{pathRepeatedFixed32Value}/{pathRepeatedBoolValue}/{pathRepeatedStringValue}/{pathRepeatedBytesValue}/{pathRepeatedUint32Value}/{pathRepeatedEnumValue}/{pathRepeatedSfixed32Value}/{pathRepeatedSfixed64Value}/{pathRepeatedSint32Value}/{pathRepeatedSint64Value}" + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedFloatValue"+"}", fmt.Sprintf("%v", pathRepeatedFloatValue), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedDoubleValue"+"}", fmt.Sprintf("%v", pathRepeatedDoubleValue), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedInt64Value"+"}", fmt.Sprintf("%v", pathRepeatedInt64Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedUint64Value"+"}", fmt.Sprintf("%v", pathRepeatedUint64Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedInt32Value"+"}", fmt.Sprintf("%v", pathRepeatedInt32Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedFixed64Value"+"}", fmt.Sprintf("%v", pathRepeatedFixed64Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedFixed32Value"+"}", fmt.Sprintf("%v", pathRepeatedFixed32Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedBoolValue"+"}", fmt.Sprintf("%v", pathRepeatedBoolValue), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedStringValue"+"}", fmt.Sprintf("%v", pathRepeatedStringValue), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedBytesValue"+"}", fmt.Sprintf("%v", pathRepeatedBytesValue), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedUint32Value"+"}", fmt.Sprintf("%v", pathRepeatedUint32Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedEnumValue"+"}", fmt.Sprintf("%v", pathRepeatedEnumValue), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSfixed32Value"+"}", fmt.Sprintf("%v", pathRepeatedSfixed32Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSfixed64Value"+"}", fmt.Sprintf("%v", pathRepeatedSfixed64Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSint32Value"+"}", fmt.Sprintf("%v", pathRepeatedSint32Value), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pathRepeatedSint64Value"+"}", fmt.Sprintf("%v", pathRepeatedSint64Value), -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 + if len(pathRepeatedFloatValue) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedFloatValue must have at least 1 elements") } - - // 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 len(pathRepeatedDoubleValue) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedDoubleValue must have at least 1 elements") } - 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 - - } + if len(pathRepeatedInt64Value) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedInt64Value must have at least 1 elements") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err + if len(pathRepeatedUint64Value) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedUint64Value must have at least 1 elements") } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarReturnValue, localVarHttpResponse, err + if len(pathRepeatedInt32Value) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedInt32Value must have at least 1 elements") } - - localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) - localVarHttpResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHttpResponse, err + if len(pathRepeatedFixed64Value) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedFixed64Value must have at least 1 elements") } - - 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 len(pathRepeatedFixed32Value) < 1 { + return localVarReturnValue, nil, reportError("pathRepeatedFixed32Value must have at least 1 elements") } - - 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 == 500 { - var v ExamplepbErrorResponse - 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 RpcStatus - 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 + 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") } - - 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 interface{} -*/ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteRequestContentType(ctx context.Context, 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/overwriterequestcontenttype" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHttpContentTypes := []string{"application/x-bar-mime"} + localVarHttpContentTypes := []string{"application/json", "application/x-foo-mime"} // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) @@ -5226,8 +4380,6 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteRequ if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - // body params - localVarPostBody = &body if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -5272,7 +4424,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteRequ } if localVarHttpResponse.StatusCode == 200 { - var v interface{} + var v ExamplepbABitOfEverythingRepeated err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() @@ -5346,20 +4498,22 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteRequ /* ABitOfEverythingServiceApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uuid -@return string +@return ExamplepbABitOfEverything */ -func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteResponseContentType(ctx context.Context) (string, *http.Response, error) { +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 string + localVarReturnValue ExamplepbABitOfEverything ) // create path and map variables - localVarPath := a.client.cfg.BasePath + "/v2/example/overwriteresponsecontenttype" + 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{} @@ -5375,7 +4529,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteResp } // to determine the Accept header - localVarHttpHeaderAccepts := []string{"application/text"} + localVarHttpHeaderAccepts := []string{"application/json", "application/x-foo-mime"} // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) @@ -5426,7 +4580,7 @@ func (a *ABitOfEverythingServiceApiService) ABitOfEverythingServiceOverwriteResp } if localVarHttpResponse.StatusCode == 200 { - var v string + var v ExamplepbABitOfEverything err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); if err != nil { newErr.error = err.Error() diff --git a/examples/internal/clients/abe/client.go b/examples/internal/clients/abe/client.go index 8552ff007bc..22eb067bda1 100644 --- a/examples/internal/clients/abe/client.go +++ b/examples/internal/clients/abe/client.go @@ -46,6 +46,8 @@ type APIClient struct { // API Services + ABitOfEverythingApi *ABitOfEverythingApiService + ABitOfEverythingServiceApi *ABitOfEverythingServiceApiService CamelCaseServiceNameApi *CamelCaseServiceNameApiService @@ -71,6 +73,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.ABitOfEverythingApi = (*ABitOfEverythingApiService)(&c.common) c.ABitOfEverythingServiceApi = (*ABitOfEverythingServiceApiService)(&c.common) c.CamelCaseServiceNameApi = (*CamelCaseServiceNameApiService)(&c.common) c.EchoRpcApi = (*EchoRpcApiService)(&c.common) diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.pb.go b/examples/internal/proto/examplepb/a_bit_of_everything.pb.go index 3488471ece9..bce03dd007d 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.pb.go +++ b/examples/internal/proto/examplepb/a_bit_of_everything.pb.go @@ -2275,7 +2275,7 @@ var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDesc = [ 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x10, 0x01, 0x2a, 0x2d, 0x0a, 0x11, 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x5f, 0x63, 0x61, 0x73, 0x65, 0x5f, 0x30, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x65, 0x10, - 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x10, 0x01, 0x32, 0xd3, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x10, 0x01, 0x32, 0xe5, 0x37, 0x0a, 0x17, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8c, 0x04, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, @@ -2709,147 +2709,148 @@ var file_examples_internal_proto_examplepb_a_bit_of_everything_proto_rawDesc = [ 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x74, 0x79, - 0x70, 0x65, 0x1a, 0xbf, 0x01, 0x92, 0x41, 0xbb, 0x01, 0x12, 0x66, 0x41, 0x42, 0x69, 0x74, 0x4f, - 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x2d, - 0x2d, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, - 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x21, 0x1a, 0x51, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x6f, - 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, - 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x32, 0x6a, 0x0a, 0x14, 0x63, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x52, 0x0a, 0x05, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, - 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x32, 0x5e, 0x0a, 0x1c, 0x41, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x3e, 0x0a, 0x0a, 0x4e, 0x6f, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x32, 0xd5, 0x01, 0x0a, 0x10, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc0, 0x01, 0x0a, 0x09, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, - 0x6e, 0x75, 0x6d, 0x12, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x70, 0x65, 0x1a, 0xd1, 0x01, 0x92, 0x41, 0xcd, 0x01, 0x0a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, + 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x66, 0x41, 0x42, 0x69, + 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x2d, 0x2d, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x21, 0x1a, 0x51, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, + 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x45, 0x63, 0x68, 0x6f, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, + 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x32, 0x6a, 0x0a, 0x14, 0x63, 0x61, 0x6d, 0x65, 0x6c, 0x43, + 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x52, + 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, + 0x11, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x32, 0x5e, 0x0a, 0x1c, 0x41, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x6f, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x4e, 0x6f, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x00, 0x32, 0xd5, 0x01, 0x0a, 0x10, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, 0x6e, 0x75, 0x6d, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc0, 0x01, 0x0a, 0x09, 0x53, 0x6e, 0x61, 0x6b, + 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x40, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, 0x6e, 0x75, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, - 0x12, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x6e, - 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x77, 0x68, 0x6f, 0x7d, 0x2f, 0x7b, 0x77, 0x68, 0x61, 0x74, 0x7d, - 0x2f, 0x7b, 0x77, 0x68, 0x65, 0x72, 0x65, 0x7d, 0x42, 0xcf, 0x0c, 0x5a, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x92, 0x41, 0xfe, 0x0b, 0x12, 0xf0, 0x01, 0x0a, - 0x13, 0x41, 0x20, 0x42, 0x69, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x22, 0x58, 0x0a, 0x14, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2e, 0x68, 0x74, - 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x10, 0x6e, 0x6f, - 0x6e, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x58, - 0x0a, 0x14, 0x42, 0x53, 0x44, 0x20, 0x33, 0x2d, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x20, 0x4c, - 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, - 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, - 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, - 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x3a, 0x20, 0x0a, - 0x15, 0x78, 0x2d, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x2d, 0x73, 0x6f, 0x6d, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x1a, 0x05, 0x79, 0x61, 0x64, 0x64, 0x61, 0x2a, - 0x03, 0x01, 0x02, 0x04, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x3a, 0x10, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, - 0x3a, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, - 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, 0x33, 0x12, - 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, - 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, - 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, - 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, - 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, - 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x52, 0x57, 0x0a, 0x03, 0x34, 0x31, 0x38, 0x12, 0x50, - 0x0a, 0x0d, 0x49, 0x27, 0x6d, 0x20, 0x61, 0x20, 0x74, 0x65, 0x61, 0x70, 0x6f, 0x74, 0x2e, 0x12, - 0x3f, 0x0a, 0x3d, 0x1a, 0x3b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, - 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, 0x75, 0x6d, - 0x52, 0x9b, 0x02, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x93, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x3f, 0x1a, 0x3d, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0xbf, 0x01, 0x0a, - 0x10, 0x58, 0x2d, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x49, - 0x64, 0x12, 0xaa, 0x01, 0x0a, 0x2b, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, 0x66, 0x6f, - 0x72, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x12, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x1a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x32, - 0x26, 0x22, 0x32, 0x34, 0x33, 0x38, 0x61, 0x63, 0x33, 0x63, 0x2d, 0x33, 0x37, 0x65, 0x62, 0x2d, - 0x34, 0x39, 0x30, 0x32, 0x2d, 0x61, 0x64, 0x65, 0x66, 0x2d, 0x65, 0x64, 0x31, 0x36, 0x62, 0x34, - 0x34, 0x33, 0x31, 0x30, 0x33, 0x30, 0x22, 0x6a, 0x45, 0x5e, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, - 0x46, 0x5d, 0x7b, 0x38, 0x7d, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x34, - 0x7d, 0x2d, 0x34, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, 0x7d, 0x2d, 0x5b, - 0x38, 0x39, 0x41, 0x42, 0x5d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, 0x7d, - 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x31, 0x32, 0x7d, 0x24, 0x5a, 0x97, - 0x03, 0x0a, 0xaa, 0x01, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, - 0x12, 0x9b, 0x01, 0x08, 0x02, 0x1a, 0x09, 0x58, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, 0x65, 0x79, - 0x20, 0x02, 0x4a, 0x60, 0x0a, 0x1e, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x2d, 0x61, - 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x72, 0x12, 0x3e, 0x2a, 0x3c, 0x0a, 0x29, 0x0a, 0x1c, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x54, 0x74, 0x6c, 0x49, - 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x09, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x4e, 0x40, 0x0a, 0x0f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x07, 0x1a, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x4a, 0x28, 0x0a, 0x1c, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x53, 0x6e, 0x61, 0x6b, 0x65, 0x45, 0x6e, + 0x75, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x28, 0x12, 0x26, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, + 0x73, 0x6e, 0x61, 0x6b, 0x65, 0x2f, 0x7b, 0x77, 0x68, 0x6f, 0x7d, 0x2f, 0x7b, 0x77, 0x68, 0x61, + 0x74, 0x7d, 0x2f, 0x7b, 0x77, 0x68, 0x65, 0x72, 0x65, 0x7d, 0x42, 0xcf, 0x0c, 0x5a, 0x4b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, + 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x73, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x92, 0x41, 0xfe, 0x0b, 0x12, 0xf0, + 0x01, 0x0a, 0x13, 0x41, 0x20, 0x42, 0x69, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x45, 0x76, 0x65, 0x72, + 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x22, 0x58, 0x0a, 0x14, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2e, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x10, + 0x6e, 0x6f, 0x6e, 0x65, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x2a, 0x58, 0x0a, 0x14, 0x42, 0x53, 0x44, 0x20, 0x33, 0x2d, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, + 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, + 0x63, 0x2d, 0x65, 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, + 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x3a, + 0x20, 0x0a, 0x15, 0x78, 0x2d, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x2d, 0x73, + 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x07, 0x1a, 0x05, 0x79, 0x61, 0x64, 0x64, + 0x61, 0x2a, 0x03, 0x01, 0x02, 0x04, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x32, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, + 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x16, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x78, 0x2d, 0x66, 0x6f, 0x6f, 0x2d, 0x6d, 0x69, 0x6d, 0x65, 0x52, 0x50, 0x0a, 0x03, 0x34, 0x30, + 0x33, 0x12, 0x49, 0x0a, 0x47, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, + 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x3b, 0x0a, 0x03, + 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, + 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, + 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x52, 0x57, 0x0a, 0x03, 0x34, 0x31, 0x38, + 0x12, 0x50, 0x0a, 0x0d, 0x49, 0x27, 0x6d, 0x20, 0x61, 0x20, 0x74, 0x65, 0x61, 0x70, 0x6f, 0x74, + 0x2e, 0x12, 0x3f, 0x0a, 0x3d, 0x1a, 0x3b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, + 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, 0x2e, 0x4e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x45, 0x6e, + 0x75, 0x6d, 0x52, 0x9b, 0x02, 0x0a, 0x03, 0x35, 0x30, 0x30, 0x12, 0x93, 0x02, 0x0a, 0x0c, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x3f, 0x1a, + 0x3d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x70, 0x62, + 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0xbf, + 0x01, 0x0a, 0x10, 0x58, 0x2d, 0x43, 0x6f, 0x72, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2d, 0x49, 0x64, 0x12, 0xaa, 0x01, 0x0a, 0x2b, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x73, 0x12, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x1a, 0x04, 0x75, 0x75, 0x69, + 0x64, 0x32, 0x26, 0x22, 0x32, 0x34, 0x33, 0x38, 0x61, 0x63, 0x33, 0x63, 0x2d, 0x33, 0x37, 0x65, + 0x62, 0x2d, 0x34, 0x39, 0x30, 0x32, 0x2d, 0x61, 0x64, 0x65, 0x66, 0x2d, 0x65, 0x64, 0x31, 0x36, + 0x62, 0x34, 0x34, 0x33, 0x31, 0x30, 0x33, 0x30, 0x22, 0x6a, 0x45, 0x5e, 0x5b, 0x30, 0x2d, 0x39, + 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x38, 0x7d, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, + 0x7b, 0x34, 0x7d, 0x2d, 0x34, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x33, 0x7d, + 0x2d, 0x5b, 0x38, 0x39, 0x41, 0x42, 0x5d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, + 0x33, 0x7d, 0x2d, 0x5b, 0x30, 0x2d, 0x39, 0x41, 0x2d, 0x46, 0x5d, 0x7b, 0x31, 0x32, 0x7d, 0x24, + 0x5a, 0x97, 0x03, 0x0a, 0xaa, 0x01, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, + 0x74, 0x68, 0x12, 0x9b, 0x01, 0x08, 0x02, 0x1a, 0x09, 0x58, 0x2d, 0x41, 0x50, 0x49, 0x2d, 0x4b, + 0x65, 0x79, 0x20, 0x02, 0x4a, 0x60, 0x0a, 0x1e, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x2d, 0x61, 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, 0x74, 0x68, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x1a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x0a, 0x0f, - 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, 0x01, 0x0a, - 0xd6, 0x01, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0xcb, 0x01, 0x08, 0x03, 0x28, - 0x04, 0x32, 0x23, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x3a, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, 0x74, - 0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x7f, 0x0a, 0x43, 0x0a, 0x05, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x12, 0x3a, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, - 0x61, 0x6e, 0x64, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, - 0x76, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x1a, - 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x12, 0x12, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x72, - 0x65, 0x61, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a, 0x1c, 0x0a, 0x05, 0x77, 0x72, - 0x69, 0x74, 0x65, 0x12, 0x13, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, 0x70, - 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, 0x42, 0x61, - 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x62, 0x29, 0x0a, 0x0e, 0x0a, 0x0a, 0x41, - 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x17, 0x0a, 0x06, 0x4f, - 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x0d, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x0a, 0x05, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x6a, 0x32, 0x0a, 0x08, 0x65, 0x63, 0x68, 0x6f, 0x20, 0x72, 0x70, 0x63, - 0x12, 0x14, 0x45, 0x63, 0x68, 0x6f, 0x20, 0x52, 0x70, 0x63, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x10, 0x0a, 0x0a, 0x78, 0x2d, 0x74, 0x72, 0x61, 0x69, - 0x74, 0x54, 0x61, 0x67, 0x12, 0x02, 0x20, 0x01, 0x72, 0x49, 0x0a, 0x17, 0x4d, 0x6f, 0x72, 0x65, - 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, 0x63, 0x6f, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, - 0x77, 0x61, 0x79, 0x7a, 0x28, 0x0a, 0x17, 0x78, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x62, 0x61, 0x7a, 0x2d, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x0d, - 0x32, 0x0b, 0x0a, 0x05, 0x1a, 0x03, 0x6f, 0x6e, 0x65, 0x0a, 0x02, 0x20, 0x01, 0x7a, 0x1b, 0x0a, - 0x12, 0x78, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, - 0x66, 0x6f, 0x6f, 0x12, 0x05, 0x1a, 0x03, 0x62, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x3e, 0x2a, 0x3c, 0x0a, 0x29, 0x0a, 0x1c, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x54, 0x74, + 0x6c, 0x49, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x09, 0x11, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x4e, 0x40, 0x0a, 0x0f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x07, 0x1a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4a, 0x28, 0x0a, 0x1c, 0x78, 0x2d, 0x61, 0x6d, 0x61, 0x7a, + 0x6f, 0x6e, 0x2d, 0x61, 0x70, 0x69, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x61, 0x75, + 0x74, 0x68, 0x74, 0x79, 0x70, 0x65, 0x12, 0x08, 0x1a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, + 0x0a, 0x0f, 0x0a, 0x09, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x02, 0x08, + 0x01, 0x0a, 0xd6, 0x01, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0xcb, 0x01, 0x08, + 0x03, 0x28, 0x04, 0x32, 0x23, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x3a, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x61, + 0x75, 0x74, 0x68, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x7f, 0x0a, 0x43, 0x0a, 0x05, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x3a, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x72, 0x65, 0x61, + 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x0a, 0x1a, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x12, 0x12, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a, 0x1c, 0x0a, 0x05, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x12, 0x13, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x62, 0x1f, 0x0a, 0x0e, 0x0a, 0x0a, + 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x0d, 0x0a, 0x09, + 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x62, 0x29, 0x0a, 0x0e, 0x0a, + 0x0a, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x00, 0x0a, 0x17, 0x0a, + 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x0d, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x0a, + 0x05, 0x77, 0x72, 0x69, 0x74, 0x65, 0x6a, 0x32, 0x0a, 0x08, 0x65, 0x63, 0x68, 0x6f, 0x20, 0x72, + 0x70, 0x63, 0x12, 0x14, 0x45, 0x63, 0x68, 0x6f, 0x20, 0x52, 0x70, 0x63, 0x20, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x10, 0x0a, 0x0a, 0x78, 0x2d, 0x74, 0x72, + 0x61, 0x69, 0x74, 0x54, 0x61, 0x67, 0x12, 0x02, 0x20, 0x01, 0x72, 0x49, 0x0a, 0x17, 0x4d, 0x6f, + 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x67, 0x52, 0x50, 0x43, 0x2d, 0x47, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x65, + 0x63, 0x6f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x7a, 0x28, 0x0a, 0x17, 0x78, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2d, 0x62, 0x61, 0x7a, 0x2d, 0x6c, 0x69, 0x73, 0x74, + 0x12, 0x0d, 0x32, 0x0b, 0x0a, 0x05, 0x1a, 0x03, 0x6f, 0x6e, 0x65, 0x0a, 0x02, 0x20, 0x01, 0x7a, + 0x1b, 0x0a, 0x12, 0x78, 0x2d, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x2d, 0x66, 0x6f, 0x6f, 0x12, 0x05, 0x1a, 0x03, 0x62, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.proto b/examples/internal/proto/examplepb/a_bit_of_everything.proto index a40b5abb47b..324a9505729 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.proto +++ b/examples/internal/proto/examplepb/a_bit_of_everything.proto @@ -495,6 +495,7 @@ message UpdateBookRequest { // proto messages and URL templates are still processed correctly. service ABitOfEverythingService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = { + name: "ABitOfEverything" description: "ABitOfEverythingService description -- which should not be used in place of the documentation comment!" external_docs: { url: "/~https://github.com/grpc-ecosystem/grpc-gateway"; diff --git a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json index 159d072fbb1..333cdc3fddc 100644 --- a/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json +++ b/examples/internal/proto/examplepb/a_bit_of_everything.swagger.json @@ -21,7 +21,7 @@ "x-traitTag": true }, { - "name": "ABitOfEverythingService", + "name": "ABitOfEverything", "description": "ABitOfEverythingService description -- which should not be used in place of the documentation comment!", "externalDocs": { "description": "Find out more about EchoService", @@ -2003,7 +2003,7 @@ } ], "tags": [ - "ABitOfEverythingService" + "ABitOfEverything" ], "deprecated": true, "security": [], @@ -4711,7 +4711,7 @@ } ], "tags": [ - "ABitOfEverythingService" + "ABitOfEverything" ], "security": [ { @@ -6615,7 +6615,7 @@ } ], "tags": [ - "ABitOfEverythingService" + "ABitOfEverything" ], "consumes": [ "application/x-bar-mime" @@ -6663,7 +6663,7 @@ } }, "tags": [ - "ABitOfEverythingService" + "ABitOfEverything" ], "produces": [ "application/text" diff --git a/protoc-gen-openapiv2/internal/genopenapi/template.go b/protoc-gen-openapiv2/internal/genopenapi/template.go index 5fe42c2b0d8..c1d2ec97aae 100644 --- a/protoc-gen-openapiv2/internal/genopenapi/template.go +++ b/protoc-gen-openapiv2/internal/genopenapi/template.go @@ -1108,6 +1108,9 @@ func renderServiceTags(services []*descriptor.Service, reg *descriptor.Registry) tag.ExternalDocs.Description = goTemplateComments(opts.ExternalDocs.Description, svc, reg) } } + if opts.GetName() != "" { + tag.Name = opts.GetName() + } } tags = append(tags, tag) } @@ -1521,6 +1524,11 @@ func renderServices(services []*descriptor.Service, paths *openapiPathsObject, r panic(err) } + svcOpts, err := getServiceOpenAPIOption(reg, svc) + if err != nil { + grpclog.Error(err) + return err + } opts, err := getMethodOpenAPIOption(reg, meth) if opts != nil { if err != nil { @@ -1539,6 +1547,8 @@ func renderServices(services []*descriptor.Service, paths *openapiPathsObject, r if len(opts.Tags) > 0 { operationObject.Tags = make([]string, len(opts.Tags)) copy(operationObject.Tags, opts.Tags) + } else if svcOpts.GetName() != "" { + operationObject.Tags = []string{svcOpts.GetName()} } if opts.OperationId != "" { operationObject.OperationID = opts.OperationId diff --git a/protoc-gen-openapiv2/internal/genopenapi/template_test.go b/protoc-gen-openapiv2/internal/genopenapi/template_test.go index d6635d678da..1ae15850f3a 100644 --- a/protoc-gen-openapiv2/internal/genopenapi/template_test.go +++ b/protoc-gen-openapiv2/internal/genopenapi/template_test.go @@ -6354,6 +6354,10 @@ func TestTagsWithGoTemplate(t *testing.T) { Name: "Service with my_key", Description: "the my_value", }, + { + Name: "service tag", + Description: "ExampleService!", + }, } if !reflect.DeepEqual(actual.Tags, expectedTags) { t.Errorf("Expected tags %+v, not %+v", expectedTags, actual.Tags)