diff --git a/bin/configs/go-experimental-go-petstore-oas2.yaml b/bin/configs/go-experimental-go-petstore-oas2.yaml deleted file mode 100644 index 5542bedcf33..00000000000 --- a/bin/configs/go-experimental-go-petstore-oas2.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: go-experimental -outputDir: samples/client/petstore/go-experimental/go-petstore -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/go-experimental -additionalProperties: - packageName: petstore - generateInterfaces: true diff --git a/bin/configs/go-experimental-go-petstore.yaml b/bin/configs/go-experimental-go-petstore.yaml deleted file mode 100644 index ca3e95e80ec..00000000000 --- a/bin/configs/go-experimental-go-petstore.yaml +++ /dev/null @@ -1,9 +0,0 @@ -generatorName: go-experimental -outputDir: samples/openapi3/client/petstore/go-experimental/go-petstore -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml -templateDir: modules/openapi-generator/src/main/resources/go-experimental -additionalProperties: - enumClassPrefix: "true" - packageName: petstore - disallowAdditionalPropertiesIfNotPresent: false - generateInterfaces: true diff --git a/bin/configs/go-experimental-extensions-x-auth-id-alias.yaml b/bin/configs/go-extensions-x-auth-id-alias.yaml similarity index 67% rename from bin/configs/go-experimental-extensions-x-auth-id-alias.yaml rename to bin/configs/go-extensions-x-auth-id-alias.yaml index 517b6fe83d7..5c3ab87b367 100644 --- a/bin/configs/go-experimental-extensions-x-auth-id-alias.yaml +++ b/bin/configs/go-extensions-x-auth-id-alias.yaml @@ -1,6 +1,6 @@ -generatorName: go-experimental +generatorName: go outputDir: samples/openapi3/client/extensions/x-auth-id-alias/go-experimental inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml -templateDir: modules/openapi-generator/src/main/resources/go-experimental +templateDir: modules/openapi-generator/src/main/resources/go additionalProperties: packageName: x_auth_id_alias diff --git a/bin/configs/go-petstore-oas2.yaml b/bin/configs/go-petstore-oas2.yaml index 848899598a6..18cb77a9c25 100644 --- a/bin/configs/go-petstore-oas2.yaml +++ b/bin/configs/go-petstore-oas2.yaml @@ -4,3 +4,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/go additionalProperties: packageName: petstore + generateInterfaces: true diff --git a/bin/configs/go-petstore-withXml.yaml b/bin/configs/go-petstore-withXml.yaml deleted file mode 100644 index 618d59e016b..00000000000 --- a/bin/configs/go-petstore-withXml.yaml +++ /dev/null @@ -1,9 +0,0 @@ -generatorName: go -outputDir: samples/client/petstore/go/go-petstore-withXml -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/go -additionalProperties: - packageName: petstore - withXml: "true" - withGoCodegenComment: "true" - generateInterfaces: true diff --git a/bin/configs/go-petstore.yaml b/bin/configs/go-petstore.yaml index aefc71b9011..6d78e55f1c9 100644 --- a/bin/configs/go-petstore.yaml +++ b/bin/configs/go-petstore.yaml @@ -1,7 +1,9 @@ generatorName: go outputDir: samples/openapi3/client/petstore/go/go-petstore -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml templateDir: modules/openapi-generator/src/main/resources/go additionalProperties: enumClassPrefix: "true" packageName: petstore + disallowAdditionalPropertiesIfNotPresent: false + generateInterfaces: true diff --git a/docs/generators.md b/docs/generators.md index 45fb3721dc7..f6432781a54 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -29,7 +29,7 @@ The following generators are available: * [erlang-proper](generators/erlang-proper.md) * [flash-deprecated (deprecated)](generators/flash-deprecated.md) * [go](generators/go.md) -* [go-experimental (experimental)](generators/go-experimental.md) +* [go-deprecated (deprecated)](generators/go-deprecated.md) * [groovy](generators/groovy.md) * [haskell-http-client](generators/haskell-http-client.md) * [java](generators/java.md) diff --git a/docs/generators/go-deprecated.md b/docs/generators/go-deprecated.md new file mode 100644 index 00000000000..7e8619c889a --- /dev/null +++ b/docs/generators/go-deprecated.md @@ -0,0 +1,211 @@ +--- +title: Config Options for go-deprecated +sidebar_label: go-deprecated +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|enumClassPrefix|Prefix enum with class name| |false| +|generateInterfaces|Generate interfaces for api classes| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|isGoSubmodule|whether the generated Go module is a submodule| |false| +|packageName|Go package name (convention: lowercase).| |openapi| +|packageVersion|Go package version.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| +|withAWSV4Signature|whether to include AWS v4 signature support| |false| +|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default in GitHub PRs and diffs| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | + + +## LANGUAGE PRIMITIVES + + + +## RESERVED WORDS + + + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✓|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/go.md b/docs/generators/go.md index 6a8ad90d7f1..fa747087f0a 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -5,6 +5,7 @@ sidebar_label: go | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|disallowAdditionalPropertiesIfNotPresent|Specify the behavior when the 'additionalProperties' keyword is not present in the OAS document. If false: the 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. If true: when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.This setting is currently ignored for OAS 2.0 documents: 1) When the 'additionalProperties' keyword is not present in a 2.0 schema, additional properties are NOT allowed. 2) Boolean values of the 'additionalProperties' keyword are ignored. It's as if additional properties are NOT allowed.Note: the root cause are issues #1369 and #1371, which must be resolved in the swagger-parser project.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
when the 'additionalProperties' keyword is not present in a schema, the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. Note: this mode is not compliant with the JSON schema specification. This is the original openapi-generator behavior.
|true| |enumClassPrefix|Prefix enum with class name| |false| |generateInterfaces|Generate interfaces for api classes| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| @@ -13,6 +14,7 @@ sidebar_label: go |packageVersion|Go package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| +|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |false| |withAWSV4Signature|whether to include AWS v4 signature support| |false| |withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default in GitHub PRs and diffs| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index c64bfa64f81..6636de057d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -631,7 +631,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } } - if (this instanceof GoClientExperimentalCodegen && model.isEnum) { + if (this instanceof GoClientCodegen && model.isEnum) { imports.add(createMapping("import", "fmt")); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 4f2dbf0fbee..5b5aafa4679 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -17,30 +17,37 @@ package org.openapitools.codegen.languages; -import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.CodegenType; -import org.openapitools.codegen.SupportingFile; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; -import java.util.EnumSet; +import java.util.*; + +import static org.openapitools.codegen.utils.StringUtils.camelize; public class GoClientCodegen extends AbstractGoCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(GoClientCodegen.class); - protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; - protected boolean isGoSubmodule = false; public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; public static final String WITH_XML = "withXml"; public static final String STRUCT_PREFIX = "structPrefix"; public static final String WITH_AWSV4_SIGNATURE = "withAWSV4Signature"; public static final String GENERATE_INTERFACES = "generateInterfaces"; + protected String goImportAlias = "openapiclient"; + protected boolean isGoSubmodule = false; + protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup public GoClientCodegen() { super(); @@ -74,15 +81,16 @@ public class GoClientCodegen extends AbstractGoCodegen { ) ); - outputFolder = "generated-code/go"; - modelTemplateFiles.put("model.mustache", ".go"); - apiTemplateFiles.put("api.mustache", ".go"); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.STABLE).build(); + outputFolder = "generated-code/go"; + embeddedTemplateDir = templateDir = "go"; + usesOptionals = false; + + apiTemplateFiles.put("api.mustache", ".go"); modelDocTemplateFiles.put("model_doc.mustache", ".md"); apiDocTemplateFiles.put("api_doc.mustache", ".md"); - embeddedTemplateDir = templateDir = "go"; - // default HIDE_GENERATION_TIMESTAMP to true hideGenerationTimestamp = Boolean.TRUE; @@ -99,10 +107,66 @@ public class GoClientCodegen extends AbstractGoCodegen { CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC) .defaultValue(Boolean.FALSE.toString())); + + cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false")); + // option to change how we process + set the data in the 'additionalProperties' keyword. + CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); + Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); + disallowAdditionalPropertiesIfNotPresentOpts.put("false", + "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); + disallowAdditionalPropertiesIfNotPresentOpts.put("true", + "when the 'additionalProperties' keyword is not present in a schema, " + + "the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. " + + "Note: this mode is not compliant with the JSON schema specification. " + + "This is the original openapi-generator behavior."); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + this.setDisallowAdditionalPropertiesIfNotPresent(true); + } + + /** + * Configures a friendly name for the generator. This will be used by the + * generator to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "go"; + } + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String toGetter(String name) { + return "Get" + getterAndSetterCapitalize(name); + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a Go client library."; } @Override public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); super.processOpts(); if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { @@ -126,17 +190,6 @@ public class GoClientCodegen extends AbstractGoCodegen { modelPackage = packageName; apiPackage = packageName; - supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go")); - supportingFiles.add(new SupportingFile("client.mustache", "", "client.go")); - supportingFiles.add(new SupportingFile("response.mustache", "", "response.go")); - supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod")); - supportingFiles.add(new SupportingFile("go.sum", "", "go.sum")); - supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); - if (additionalProperties.containsKey(WITH_GO_CODEGEN_COMMENT)) { setWithGoCodegenComment(Boolean.parseBoolean(additionalProperties.get(WITH_GO_CODEGEN_COMMENT).toString())); additionalProperties.put(WITH_GO_CODEGEN_COMMENT, withGoCodegenComment); @@ -171,39 +224,63 @@ public class GoClientCodegen extends AbstractGoCodegen { setGenerateInterfaces(Boolean.parseBoolean(additionalProperties.get(GENERATE_INTERFACES).toString())); additionalProperties.put(GENERATE_INTERFACES, generateInterfaces); } + + // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + List authMethods = fromSecurity(securitySchemeMap); + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { + supportingFiles.add(new SupportingFile("signing.mustache", "", "signing.go")); + } + + if (additionalProperties.containsKey("goImportAlias")) { + setGoImportAlias(additionalProperties.get("goImportAlias").toString()); + } else { + additionalProperties.put("goImportAlias", goImportAlias); + } + + if (additionalProperties.containsKey(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)) { + setUseOneOfDiscriminatorLookup(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)); + } else { + additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, getUseOneOfDiscriminatorLookup()); + } + + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.valueOf(additionalProperties + .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); + } + + supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go")); + supportingFiles.add(new SupportingFile("client.mustache", "", "client.go")); + supportingFiles.add(new SupportingFile("response.mustache", "", "response.go")); + supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod")); + supportingFiles.add(new SupportingFile("go.sum", "", "go.sum")); + supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go")); } - /** - * Configures the type of generator. - * - * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType - */ - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; + public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { + this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; } - /** - * Configures a friendly name for the generator. This will be used by the generator - * to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "go"; + public boolean getUseOneOfDiscriminatorLookup() { + return this.useOneOfDiscriminatorLookup; } - /** - * Returns human-friendly help for the generator. Provide the consumer with help - * tips, parameters here - * - * @return A string value for the help message - */ - @Override - public String getHelp() { - return "Generates a Go client library (beta)."; + public void setGoImportAlias(String goImportAlias) { + this.goImportAlias = goImportAlias; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + public void setIsGoSubmodule(boolean isGoSubmodule) { + this.isGoSubmodule = isGoSubmodule; } /** @@ -240,12 +317,267 @@ public class GoClientCodegen extends AbstractGoCodegen { return toApiName(name); } - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; + + @Override + public String toModelName(String name) { + // underscoring would also lowercase the whole name, thus losing acronyms which are in capitals + return camelize(toModel(name, false)); } - public void setIsGoSubmodule(boolean isGoSubmodule) { - this.isGoSubmodule = isGoSubmodule; + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return name + '_'; } + @Override + public String toEnumDefaultValue(String value, String datatype) { + String prefix = ""; + if (enumClassPrefix) { + prefix = datatype.toUpperCase(Locale.ROOT) + "_"; + } + return prefix + value; + } + + @Override + public void updateCodegenPropertyEnum(CodegenProperty var) { + // make sure the inline enums have plain defaults (e.g. string, int, float) + String enumDefault = null; + if (var.isEnum && var.defaultValue != null) { + enumDefault = var.defaultValue; + } + super.updateCodegenPropertyEnum(var); + if (var.isEnum && enumDefault != null) { + var.defaultValue = enumDefault; + } + } + + @Override + public String toDefaultValue(Schema p) { + p = ModelUtils.getReferencedSchema(this.openAPI, p); + if (ModelUtils.isStringSchema(p)) { + if (p.getDefault() != null) { + return "\"" + escapeText((String) p.getDefault()) + "\""; + } + return null; + } + + return super.toDefaultValue(p); + } + + @Override + public CodegenProperty fromProperty(String name, Schema p) { + CodegenProperty prop = super.fromProperty(name, p); + String cc = camelize(prop.name, true); + if (isReservedWord(cc)) { + cc = escapeReservedWord(cc); + } + prop.nameInCamelCase = cc; + return prop; + } + + @Override + public Map postProcessModels(Map objs) { + // The superclass determines the list of required golang imports. The actual list of imports + // depends on which types are used, some of which are changed in the code below (but then preserved + // and used through x-go-base-type in templates). So super.postProcessModels + // must be invoked at the beginning of this method. + objs = super.postProcessModels(objs); + + List> imports = (List>) objs.get("imports"); + + List> models = (List>) objs.get("models"); + for (Map m : models) { + Object v = m.get("model"); + if (v instanceof CodegenModel) { + CodegenModel model = (CodegenModel) v; + if (model.isEnum) { + continue; + } + + for (CodegenProperty param : model.vars) { + param.vendorExtensions.put("x-go-base-type", param.dataType); + if (!param.isNullable || param.isMapContainer || param.isListContainer || + param.isFreeFormObject || param.isAnyType) { + continue; + } + if (param.isDateTime) { + // Note this could have been done by adding the following line in processOpts(), + // however, we only want to represent the DateTime object as NullableTime if + // it's marked as nullable in the spec. + // typeMapping.put("DateTime", "NullableTime"); + param.dataType = "NullableTime"; + } else { + param.dataType = "Nullable" + Character.toUpperCase(param.dataType.charAt(0)) + + param.dataType.substring(1); + } + } + + // additional import for different cases + // oneOf + if (model.oneOf != null && !model.oneOf.isEmpty()) { + imports.add(createMapping("import", "fmt")); + } + + // anyOf + if (model.anyOf != null && !model.anyOf.isEmpty()) { + imports.add(createMapping("import", "fmt")); + } + + // additionalProperties: true and parent + if (model.isAdditionalPropertiesTrue && model.parent != null && Boolean.FALSE.equals(model.isMapModel)) { + imports.add(createMapping("import", "reflect")); + imports.add(createMapping("import", "strings")); + } + + } + } + return objs; + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + objs = super.postProcessOperationsWithModels(objs, allModels); + Map operations = (Map) objs.get("operations"); + HashMap modelMaps = new HashMap(); + HashMap processedModelMaps = new HashMap(); + + for (Object o : allModels) { + HashMap h = (HashMap) o; + CodegenModel m = (CodegenModel) h.get("model"); + modelMaps.put(m.classname, m); + } + + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + for (CodegenParameter p : op.allParams) { + p.vendorExtensions.put("x-go-example", constructExampleCode(p, modelMaps, processedModelMaps)); + } + } + + processedModelMaps.clear(); + for (CodegenOperation operation : operationList) { + for (CodegenParameter cp : operation.allParams) { + cp.vendorExtensions.put("x-go-example", constructExampleCode(cp, modelMaps, processedModelMaps)); + } + } + + return objs; + } + + private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, HashMap processedModelMap) { + if (codegenParameter.isListContainer) { // array + return codegenParameter.dataType + "{" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + "}"; + } else if (codegenParameter.isMapContainer) { + return "map[string]string{ \"Key\" = \"Value\" }"; + } else if (codegenParameter.isPrimitiveType) { // primitive type + if (codegenParameter.isString) { + if (StringUtils.isEmpty(codegenParameter.example)) { + return "\"" + codegenParameter.example + "\""; + } else { + return "\"" + codegenParameter.paramName + "_example\""; + } + } else if (codegenParameter.isBoolean) { // boolean + if (Boolean.parseBoolean(codegenParameter.example)) { + return "true"; + } else { + return "false"; + } + } else if (codegenParameter.isUri) { // URL + return "URL(string: \"https://example.com\")!"; + } else if (codegenParameter.isDateTime || codegenParameter.isDate) { // datetime or date + return "Get-Date"; + } else { // numeric + if (StringUtils.isEmpty(codegenParameter.example)) { + return codegenParameter.example; + } else { + return "987"; + } + } + } else { // model + // look up the model + if (modelMaps.containsKey(codegenParameter.dataType)) { + return constructExampleCode(modelMaps.get(codegenParameter.dataType), modelMaps, processedModelMap); + } else { + //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenParameter.dataType); + return "TODO"; + } + } + } + + private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps, HashMap processedModelMap) { + if (codegenProperty.isListContainer) { // array + return codegenProperty.dataType + "{" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + ")"; + } else if (codegenProperty.isMapContainer) { // map + return "map[string]string{ \"Key\" = \"Value\" }"; + } else if (codegenProperty.isPrimitiveType) { // primitive type + if (codegenProperty.isString) { + if (StringUtils.isEmpty(codegenProperty.example)) { + return "\"" + codegenProperty.example + "\""; + } else { + return "\"" + codegenProperty.name + "_example\""; + } + } else if (codegenProperty.isBoolean) { // boolean + if (Boolean.parseBoolean(codegenProperty.example)) { + return "true"; + } else { + return "false"; + } + } else if (codegenProperty.isUri) { // URL + return "\"https://example.com\")!"; + } else if (codegenProperty.isDateTime || codegenProperty.isDate) { // datetime or date + return "time.Now()"; + } else { // numeric + String example; + if (StringUtils.isEmpty(codegenProperty.example)) { + example = codegenProperty.example; + } else { + example = "123"; + } + + if (codegenProperty.isLong) { + return "int64(" + example + ")"; + } else { + return example; + } + } + } else { + // look up the model + if (modelMaps.containsKey(codegenProperty.dataType)) { + return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps, processedModelMap); + } else { + //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenProperty.dataType); + return "\"TODO\""; + } + } + } + + private String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps, HashMap processedModelMap) { + String example; + + // break infinite recursion. Return, in case a model is already processed in the current context. + String model = codegenModel.name; + if (processedModelMap.containsKey(model)) { + int count = processedModelMap.get(model); + if (count == 1) { + processedModelMap.put(model, 2); + } else if (count == 2) { + return ""; + } else { + throw new RuntimeException("Invalid count when constructing example: " + count); + } + } else { + processedModelMap.put(model, 1); + } + + example = "" + goImportAlias + "." + codegenModel.name + "{"; + List propertyExamples = new ArrayList<>(); + for (CodegenProperty codegenProperty : codegenModel.allVars) { + propertyExamples.add(codegenProperty.name + ": " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); + } + example += StringUtils.join(propertyExamples, ", "); + example += "}"; + return example; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java deleted file mode 100644 index 9ee17ffbaf6..00000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.security.SecurityScheme; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.ProcessUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -import static org.openapitools.codegen.utils.StringUtils.camelize; - -public class GoClientExperimentalCodegen extends GoClientCodegen { - - private static final Logger LOGGER = LoggerFactory.getLogger(GoClientExperimentalCodegen.class); - protected String goImportAlias = "openapiclient"; - protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup - - public GoClientExperimentalCodegen() { - super(); - outputFolder = "generated-code/go-experimental"; - embeddedTemplateDir = templateDir = "go-experimental"; - - usesOptionals = false; - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.EXPERIMENTAL).build(); - - cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false")); - // option to change how we process + set the data in the 'additionalProperties' keyword. - CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, - CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); - Map disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); - disallowAdditionalPropertiesIfNotPresentOpts.put("false", - "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); - disallowAdditionalPropertiesIfNotPresentOpts.put("true", - "when the 'additionalProperties' keyword is not present in a schema, " + - "the value of 'additionalProperties' is automatically set to false, i.e. no additional properties are allowed. " + - "Note: this mode is not compliant with the JSON schema specification. " + - "This is the original openapi-generator behavior."); - disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); - cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); - this.setDisallowAdditionalPropertiesIfNotPresent(true); - } - - /** - * Configures a friendly name for the generator. This will be used by the - * generator to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "go-experimental"; - } - - @Override - public String toGetter(String name) { - return "Get" + getterAndSetterCapitalize(name); - } - - /** - * Returns human-friendly help for the generator. Provide the consumer with help - * tips, parameters here - * - * @return A string value for the help message - */ - @Override - public String getHelp() { - return "Generates a Go client library (experimental and may subject to breaking changes without further notice)."; - } - - @Override - public void processOpts() { - this.setLegacyDiscriminatorBehavior(false); - super.processOpts(); - supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go")); - - // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. - Map securitySchemeMap = openAPI != null ? - (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; - List authMethods = fromSecurity(securitySchemeMap); - if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { - supportingFiles.add(new SupportingFile("signing.mustache", "", "signing.go")); - } - - if (additionalProperties.containsKey("goImportAlias")) { - setGoImportAlias(additionalProperties.get("goImportAlias").toString()); - } else { - additionalProperties.put("goImportAlias", goImportAlias); - } - - if (additionalProperties.containsKey(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)) { - setUseOneOfDiscriminatorLookup(convertPropertyToBooleanAndWriteBack(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP)); - } else { - additionalProperties.put(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, useOneOfDiscriminatorLookup); - } - - if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { - this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.valueOf(additionalProperties - .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); - } - - } - - public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) { - this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup; - } - - public boolean getUseOneOfDiscriminatorLookup() { - return this.useOneOfDiscriminatorLookup; - } - - public void setGoImportAlias(String goImportAlias) { - this.goImportAlias = goImportAlias; - } - - @Override - public String toModelName(String name) { - // underscoring would also lowercase the whole name, thus losing acronyms which are in capitals - return camelize(toModel(name, false)); - } - - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return name + '_'; - } - - @Override - public String toEnumDefaultValue(String value, String datatype) { - String prefix = ""; - if (enumClassPrefix) { - prefix = datatype.toUpperCase(Locale.ROOT) + "_"; - } - return prefix + value; - } - - @Override - public void updateCodegenPropertyEnum(CodegenProperty var) { - // make sure the inline enums have plain defaults (e.g. string, int, float) - String enumDefault = null; - if (var.isEnum && var.defaultValue != null) { - enumDefault = var.defaultValue; - } - super.updateCodegenPropertyEnum(var); - if (var.isEnum && enumDefault != null) { - var.defaultValue = enumDefault; - } - } - - @Override - public String toDefaultValue(Schema p) { - p = ModelUtils.getReferencedSchema(this.openAPI, p); - if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { - return "\"" + escapeText((String) p.getDefault()) + "\""; - } - return null; - } - - return super.toDefaultValue(p); - } - - @Override - public CodegenProperty fromProperty(String name, Schema p) { - CodegenProperty prop = super.fromProperty(name, p); - String cc = camelize(prop.name, true); - if (isReservedWord(cc)) { - cc = escapeReservedWord(cc); - } - prop.nameInCamelCase = cc; - return prop; - } - - @Override - public Map postProcessModels(Map objs) { - // The superclass determines the list of required golang imports. The actual list of imports - // depends on which types are used, some of which are changed in the code below (but then preserved - // and used through x-go-base-type in templates). So super.postProcessModels - // must be invoked at the beginning of this method. - objs = super.postProcessModels(objs); - - List> imports = (List>) objs.get("imports"); - - List> models = (List>) objs.get("models"); - for (Map m : models) { - Object v = m.get("model"); - if (v instanceof CodegenModel) { - CodegenModel model = (CodegenModel) v; - if (model.isEnum) { - continue; - } - - for (CodegenProperty param : model.vars) { - param.vendorExtensions.put("x-go-base-type", param.dataType); - if (!param.isNullable || param.isMapContainer || param.isListContainer || - param.isFreeFormObject || param.isAnyType) { - continue; - } - if (param.isDateTime) { - // Note this could have been done by adding the following line in processOpts(), - // however, we only want to represent the DateTime object as NullableTime if - // it's marked as nullable in the spec. - // typeMapping.put("DateTime", "NullableTime"); - param.dataType = "NullableTime"; - } else { - param.dataType = "Nullable" + Character.toUpperCase(param.dataType.charAt(0)) - + param.dataType.substring(1); - } - } - - // additional import for different cases - // oneOf - if (model.oneOf != null && !model.oneOf.isEmpty()) { - imports.add(createMapping("import", "fmt")); - } - - // anyOf - if (model.anyOf != null && !model.anyOf.isEmpty()) { - imports.add(createMapping("import", "fmt")); - } - - // additionalProperties: true and parent - if (model.isAdditionalPropertiesTrue && model.parent != null && Boolean.FALSE.equals(model.isMapModel)) { - imports.add(createMapping("import", "reflect")); - imports.add(createMapping("import", "strings")); - } - - } - } - return objs; - } - - @Override - public Map postProcessOperationsWithModels(Map objs, List allModels) { - objs = super.postProcessOperationsWithModels(objs, allModels); - Map operations = (Map) objs.get("operations"); - HashMap modelMaps = new HashMap(); - HashMap processedModelMaps = new HashMap(); - - for (Object o : allModels) { - HashMap h = (HashMap) o; - CodegenModel m = (CodegenModel) h.get("model"); - modelMaps.put(m.classname, m); - } - - List operationList = (List) operations.get("operation"); - for (CodegenOperation op : operationList) { - for (CodegenParameter p : op.allParams) { - p.vendorExtensions.put("x-go-example", constructExampleCode(p, modelMaps, processedModelMaps)); - } - } - - processedModelMaps.clear(); - for (CodegenOperation operation : operationList) { - for (CodegenParameter cp : operation.allParams) { - cp.vendorExtensions.put("x-go-example", constructExampleCode(cp, modelMaps, processedModelMaps)); - } - } - - return objs; - } - - private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, HashMap processedModelMap) { - if (codegenParameter.isListContainer) { // array - return codegenParameter.dataType + "{" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + "}"; - } else if (codegenParameter.isMapContainer) { - return "map[string]string{ \"Key\" = \"Value\" }"; - } else if (codegenParameter.isPrimitiveType) { // primitive type - if (codegenParameter.isString) { - if (StringUtils.isEmpty(codegenParameter.example)) { - return "\"" + codegenParameter.example + "\""; - } else { - return "\"" + codegenParameter.paramName + "_example\""; - } - } else if (codegenParameter.isBoolean) { // boolean - if (Boolean.parseBoolean(codegenParameter.example)) { - return "true"; - } else { - return "false"; - } - } else if (codegenParameter.isUri) { // URL - return "URL(string: \"https://example.com\")!"; - } else if (codegenParameter.isDateTime || codegenParameter.isDate) { // datetime or date - return "Get-Date"; - } else { // numeric - if (StringUtils.isEmpty(codegenParameter.example)) { - return codegenParameter.example; - } else { - return "987"; - } - } - } else { // model - // look up the model - if (modelMaps.containsKey(codegenParameter.dataType)) { - return constructExampleCode(modelMaps.get(codegenParameter.dataType), modelMaps, processedModelMap); - } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenParameter.dataType); - return "TODO"; - } - } - } - - private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps, HashMap processedModelMap) { - if (codegenProperty.isListContainer) { // array - return codegenProperty.dataType + "{" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + ")"; - } else if (codegenProperty.isMapContainer) { // map - return "map[string]string{ \"Key\" = \"Value\" }"; - } else if (codegenProperty.isPrimitiveType) { // primitive type - if (codegenProperty.isString) { - if (StringUtils.isEmpty(codegenProperty.example)) { - return "\"" + codegenProperty.example + "\""; - } else { - return "\"" + codegenProperty.name + "_example\""; - } - } else if (codegenProperty.isBoolean) { // boolean - if (Boolean.parseBoolean(codegenProperty.example)) { - return "true"; - } else { - return "false"; - } - } else if (codegenProperty.isUri) { // URL - return "\"https://example.com\")!"; - } else if (codegenProperty.isDateTime || codegenProperty.isDate) { // datetime or date - return "time.Now()"; - } else { // numeric - String example; - if (StringUtils.isEmpty(codegenProperty.example)) { - example = codegenProperty.example; - } else { - example = "123"; - } - - if (codegenProperty.isLong) { - return "int64(" + example + ")"; - } else { - return example; - } - } - } else { - // look up the model - if (modelMaps.containsKey(codegenProperty.dataType)) { - return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps, processedModelMap); - } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenProperty.dataType); - return "\"TODO\""; - } - } - } - - private String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps, HashMap processedModelMap) { - String example; - - // break infinite recursion. Return, in case a model is already processed in the current context. - String model = codegenModel.name; - if (processedModelMap.containsKey(model)) { - int count = processedModelMap.get(model); - if (count == 1) { - processedModelMap.put(model, 2); - } else if (count == 2) { - return ""; - } else { - throw new RuntimeException("Invalid count when constructing example: " + count); - } - } else { - processedModelMap.put(model, 1); - } - - example = "" + goImportAlias + "." + codegenModel.name + "{"; - List propertyExamples = new ArrayList<>(); - for (CodegenProperty codegenProperty : codegenModel.allVars) { - propertyExamples.add(codegenProperty.name + ": " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); - } - example += StringUtils.join(propertyExamples, ", "); - example += "}"; - return example; - } - - -} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoDeprecatedClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoDeprecatedClientCodegen.java new file mode 100644 index 00000000000..bfedaae35cf --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoDeprecatedClientCodegen.java @@ -0,0 +1,255 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.EnumSet; + +public class GoDeprecatedClientCodegen extends AbstractGoCodegen { + + private static final Logger LOGGER = LoggerFactory.getLogger(GoDeprecatedClientCodegen.class); + + protected String packageVersion = "1.0.0"; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + protected boolean isGoSubmodule = false; + public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; + public static final String WITH_XML = "withXml"; + public static final String STRUCT_PREFIX = "structPrefix"; + public static final String WITH_AWSV4_SIGNATURE = "withAWSV4Signature"; + public static final String GENERATE_INTERFACES = "generateInterfaces"; + + public GoDeprecatedClientCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata).stability(Stability.DEPRECATED).build(); + + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) + .securityFeatures(EnumSet.of( + SecurityFeature.BasicAuth, + SecurityFeature.ApiKey, + SecurityFeature.OAuth2_Implicit + )) + .includeGlobalFeatures( + GlobalFeature.ParameterizedServer + ) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects, + GlobalFeature.ParameterStyling + ) + .excludeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism + ) + .includeParameterFeatures( + ParameterFeature.Cookie + ) + .includeClientModificationFeatures( + ClientModificationFeature.BasePath, + ClientModificationFeature.UserAgent + ) + ); + + outputFolder = "generated-code/go-deprecated"; + modelTemplateFiles.put("model.mustache", ".go"); + apiTemplateFiles.put("api.mustache", ".go"); + + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + + embeddedTemplateDir = templateDir = "go-deprecated"; + + // default HIDE_GENERATION_TIMESTAMP to true + hideGenerationTimestamp = Boolean.TRUE; + + cliOptions.add(CliOption.newBoolean(CodegenConstants.IS_GO_SUBMODULE, CodegenConstants.IS_GO_SUBMODULE_DESC)); + cliOptions.add(CliOption.newBoolean(WITH_GO_CODEGEN_COMMENT, "whether to include Go codegen comment to disable Go Lint and collapse by default in GitHub PRs and diffs")); + cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); + cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_CLASS_PREFIX, CodegenConstants.ENUM_CLASS_PREFIX_DESC)); + cliOptions.add(CliOption.newBoolean(STRUCT_PREFIX, "whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts")); + cliOptions.add(CliOption.newBoolean(WITH_AWSV4_SIGNATURE, "whether to include AWS v4 signature support")); + cliOptions.add(CliOption.newBoolean(GENERATE_INTERFACES, "Generate interfaces for api classes")); + + // option to change the order of form/body parameter + cliOptions.add(CliOption.newBoolean( + CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, + CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC) + .defaultValue(Boolean.FALSE.toString())); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } else { + setPackageName("openapi"); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } else { + setPackageVersion("1.0.0"); + } + + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + modelPackage = packageName; + apiPackage = packageName; + + supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go")); + supportingFiles.add(new SupportingFile("client.mustache", "", "client.go")); + supportingFiles.add(new SupportingFile("response.mustache", "", "response.go")); + supportingFiles.add(new SupportingFile("go.mod.mustache", "", "go.mod")); + supportingFiles.add(new SupportingFile("go.sum", "", "go.sum")); + supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); + + if (additionalProperties.containsKey(WITH_GO_CODEGEN_COMMENT)) { + setWithGoCodegenComment(Boolean.parseBoolean(additionalProperties.get(WITH_GO_CODEGEN_COMMENT).toString())); + additionalProperties.put(WITH_GO_CODEGEN_COMMENT, withGoCodegenComment); + } + + if (additionalProperties.containsKey(WITH_AWSV4_SIGNATURE)) { + setWithAWSV4Signature(Boolean.parseBoolean(additionalProperties.get(WITH_AWSV4_SIGNATURE).toString())); + additionalProperties.put(WITH_AWSV4_SIGNATURE, withAWSV4Signature); + } + + if (additionalProperties.containsKey(WITH_XML)) { + setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); + additionalProperties.put(WITH_XML, withXml); + } + + if (additionalProperties.containsKey(CodegenConstants.ENUM_CLASS_PREFIX)) { + setEnumClassPrefix(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_CLASS_PREFIX).toString())); + additionalProperties.put(CodegenConstants.ENUM_CLASS_PREFIX, enumClassPrefix); + } + + if (additionalProperties.containsKey(CodegenConstants.IS_GO_SUBMODULE)) { + setIsGoSubmodule(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.IS_GO_SUBMODULE).toString())); + additionalProperties.put(CodegenConstants.IS_GO_SUBMODULE, isGoSubmodule); + } + + if (additionalProperties.containsKey(STRUCT_PREFIX)) { + setStructPrefix(Boolean.parseBoolean(additionalProperties.get(STRUCT_PREFIX).toString())); + additionalProperties.put(STRUCT_PREFIX, structPrefix); + } + + if (additionalProperties.containsKey(GENERATE_INTERFACES)) { + setGenerateInterfaces(Boolean.parseBoolean(additionalProperties.get(GENERATE_INTERFACES).toString())); + additionalProperties.put(GENERATE_INTERFACES, generateInterfaces); + } + } + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "go-deprecated"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a Go client library (beta). NOTE: this generator has been deprecated. Please use `go` client generator instead."; + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + File.separator; + } + + @Override + public String modelFileFolder() { + return outputFolder + File.separator; + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); + } + + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + public void setIsGoSubmodule(boolean isGoSubmodule) { + this.isGoSubmodule = isGoSubmodule; + } + +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 87020fffa16..9a8d8ad03d2 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -34,7 +34,7 @@ org.openapitools.codegen.languages.FlashClientCodegen org.openapitools.codegen.languages.FsharpFunctionsServerCodegen org.openapitools.codegen.languages.FsharpGiraffeServerCodegen org.openapitools.codegen.languages.GoClientCodegen -org.openapitools.codegen.languages.GoClientExperimentalCodegen +org.openapitools.codegen.languages.GoDeprecatedClientCodegen org.openapitools.codegen.languages.GoServerCodegen org.openapitools.codegen.languages.GoGinServerCodegen org.openapitools.codegen.languages.GraphQLSchemaCodegen diff --git a/modules/openapi-generator/src/main/resources/go-experimental/.travis.yml b/modules/openapi-generator/src/main/resources/go-deprecated/.travis.yml similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/.travis.yml rename to modules/openapi-generator/src/main/resources/go-deprecated/.travis.yml diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache new file mode 100644 index 00000000000..e4e8ffa507d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache @@ -0,0 +1,148 @@ +# Go API client for {{packageName}} + +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +{{#withAWSV4Signature}} +go get github.com/aws/aws-sdk-go/aws +{{/withAWSV4Signature}} +go get golang.org/x/net/context +go get github.com/antihax/optional +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./{{packageName}}" +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}} Endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}} + +## {{{name}}} + +{{#isApiKey}}- **Type**: API key + +Example + +```golang +auth := context.WithValue(context.Background(), {{packageName}}.ContextAPIKey, {{packageName}}.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) +``` + +{{/isApiKey}} +{{#isHttpSignature}} +Not supported. + +{{/isHttpSignature}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), {{packageName}}.ContextBasicAuth, {{packageName}}.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + +{{/isBasicBasic}} +{{#isBasicBearer}}- **Type**: HTTP Bearer token authentication + +Example + +```golang +auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "BEARERTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +{{/isBasicBearer}} +{{#isOAuth}} + +- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} + +Example + +```golang +auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, {{packageName}}.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + +{{/isOAuth}} +{{/authMethods}} + +{{#withAWSV4Signature}} +Example + +```golang +auth := context.WithValue(context.Background(), {{packageName}}.ContextAWSv4, {{packageName}}.AWSv4{ + AccessKey: "ACCESSKEYSTRING", + SecretKey: "SECRETKEYSTRING", +}) +r, err := client.Service.Operation(auth, args) +``` +{{/withAWSV4Signature}} + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache new file mode 100644 index 00000000000..95875da699b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache @@ -0,0 +1,400 @@ +{{>partial_header}} +package {{packageName}} + +{{#operations}} +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + _bytes "bytes" +{{#imports}} "{{import}}" +{{/imports}} +) + +// Linger please +var ( + _ _context.Context +) + +{{#generateInterfaces}} +type {{classname}} interface { +{{#operation}} + + /* + * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} + * + {{#notes}} + * {{notes}} + * + {{/notes}} + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + {{#allParams}} + {{#required}} + * @param {{paramName}}{{#description}} {{{.}}}{{/description}} + {{/required}} + {{/allParams}} + {{#hasOptionalParams}} + * @param optional nil or *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts - Optional Parameters: + {{#allParams}} + {{^required}} + * @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optional-data-type}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}} + {{/required}} + {{/allParams}} + {{/hasOptionalParams}} + {{#returnType}} + * @return {{{returnType}}} + {{/returnType}} + */ + {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) +{{/operation}} +} + +{{/generateInterfaces}} +// {{classname}}Service {{classname}} service +type {{classname}}Service service +{{#operation}} + +{{#hasOptionalParams}} +// {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts Optional parameters for the method '{{{nickname}}}' +type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct { +{{#allParams}} +{{^required}} +{{#isPrimitiveType}} +{{^isBinary}} + {{vendorExtensions.x-export-param-name}} optional.{{vendorExtensions.x-optional-data-type}} +{{/isBinary}} +{{#isBinary}} + {{vendorExtensions.x-export-param-name}} optional.Interface +{{/isBinary}} +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{vendorExtensions.x-export-param-name}} optional.Interface +{{/isPrimitiveType}} +{{/required}} +{{/allParams}} +} + +{{/hasOptionalParams}} +/* + * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} + * +{{#notes}} + * {{notes}} + * +{{/notes}} + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +{{#allParams}} +{{#required}} + * @param {{paramName}}{{#description}} {{{.}}}{{/description}} +{{/required}} +{{/allParams}} +{{#hasOptionalParams}} + * @param optional nil or *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts - Optional Parameters: +{{#allParams}} +{{^required}} + * @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optional-data-type}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}} +{{/required}} +{{/allParams}} +{{/hasOptionalParams}} +{{#returnType}} + * @return {{{returnType}}} +{{/returnType}} + */ +func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.Method{{httpMethod}} + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + {{#returnType}} + localVarReturnValue {{{returnType}}} + {{/returnType}} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}} + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) , -1) + {{/pathParams}} + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + {{#allParams}} + {{#required}} + {{#minItems}} + if len({{paramName}}) < {{minItems}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") + } + {{/minItems}} + {{#maxItems}} + if len({{paramName}}) > {{maxItems}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") + } + {{/maxItems}} + {{#minLength}} + if strlen({{paramName}}) < {{minLength}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") + } + {{/minLength}} + {{#maxLength}} + if strlen({{paramName}}) > {{maxLength}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") + } + {{/maxLength}} + {{#minimum}} + {{#isString}} + {{paramName}}Txt, err := atoi({{paramName}}) + if {{paramName}}Txt < {{minimum}} { + {{/isString}} + {{^isString}} + if {{paramName}} < {{minimum}} { + {{/isString}} + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") + } + {{/minimum}} + {{#maximum}} + {{#isString}} + {{paramName}}Txt, err := atoi({{paramName}}) + if {{paramName}}Txt > {{maximum}} { + {{/isString}} + {{^isString}} + if {{paramName}} > {{maximum}} { + {{/isString}} + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") + } + {{/maximum}} + {{/required}} + {{/allParams}} + + {{#hasQueryParams}} + {{#queryParams}} + {{#required}} + {{#isCollectionFormatMulti}} + { + t:={{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + {{/isCollectionFormatMulti}} + {{/required}} + {{^required}} + if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + {{#isCollectionFormatMulti}} + t:=localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + {{/isCollectionFormatMulti}} + } + {{/required}} + {{/queryParams}} + {{/hasQueryParams}} + // to determine the Content-Type header +{{=<% %>=}} + localVarHTTPContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} +<%={{ }}=%> + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header +{{=<% %>=}} + localVarHTTPHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} +<%={{ }}=%> + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } +{{#hasHeaderParams}} +{{#headerParams}} + {{#required}} + localVarHeaderParams["{{baseName}}"] = parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + {{/required}} + {{^required}} + if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + localVarHeaderParams["{{baseName}}"] = parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + } + {{/required}} +{{/headerParams}} +{{/hasHeaderParams}} +{{#hasFormParams}} +{{#formParams}} +{{#isFile}} + localVarFormFileName = "{{baseName}}" +{{#required}} + localVarFile := {{paramName}} +{{/required}} +{{^required}} + var localVarFile {{dataType}} + if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + localVarFileOk := false + localVarFile, localVarFileOk = localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value().({{dataType}}) + if !localVarFileOk { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} should be {{dataType}}") + } + } +{{/required}} + if localVarFile != nil { + fbs, _ := _ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } +{{/isFile}} +{{^isFile}} +{{#required}} + localVarFormParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) +{{/required}} +{{^required}} +{{#isModel}} + if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + paramJson, err := parameterToJson(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value()) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err + } + localVarFormParams.Add("{{baseName}}", paramJson) + } +{{/isModel}} +{{^isModel}} + if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + localVarFormParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } +{{/isModel}} +{{/required}} +{{/isFile}} +{{/formParams}} +{{/hasFormParams}} +{{#hasBodyParam}} +{{#bodyParams}} + // body params +{{#required}} + localVarPostBody = &{{paramName}} +{{/required}} +{{^required}} + if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + {{#isPrimitiveType}} + localVarPostBody = localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value() + {{/isPrimitiveType}} + {{^isPrimitiveType}} + localVarOptional{{vendorExtensions.x-export-param-name}}, localVarOptional{{vendorExtensions.x-export-param-name}}ok := localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value().({{{dataType}}}) + if !localVarOptional{{vendorExtensions.x-export-param-name}}ok { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} should be {{dataType}}") + } + localVarPostBody = &localVarOptional{{vendorExtensions.x-export-param-name}} + {{/isPrimitiveType}} + } + +{{/required}} +{{/bodyParams}} +{{/hasBodyParam}} +{{#authMethods}} +{{#isApiKey}} +{{^isKeyInCookie}} + 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 + } + {{#isKeyInHeader}} + localVarHeaderParams["{{keyParamName}}"] = key + {{/isKeyInHeader}} + {{#isKeyInQuery}} + localVarQueryParams.Add("{{keyParamName}}", key) + {{/isKeyInQuery}} + } + } +{{/isKeyInCookie}} +{{/isApiKey}} +{{/authMethods}} + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + {{#responses}} + {{#dataType}} + {{^is1xx}} + {{^is2xx}} + {{^wildcard}} + if localVarHTTPResponse.StatusCode == {{{code}}} { + {{/wildcard}} + var v {{{dataType}}} + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + } + newErr.model = v + {{#hasMore}} + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + {{/hasMore}} + {{^wildcard}} + } + {{/wildcard}} + {{/is2xx}} + {{/is1xx}} + {{/dataType}} + {{/responses}} + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + } + + {{#returnType}} + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + } + + {{/returnType}} + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, nil +} +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache new file mode 100644 index 00000000000..5ddad640ca3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache @@ -0,0 +1,59 @@ +# {{invokerPackage}}\{{classname}}{{#description}} + +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{{operationId}}} + +> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}}) + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Required Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/allParams}}{{#allParams}}{{#required}} +**{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} + **optional** | ***{{{nickname}}}Opts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a {{{nickname}}}Opts struct +{{#allParams}}{{#-last}} + +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} +{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}} (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/client.mustache similarity index 92% rename from modules/openapi-generator/src/main/resources/go-experimental/client.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/client.mustache index 76a3cb5df1b..a3723b68602 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/client.mustache @@ -9,6 +9,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "log" "mime/multipart" "net/http" @@ -31,7 +32,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) @@ -46,12 +47,12 @@ type APIClient struct { {{#apis}} {{#operations}} - {{#generateInterfaces}} +{{#generateInterfaces}} {{classname}} {{classname}} - {{/generateInterfaces}} - {{^generateInterfaces}} +{{/generateInterfaces}} +{{^generateInterfaces}} {{classname}} *{{classname}}Service - {{/generateInterfaces}} +{{/generateInterfaces}} {{/operations}} {{/apis}} {{/apiInfo}} @@ -173,9 +174,9 @@ func parameterToJson(obj interface{}) (string, error) { // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } @@ -192,9 +193,15 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } log.Printf("\n%s\n", string(dump)) } + return resp, err } +// ChangeBasePath changes base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior func (c *APIClient) GetConfig() *Configuration { @@ -379,18 +386,7 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } -{{#hasHttpSignatureMethods}} - if ctx != nil { - // HTTP Signature Authentication. All request headers must be set (including default headers) - // because the headers may be included in the signature. - if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { - err = SignRequest(ctx, localVarRequest, auth) - if err != nil { - return nil, err - } - } - } -{{/hasHttpSignatureMethods}} + return localVarRequest, nil } @@ -402,6 +398,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if f, ok := v.(**os.File); ok { + *f, err = ioutil.TempFile("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + _, err = (*f).Seek(0, io.SeekStart) + return + } if xmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err @@ -409,15 +414,7 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err!= nil { - return err - } - } else { - errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model + if err = json.Unmarshal(b, v); err != nil { return err } return nil diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache similarity index 71% rename from samples/client/petstore/go/go-petstore-withXml/configuration.go rename to modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache index fbebb230db3..b21d2a13a23 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache @@ -1,14 +1,5 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore +{{>partial_header}} +package {{packageName}} import ( "fmt" @@ -39,6 +30,10 @@ var ( // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") + {{#withAWSV4Signature}} + // ContextAWSv4 takes an Access Key and a Secret Key for signing AWS Signature v4. + ContextAWSv4 = contextKey("awsv4") + {{/withAWSV4Signature}} ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -53,6 +48,14 @@ type APIKey struct { Prefix string } +{{#withAWSV4Signature}} +// AWSv4 provides AWS Signature to a request passed via context using ContextAWSv4 +// https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html +type AWSv4 struct { + AccessKey string + SecretKey string +} +{{/withAWSV4Signature}} // ServerVariable stores the information about a server variable type ServerVariable struct { @@ -83,16 +86,43 @@ type Configuration struct { // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://petstore.swagger.io:80/v2", + BasePath: "{{{basePath}}}", DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", + UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", Debug: false, + {{#servers}} + {{#-first}} Servers: []ServerConfiguration{ + {{/-first}} { - Url: "http://petstore.swagger.io:80/v2", - Description: "No description provided", + Url: "{{{url}}}", + Description: "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + Variables: map[string]ServerVariable{ + {{/-first}} + "{{{name}}}": ServerVariable{ + Description: "{{{description}}}{{^description}}No description provided{{/description}}", + DefaultValue: "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + EnumValues: []string{ + {{/-first}} + "{{{.}}}", + {{#-last}} + }, + {{/-last}} + {{/enumValues}} + }, + {{#-last}} + }, + {{/-last}} + {{/variables}} }, + {{#-last}} }, + {{/-last}} + {{/servers}} } return cfg } diff --git a/modules/openapi-generator/src/main/resources/go-experimental/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/git_push.sh.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/gitignore.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/gitignore.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/gitignore.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/gitignore.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/go.mod.mustache similarity index 87% rename from modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/go.mod.mustache index 21fcfdeb96e..c97cfff92ea 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/go.mod.mustache @@ -1,8 +1,7 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}} -go 1.13 - require ( + github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 {{#withAWSV4Signature}} github.com/aws/aws-sdk-go v1.34.14 diff --git a/samples/client/petstore/go/go-petstore-withXml/go.sum b/modules/openapi-generator/src/main/resources/go-deprecated/go.sum similarity index 100% rename from samples/client/petstore/go/go-petstore-withXml/go.sum rename to modules/openapi-generator/src/main/resources/go-deprecated/go.sum diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache new file mode 100644 index 00000000000..f30047a9e21 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache @@ -0,0 +1,43 @@ +{{>partial_header}} +package {{packageName}} +{{#models}} +{{#imports}} +{{#-first}} +import ( +{{/-first}} + "{{import}}" +{{#-last}} +) +{{/-last}} +{{/imports}} +{{#model}} +{{#isEnum}} +// {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} + +// List of {{{name}}} +const ( + {{#allowableValues}} + {{#enumVars}} + {{^-first}} + {{/-first}} + {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = {{{value}}} + {{/enumVars}} + {{/allowableValues}} +) +{{/isEnum}} +{{^isEnum}} +// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} +type {{classname}} struct { +{{#allVars}} +{{^-first}} +{{/-first}} +{{#description}} + // {{{description}}} +{{/description}} + {{name}} {{#isNullable}}*{{/isNullable}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` +{{/allVars}} +} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/model_doc.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/model_doc.mustache new file mode 100644 index 00000000000..ae517d4a75a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-deprecated/model_doc.mustache @@ -0,0 +1,12 @@ +{{#models}}{{#model}}# {{classname}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#allVars}}**{{name}}** | {{#isNullable}}Pointer to {{/isNullable}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/allVars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/openapi.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/openapi.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/openapi.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/openapi.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/partial_header.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/response.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/response.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/response.mustache rename to modules/openapi-generator/src/main/resources/go-deprecated/response.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache deleted file mode 100644 index 45897979f3f..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache +++ /dev/null @@ -1,215 +0,0 @@ -# Go API client for {{packageName}} - -{{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} -{{/appDescriptionWithNewLines}} - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -``` - -Put the package under your project folder and add the following in import: - -```golang -import sw "./{{packageName}}" -``` - -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. - -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} Endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}} - -### {{{name}}} - -{{#isApiKey}} -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: {{keyParamName}} and passed in as the auth context for each request. - -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBearer}} -- **Type**: HTTP Bearer token authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -{{/isBasicBearer}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - -{{/isBasicBasic}} -{{#isHttpSignature}} -- **Type**: HTTP signature authentication - -Example - -```golang - authConfig := sw.HttpSignatureAuth{ - KeyId: "my-key-id", - PrivateKeyPath: "rsa.pem", - Passphrase: "my-passphrase", - SigningScheme: sw.HttpSigningSchemeHs2019, - SignedHeaders: []string{ - sw.HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. - sw.HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. - "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. - "Date", // The date and time at which the message was originated. - "Content-Type", // The Media type of the body of the request. - "Digest", // A cryptographic digest of the request body. - }, - SigningAlgorithm: sw.HttpSigningAlgorithmRsaPSS, - SignatureMaxValidity: 5 * time.Minute, - } - var authCtx context.Context - var err error - if authCtx, err = authConfig.ContextWithValue(context.Background()); err != nil { - // Process error - } - r, err = client.Service.Operation(auth, args) - -``` -{{/isHttpSignature}} -{{/isBasic}} -{{#isOAuth}} - -- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - -{{/isOAuth}} -{{/authMethods}} - -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: - -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` - -## Author - -{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} -{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache deleted file mode 100644 index 944f187b13a..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache +++ /dev/null @@ -1,375 +0,0 @@ -{{>partial_header}} -package {{packageName}} - -{{#operations}} -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -{{#imports}} "{{import}}" -{{/imports}} -) - -// Linger please -var ( - _ _context.Context -) -{{#generateInterfaces}} - -type {{classname}} interface { - {{#operation}} - - /* - * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} - {{#notes}} - * {{{unescapedNotes}}} - {{/notes}} - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} - * @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} - * @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request - */ - {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request - - /* - * {{nickname}}Execute executes the request{{#returnType}} - * @return {{{.}}}{{/returnType}} - */ - {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) - {{/operation}} -} -{{/generateInterfaces}} - -// {{classname}}Service {{classname}} service -type {{classname}}Service service -{{#operation}} - -type {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request struct { - ctx _context.Context{{#generateInterfaces}} - ApiService {{classname}} -{{/generateInterfaces}}{{^generateInterfaces}} - ApiService *{{classname}}Service -{{/generateInterfaces}} -{{#allParams}} - {{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}} -{{/allParams}} -} -{{#allParams}}{{^isPathParam}} -func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { - r.{{paramName}} = &{{paramName}} - return r -}{{/isPathParam}}{{/allParams}} - -func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { - return r.ApiService.{{nickname}}Execute(r) -} - -/* - * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} -{{#notes}} - * {{{unescapedNotes}}} -{{/notes}} - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} - * @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} - * @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request - */ -func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { - return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request{ - ApiService: a, - ctx: ctx,{{#pathParams}} - {{paramName}}: {{paramName}},{{/pathParams}} - } -} - -/* - * Execute executes the request{{#returnType}} - * @return {{{.}}}{{/returnType}} - */ -func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.Method{{httpMethod}} - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - {{#returnType}} - localVarReturnValue {{{.}}} - {{/returnType}} - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") - if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString(r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) , -1){{/pathParams}} - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - {{#allParams}} - {{#required}} - {{^isPathParam}} - if r.{{paramName}} == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} is required and must be specified") - } - {{/isPathParam}} - {{#minItems}} - if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") - } - {{/minItems}} - {{#maxItems}} - if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") - } - {{/maxItems}} - {{#minLength}} - if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") - } - {{/minLength}} - {{#maxLength}} - if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") - } - {{/maxLength}} - {{#minimum}} - {{#isString}} - {{paramName}}Txt, err := atoi({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) - if {{paramName}}Txt < {{minimum}} { - {{/isString}} - {{^isString}} - if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { - {{/isString}} - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") - } - {{/minimum}} - {{#maximum}} - {{#isString}} - {{paramName}}Txt, err := atoi({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) - if {{paramName}}Txt > {{maximum}} { - {{/isString}} - {{^isString}} - if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { - {{/isString}} - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") - } - {{/maximum}} - {{/required}} - {{/allParams}} - - {{#queryParams}} - {{#required}} - {{#isCollectionFormatMulti}} - { - t := *r.{{paramName}} - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - } - } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - } - } - {{/isCollectionFormatMulti}} - {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - {{/isCollectionFormatMulti}} - {{/required}} - {{^required}} - if r.{{paramName}} != nil { - {{#isCollectionFormatMulti}} - t := *r.{{paramName}} - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - } - } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - } - {{/isCollectionFormatMulti}} - {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - {{/isCollectionFormatMulti}} - } - {{/required}} - {{/queryParams}} - // to determine the Content-Type header -{{=<% %>=}} - localVarHTTPContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} -<%={{ }}=%> - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header -{{=<% %>=}} - localVarHTTPHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} -<%={{ }}=%> - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } -{{#headerParams}} - {{#required}} - localVarHeaderParams["{{baseName}}"] = parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") - {{/required}} - {{^required}} - if r.{{paramName}} != nil { - localVarHeaderParams["{{baseName}}"] = parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") - } - {{/required}} -{{/headerParams}} -{{#formParams}} -{{#isFile}} - localVarFormFileName = "{{baseName}}" -{{#required}} - localVarFile := *r.{{paramName}} -{{/required}} -{{^required}} - var localVarFile {{dataType}} - if r.{{paramName}} != nil { - localVarFile = *r.{{paramName}} - } -{{/required}} - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } -{{/isFile}} -{{^isFile}} -{{#required}} - localVarFormParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) -{{/required}} -{{^required}} -{{#isModel}} - if r.{{paramName}} != nil { - paramJson, err := parameterToJson(*r.{{paramName}}) - if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err - } - localVarFormParams.Add("{{baseName}}", paramJson) - } -{{/isModel}} -{{^isModel}} - if r.{{paramName}} != nil { - localVarFormParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) - } -{{/isModel}} -{{/required}} -{{/isFile}} -{{/formParams}} -{{#bodyParams}} - // body params - localVarPostBody = r.{{paramName}} -{{/bodyParams}} -{{#authMethods}} -{{#isApiKey}} -{{^isKeyInCookie}} - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - {{#vendorExtensions.x-auth-id-alias}} - if apiKey, ok := auth["{{.}}"]; ok { - var key string - if prefix, ok := auth["{{name}}"]; ok && prefix.Prefix != "" { - key = prefix.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - {{/vendorExtensions.x-auth-id-alias}} - {{^vendorExtensions.x-auth-id-alias}} - if apiKey, ok := auth["{{name}}"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - {{/vendorExtensions.x-auth-id-alias}} - {{#isKeyInHeader}} - localVarHeaderParams["{{keyParamName}}"] = key - {{/isKeyInHeader}} - {{#isKeyInQuery}} - localVarQueryParams.Add("{{keyParamName}}", key) - {{/isKeyInQuery}} - } - } - } -{{/isKeyInCookie}} -{{/isApiKey}} -{{/authMethods}} - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - {{#responses}} - {{#dataType}} - {{^is1xx}} - {{^is2xx}} - {{^wildcard}} - if localVarHTTPResponse.StatusCode == {{{code}}} { - {{/wildcard}} - var v {{{dataType}}} - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr - } - newErr.model = v - {{#hasMore}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr - {{/hasMore}} - {{^wildcard}} - } - {{/wildcard}} - {{/is2xx}} - {{/is1xx}} - {{/dataType}} - {{/responses}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr - } - - {{#returnType}} - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr - } - - {{/returnType}} - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, nil -} -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/api_doc.mustache b/modules/openapi-generator/src/main/resources/go-experimental/api_doc.mustache deleted file mode 100644 index 0ab0d27a346..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/api_doc.mustache +++ /dev/null @@ -1,89 +0,0 @@ -# {{invokerPackage}}\{{classname}}{{#description}} - -{{description}}{{/description}} - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} - -## {{{operationId}}} - -> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}(ctx{{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() - -{{{summary}}}{{#notes}} - -{{{unespacedNotes}}}{{/notes}} - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - {{goImportAlias}} "./openapi" -) - -func main() { - {{#allParams}} - {{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/allParams}} - - configuration := {{goImportAlias}}.NewConfiguration() - api_client := {{goImportAlias}}.NewAPIClient(configuration) - resp, r, err := api_client.{{classname}}.{{operationId}}(context.Background(), {{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{{vendorExtensions.x-export-param-name}}}({{{paramName}}}){{/optionalParams}}.Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - {{#returnType}} - // response from `{{operationId}}`: {{{.}}} - fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp) - {{/returnType}} -} -``` - -### Path Parameters - -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#pathParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/pathParams}}{{#pathParams}} -**{{paramName}}** | {{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/pathParams}} - -### Other Parameters - -Other parameters are passed through a pointer to a api{{{nickname}}}Request struct via the builder pattern -{{#allParams}}{{#-last}} - -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} -{{^isPathParam}} **{{paramName}}** | {{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/isPathParam}}{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}} (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - -- **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} -- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache b/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache deleted file mode 100644 index 1f5436d84b7..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache +++ /dev/null @@ -1,303 +0,0 @@ -{{>partial_header}} -package {{packageName}} - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - {{#withAWSV4Signature}} - // ContextAWSv4 takes an Access Key and a Secret Key for signing AWS Signature v4 - ContextAWSv4 = contextKey("awsv4") - - {{/withAWSV4Signature}} - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -{{#withAWSV4Signature}} -// AWSv4 provides AWS Signature to a request passed via context using ContextAWSv4 -// https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html -type AWSv4 struct { - AccessKey string - SecretKey string -} - -{{/withAWSV4Signature}} -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", - Debug: false, - {{#servers}} - {{#-first}} - Servers: ServerConfigurations{ - {{/-first}} - { - URL: "{{{url}}}", - Description: "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - Variables: map[string]ServerVariable{ - {{/-first}} - "{{{name}}}": ServerVariable{ - Description: "{{{description}}}{{^description}}No description provided{{/description}}", - DefaultValue: "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - EnumValues: []string{ - {{/-first}} - "{{{.}}}", - {{#-last}} - }, - {{/-last}} - {{/enumValues}} - }, - {{#-last}} - }, - {{/-last}} - {{/variables}} - }, - {{#-last}} - }, - {{/-last}} - {{/servers}} - {{#apiInfo}} - OperationServers: map[string]ServerConfigurations{ - {{#apis}} - {{#operations}} - {{#operation}} - {{#servers}} - {{#-first}} - "{{{classname}}}Service.{{{nickname}}}": { - {{/-first}} - { - URL: "{{{url}}}", - Description: "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - Variables: map[string]ServerVariable{ - {{/-first}} - "{{{name}}}": ServerVariable{ - Description: "{{{description}}}{{^description}}No description provided{{/description}}", - DefaultValue: "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - EnumValues: []string{ - {{/-first}} - "{{{.}}}", - {{#-last}} - }, - {{/-last}} - {{/enumValues}} - }, - {{#-last}} - }, - {{/-last}} - {{/variables}} - }, - {{#-last}} - }, - {{/-last}} - {{/servers}} - {{/operation}} - {{/operations}} - {{/apis}} - }, - {{/apiInfo}} - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/go.sum b/modules/openapi-generator/src/main/resources/go-experimental/go.sum deleted file mode 100644 index ce55b3c6a08..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/go.sum +++ /dev/null @@ -1,15 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache deleted file mode 100644 index 684af1d33c6..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache +++ /dev/null @@ -1,20 +0,0 @@ -{{>partial_header}} -package {{packageName}} - -{{#models}} -import ( - "encoding/json" -{{#imports}} - "{{import}}" -{{/imports}} -) - -{{#model}} -{{#isEnum}} -{{>model_enum}} -{{/isEnum}} -{{^isEnum}} -{{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_simple}}{{/anyOf}}{{/oneOf}} -{{/isEnum}} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_doc.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_doc.mustache deleted file mode 100644 index 9045d9fe088..00000000000 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_doc.mustache +++ /dev/null @@ -1,90 +0,0 @@ -{{#models}}{{#model}}# {{classname}} - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vendorExtensions.x-is-one-of-interface}} -**{{classname}}Interface** | **interface { {{#discriminator}}{{propertyGetter}}() {{propertyType}}{{/discriminator}} }** | An interface that can hold any of the proper implementing types | -{{/vendorExtensions.x-is-one-of-interface}} -{{^vendorExtensions.x-is-one-of-interface}} -{{#vars}}**{{name}}** | {{^required}}Pointer to {{/required}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} -{{/vendorExtensions.x-is-one-of-interface}} - -{{^isEnum}} -## Methods - -{{^vendorExtensions.x-is-one-of-interface}} -### New{{classname}} - -`func New{{classname}}({{#vars}}{{#required}}{{nameInCamelCase}} {{dataType}}, {{/required}}{{/vars}}) *{{classname}}` - -New{{classname}} instantiates a new {{classname}} object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### New{{classname}}WithDefaults - -`func New{{classname}}WithDefaults() *{{classname}}` - -New{{classname}}WithDefaults instantiates a new {{classname}} object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -{{#vars}} -### Get{{name}} - -`func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}}` - -Get{{name}} returns the {{name}} field if non-nil, zero value otherwise. - -### Get{{name}}Ok - -`func (o *{{classname}}) Get{{name}}Ok() (*{{vendorExtensions.x-go-base-type}}, bool)` - -Get{{name}}Ok returns a tuple with the {{name}} field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### Set{{name}} - -`func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}})` - -Set{{name}} sets {{name}} field to given value. - -{{^required}} -### Has{{name}} - -`func (o *{{classname}}) Has{{name}}() bool` - -Has{{name}} returns a boolean if a field has been set. -{{/required}} - -{{#isNullable}} -### Set{{name}}Nil - -`func (o *{{classname}}) Set{{name}}Nil(b bool)` - - Set{{name}}Nil sets the value for {{name}} to be an explicit nil - -### Unset{{name}} -`func (o *{{classname}}) Unset{{name}}()` - -Unset{{name}} ensures that no value is present for {{name}}, not even an explicit nil -{{/isNullable}} -{{/vars}} -{{#vendorExtensions.x-implements}} - -### As{{{.}}} - -`func (s *{{classname}}) As{{{.}}}() {{{.}}}` - -Convenience method to wrap this instance of {{classname}} in {{{.}}} -{{/vendorExtensions.x-implements}} -{{/vendorExtensions.x-is-one-of-interface}} -{{/isEnum}} - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index e4e8ffa507d..45897979f3f 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -24,17 +24,54 @@ Install the following dependencies: ```shell go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 -{{#withAWSV4Signature}} -go get github.com/aws/aws-sdk-go/aws -{{/withAWSV4Signature}} go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import "./{{packageName}}" +import sw "./{{packageName}}" +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +``` +ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) ``` ## Documentation for API Endpoints @@ -57,31 +94,35 @@ Class | Method | HTTP request | Description {{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} {{#authMethods}} -## {{{name}}} +### {{{name}}} -{{#isApiKey}}- **Type**: API key +{{#isApiKey}} +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: {{keyParamName}} and passed in as the auth context for each request. + +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBearer}} +- **Type**: HTTP Bearer token authentication Example ```golang -auth := context.WithValue(context.Background(), {{packageName}}.ContextAPIKey, {{packageName}}.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` -{{/isApiKey}} -{{#isHttpSignature}} -Not supported. - -{{/isHttpSignature}} -{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBearer}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication Example ```golang -auth := context.WithValue(context.Background(), {{packageName}}.ContextBasicAuth, {{packageName}}.BasicAuth{ +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) @@ -89,16 +130,38 @@ r, err := client.Service.Operation(auth, args) ``` {{/isBasicBasic}} -{{#isBasicBearer}}- **Type**: HTTP Bearer token authentication +{{#isHttpSignature}} +- **Type**: HTTP signature authentication Example ```golang -auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "BEARERTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` + authConfig := sw.HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "rsa.pem", + Passphrase: "my-passphrase", + SigningScheme: sw.HttpSigningSchemeHs2019, + SignedHeaders: []string{ + sw.HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + sw.HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + SigningAlgorithm: sw.HttpSigningAlgorithmRsaPSS, + SignatureMaxValidity: 5 * time.Minute, + } + var authCtx context.Context + var err error + if authCtx, err = authConfig.ContextWithValue(context.Background()); err != nil { + // Process error + } + r, err = client.Service.Operation(auth, args) -{{/isBasicBearer}} +``` +{{/isHttpSignature}} +{{/isBasic}} {{#isOAuth}} - **Type**: OAuth @@ -111,7 +174,7 @@ r, err := client.Service.Operation(auth, args) Example ```golang -auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "ACCESSTOKENSTRING") +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` @@ -123,24 +186,28 @@ import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, {{packageName}}.ContextOAuth2, tokenSource) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) r, err := client.Service.Operation(auth, args) ``` {{/isOAuth}} {{/authMethods}} -{{#withAWSV4Signature}} -Example +## Documentation for Utility Methods -```golang -auth := context.WithValue(context.Background(), {{packageName}}.ContextAWSv4, {{packageName}}.AWSv4{ - AccessKey: "ACCESSKEYSTRING", - SecretKey: "SECRETKEYSTRING", -}) -r, err := client.Service.Operation(auth, args) -``` -{{/withAWSV4Signature}} +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` ## Author diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 95875da699b..944f187b13a 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -7,7 +7,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" {{#imports}} "{{import}}" {{/imports}} ) @@ -16,92 +15,77 @@ import ( var ( _ _context.Context ) - {{#generateInterfaces}} + type {{classname}} interface { -{{#operation}} + {{#operation}} - /* - * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} - * - {{#notes}} - * {{notes}} - * - {{/notes}} - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - {{#allParams}} - {{#required}} - * @param {{paramName}}{{#description}} {{{.}}}{{/description}} - {{/required}} - {{/allParams}} - {{#hasOptionalParams}} - * @param optional nil or *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts - Optional Parameters: - {{#allParams}} - {{^required}} - * @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optional-data-type}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}} - {{/required}} - {{/allParams}} - {{/hasOptionalParams}} - {{#returnType}} - * @return {{{returnType}}} - {{/returnType}} - */ - {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) -{{/operation}} + /* + * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} + {{#notes}} + * {{{unescapedNotes}}} + {{/notes}} + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + * @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} + * @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request + */ + {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request + + /* + * {{nickname}}Execute executes the request{{#returnType}} + * @return {{{.}}}{{/returnType}} + */ + {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) + {{/operation}} } - {{/generateInterfaces}} + // {{classname}}Service {{classname}} service type {{classname}}Service service {{#operation}} -{{#hasOptionalParams}} -// {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts Optional parameters for the method '{{{nickname}}}' -type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct { +type {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request struct { + ctx _context.Context{{#generateInterfaces}} + ApiService {{classname}} +{{/generateInterfaces}}{{^generateInterfaces}} + ApiService *{{classname}}Service +{{/generateInterfaces}} {{#allParams}} -{{^required}} -{{#isPrimitiveType}} -{{^isBinary}} - {{vendorExtensions.x-export-param-name}} optional.{{vendorExtensions.x-optional-data-type}} -{{/isBinary}} -{{#isBinary}} - {{vendorExtensions.x-export-param-name}} optional.Interface -{{/isBinary}} -{{/isPrimitiveType}} -{{^isPrimitiveType}} - {{vendorExtensions.x-export-param-name}} optional.Interface -{{/isPrimitiveType}} -{{/required}} + {{paramName}} {{^isPathParam}}*{{/isPathParam}}{{{dataType}}} {{/allParams}} } +{{#allParams}}{{^isPathParam}} +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { + r.{{paramName}} = &{{paramName}} + return r +}{{/isPathParam}}{{/allParams}} + +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { + return r.ApiService.{{nickname}}Execute(r) +} -{{/hasOptionalParams}} /* * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} - * {{#notes}} - * {{notes}} - * + * {{{unescapedNotes}}} {{/notes}} - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). -{{#allParams}} -{{#required}} - * @param {{paramName}}{{#description}} {{{.}}}{{/description}} -{{/required}} -{{/allParams}} -{{#hasOptionalParams}} - * @param optional nil or *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts - Optional Parameters: -{{#allParams}} -{{^required}} - * @param "{{vendorExtensions.x-export-param-name}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optional-data-type}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}} -{{/required}} -{{/allParams}} -{{/hasOptionalParams}} -{{#returnType}} - * @return {{{returnType}}} -{{/returnType}} + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + * @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} + * @return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request */ -func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request { + return {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request{ + ApiService: a, + ctx: ctx,{{#pathParams}} + {{paramName}}: {{paramName}},{{/pathParams}} + } +} + +/* + * Execute executes the request{{#returnType}} + * @return {{{.}}}{{/returnType}} + */ +func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}Api{{operationId}}Request) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} @@ -109,58 +93,66 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams localVarFileName string localVarFileBytes []byte {{#returnType}} - localVarReturnValue {{{returnType}}} + localVarReturnValue {{{.}}} {{/returnType}} ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) , -1) - {{/pathParams}} + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "{{{path}}}"{{#pathParams}} + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString(r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) , -1){{/pathParams}} localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} {{#allParams}} {{#required}} + {{^isPathParam}} + if r.{{paramName}} == nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} is required and must be specified") + } + {{/isPathParam}} {{#minItems}} - if len({{paramName}}) < {{minItems}} { + if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") } {{/minItems}} {{#maxItems}} - if len({{paramName}}) > {{maxItems}} { + if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") } {{/maxItems}} {{#minLength}} - if strlen({{paramName}}) < {{minLength}} { + if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") } {{/minLength}} {{#maxLength}} - if strlen({{paramName}}) > {{maxLength}} { + if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") } {{/maxLength}} {{#minimum}} {{#isString}} - {{paramName}}Txt, err := atoi({{paramName}}) + {{paramName}}Txt, err := atoi({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) if {{paramName}}Txt < {{minimum}} { {{/isString}} {{^isString}} - if {{paramName}} < {{minimum}} { + if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { {{/isString}} return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") } {{/minimum}} {{#maximum}} {{#isString}} - {{paramName}}Txt, err := atoi({{paramName}}) + {{paramName}}Txt, err := atoi({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) if {{paramName}}Txt > {{maximum}} { {{/isString}} {{^isString}} - if {{paramName}} > {{maximum}} { + if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { {{/isString}} return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") } @@ -168,12 +160,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{/required}} {{/allParams}} - {{#hasQueryParams}} {{#queryParams}} {{#required}} {{#isCollectionFormatMulti}} { - t:={{paramName}} + t := *r.{{paramName}} if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { @@ -185,13 +176,13 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) {{/isCollectionFormatMulti}} {{/required}} {{^required}} - if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { + if r.{{paramName}} != nil { {{#isCollectionFormatMulti}} - t:=localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value() + t := *r.{{paramName}} if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { @@ -202,12 +193,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) {{/isCollectionFormatMulti}} } {{/required}} {{/queryParams}} - {{/hasQueryParams}} // to determine the Content-Type header {{=<% %>=}} localVarHTTPContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} @@ -229,33 +219,26 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } -{{#hasHeaderParams}} {{#headerParams}} {{#required}} - localVarHeaderParams["{{baseName}}"] = parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + localVarHeaderParams["{{baseName}}"] = parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") {{/required}} {{^required}} - if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarHeaderParams["{{baseName}}"] = parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + if r.{{paramName}} != nil { + localVarHeaderParams["{{baseName}}"] = parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") } {{/required}} {{/headerParams}} -{{/hasHeaderParams}} -{{#hasFormParams}} {{#formParams}} {{#isFile}} localVarFormFileName = "{{baseName}}" {{#required}} - localVarFile := {{paramName}} + localVarFile := *r.{{paramName}} {{/required}} {{^required}} var localVarFile {{dataType}} - if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value().({{dataType}}) - if !localVarFileOk { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} should be {{dataType}}") - } + if r.{{paramName}} != nil { + localVarFile = *r.{{paramName}} } {{/required}} if localVarFile != nil { @@ -267,12 +250,12 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{/isFile}} {{^isFile}} {{#required}} - localVarFormParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarFormParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) {{/required}} {{^required}} {{#isModel}} - if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - paramJson, err := parameterToJson(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value()) + if r.{{paramName}} != nil { + paramJson, err := parameterToJson(*r.{{paramName}}) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err } @@ -280,73 +263,65 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams } {{/isModel}} {{^isModel}} - if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarFormParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + if r.{{paramName}} != nil { + localVarFormParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } {{/isModel}} {{/required}} {{/isFile}} {{/formParams}} -{{/hasFormParams}} -{{#hasBodyParam}} {{#bodyParams}} // body params -{{#required}} - localVarPostBody = &{{paramName}} -{{/required}} -{{^required}} - if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - {{#isPrimitiveType}} - localVarPostBody = localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value() - {{/isPrimitiveType}} - {{^isPrimitiveType}} - localVarOptional{{vendorExtensions.x-export-param-name}}, localVarOptional{{vendorExtensions.x-export-param-name}}ok := localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value().({{{dataType}}}) - if !localVarOptional{{vendorExtensions.x-export-param-name}}ok { - return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} should be {{dataType}}") - } - localVarPostBody = &localVarOptional{{vendorExtensions.x-export-param-name}} - {{/isPrimitiveType}} - } - -{{/required}} + localVarPostBody = r.{{paramName}} {{/bodyParams}} -{{/hasBodyParam}} {{#authMethods}} {{#isApiKey}} {{^isKeyInCookie}} - if ctx != nil { + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + {{#vendorExtensions.x-auth-id-alias}} + if apiKey, ok := auth["{{.}}"]; ok { + var key string + if prefix, ok := auth["{{name}}"]; ok && prefix.Prefix != "" { + key = prefix.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + {{/vendorExtensions.x-auth-id-alias}} + {{^vendorExtensions.x-auth-id-alias}} + if apiKey, ok := auth["{{name}}"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + {{/vendorExtensions.x-auth-id-alias}} + {{#isKeyInHeader}} + localVarHeaderParams["{{keyParamName}}"] = key + {{/isKeyInHeader}} + {{#isKeyInQuery}} + localVarQueryParams.Add("{{keyParamName}}", key) + {{/isKeyInQuery}} } - {{#isKeyInHeader}} - localVarHeaderParams["{{keyParamName}}"] = key - {{/isKeyInHeader}} - {{#isKeyInQuery}} - localVarQueryParams.Add("{{keyParamName}}", key) - {{/isKeyInQuery}} } } {{/isKeyInCookie}} {{/isApiKey}} {{/authMethods}} - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err } diff --git a/modules/openapi-generator/src/main/resources/go/api_doc.mustache b/modules/openapi-generator/src/main/resources/go/api_doc.mustache index 5ddad640ca3..0ab0d27a346 100644 --- a/modules/openapi-generator/src/main/resources/go/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/api_doc.mustache @@ -14,29 +14,59 @@ Method | HTTP request | Description ## {{{operationId}}} -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}(ctx{{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{unespacedNotes}}}{{/notes}} -### Required Parameters +### Example -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +```go +package main + +import ( + "context" + "fmt" + "os" + {{goImportAlias}} "./openapi" +) + +func main() { + {{#allParams}} + {{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + configuration := {{goImportAlias}}.NewConfiguration() + api_client := {{goImportAlias}}.NewAPIClient(configuration) + resp, r, err := api_client.{{classname}}.{{operationId}}(context.Background(), {{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{{vendorExtensions.x-export-param-name}}}({{{paramName}}}){{/optionalParams}}.Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + {{#returnType}} + // response from `{{operationId}}`: {{{.}}} + fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp) + {{/returnType}} +} +``` + +### Path Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#pathParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/allParams}}{{#allParams}}{{#required}} -**{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} - **optional** | ***{{{nickname}}}Opts** | optional parameters | nil if no parameters +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/pathParams}}{{#pathParams}} +**{{paramName}}** | {{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/pathParams}} -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a {{{nickname}}}Opts struct +Other parameters are passed through a pointer to a api{{{nickname}}}Request struct via the builder pattern {{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} -{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}} +{{^isPathParam}} **{{paramName}}** | {{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/isPathParam}}{{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index a3723b68602..76a3cb5df1b 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -9,7 +9,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "mime/multipart" "net/http" @@ -32,7 +31,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) @@ -47,12 +46,12 @@ type APIClient struct { {{#apis}} {{#operations}} -{{#generateInterfaces}} + {{#generateInterfaces}} {{classname}} {{classname}} -{{/generateInterfaces}} -{{^generateInterfaces}} + {{/generateInterfaces}} + {{^generateInterfaces}} {{classname}} *{{classname}}Service -{{/generateInterfaces}} + {{/generateInterfaces}} {{/operations}} {{/apis}} {{/apiInfo}} @@ -174,9 +173,9 @@ func parameterToJson(obj interface{}) (string, error) { // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } @@ -193,15 +192,9 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } log.Printf("\n%s\n", string(dump)) } - return resp, err } -// ChangeBasePath changes base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior func (c *APIClient) GetConfig() *Configuration { @@ -386,7 +379,18 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - +{{#hasHttpSignatureMethods}} + if ctx != nil { + // HTTP Signature Authentication. All request headers must be set (including default headers) + // because the headers may be included in the signature. + if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { + err = SignRequest(ctx, localVarRequest, auth) + if err != nil { + return nil, err + } + } + } +{{/hasHttpSignatureMethods}} return localVarRequest, nil } @@ -398,15 +402,6 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } - if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - _, err = (*f).Seek(0, io.SeekStart) - return - } if xmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err @@ -414,7 +409,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if err = json.Unmarshal(b, v); err != nil { + if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err!= nil { + return err + } + } else { + errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil diff --git a/modules/openapi-generator/src/main/resources/go/configuration.mustache b/modules/openapi-generator/src/main/resources/go/configuration.mustache index b21d2a13a23..1f5436d84b7 100644 --- a/modules/openapi-generator/src/main/resources/go/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go/configuration.mustache @@ -2,6 +2,7 @@ package {{packageName}} import ( + "context" "fmt" "net/http" "strings" @@ -27,13 +28,28 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") {{#withAWSV4Signature}} - // ContextAWSv4 takes an Access Key and a Secret Key for signing AWS Signature v4. + // ContextAWSv4 takes an Access Key and a Secret Key for signing AWS Signature v4 ContextAWSv4 = contextKey("awsv4") + {{/withAWSV4Signature}} + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -52,11 +68,11 @@ type APIKey struct { // AWSv4 provides AWS Signature to a request passed via context using ContextAWSv4 // https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html type AWSv4 struct { - AccessKey string - SecretKey string + AccessKey string + SecretKey string } -{{/withAWSV4Signature}} +{{/withAWSV4Signature}} // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -66,36 +82,38 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - Url string + URL string Description string Variables map[string]ServerVariable } +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + // Configuration stores the configuration of the API client type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers []ServerConfiguration - HTTPClient *http.Client + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client } // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "{{{basePath}}}", - DefaultHeader: make(map[string]string), - UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", - Debug: false, + DefaultHeader: make(map[string]string), + UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", + Debug: false, {{#servers}} {{#-first}} - Servers: []ServerConfiguration{ + Servers: ServerConfigurations{ {{/-first}} { - Url: "{{{url}}}", + URL: "{{{url}}}", Description: "{{{description}}}{{^description}}No description provided{{/description}}", {{#variables}} {{#-first}} @@ -123,6 +141,49 @@ func NewConfiguration() *Configuration { }, {{/-last}} {{/servers}} + {{#apiInfo}} + OperationServers: map[string]ServerConfigurations{ + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers}} + {{#-first}} + "{{{classname}}}Service.{{{nickname}}}": { + {{/-first}} + { + URL: "{{{url}}}", + Description: "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + Variables: map[string]ServerVariable{ + {{/-first}} + "{{{name}}}": ServerVariable{ + Description: "{{{description}}}{{^description}}No description provided{{/description}}", + DefaultValue: "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + EnumValues: []string{ + {{/-first}} + "{{{.}}}", + {{#-last}} + }, + {{/-last}} + {{/enumValues}} + }, + {{#-last}} + }, + {{/-last}} + {{/variables}} + }, + {{#-last}} + }, + {{/-last}} + {{/servers}} + {{/operation}} + {{/operations}} + {{/apis}} + }, + {{/apiInfo}} } return cfg } @@ -132,13 +193,13 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } -// ServerUrl returns URL based on server settings -func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { - if index < 0 || len(c.Servers) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) } - server := c.Servers[index] - url := server.Url + server := sc[index] + url := server.URL // go through variables and replace placeholders for name, variable := range server.Variables { @@ -159,3 +220,84 @@ func (c *Configuration) ServerUrl(index int, variables map[string]string) (strin } return url, nil } + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/modules/openapi-generator/src/main/resources/go/go.mod.mustache b/modules/openapi-generator/src/main/resources/go/go.mod.mustache index c97cfff92ea..21fcfdeb96e 100644 --- a/modules/openapi-generator/src/main/resources/go/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go/go.mod.mustache @@ -1,7 +1,8 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}} +go 1.13 + require ( - github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 {{#withAWSV4Signature}} github.com/aws/aws-sdk-go v1.34.14 diff --git a/modules/openapi-generator/src/main/resources/go/go.sum b/modules/openapi-generator/src/main/resources/go/go.sum index ee695202297..ce55b3c6a08 100644 --- a/modules/openapi-generator/src/main/resources/go/go.sum +++ b/modules/openapi-generator/src/main/resources/go/go.sum @@ -1,8 +1,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= -github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/modules/openapi-generator/src/main/resources/go/model.mustache b/modules/openapi-generator/src/main/resources/go/model.mustache index f30047a9e21..684af1d33c6 100644 --- a/modules/openapi-generator/src/main/resources/go/model.mustache +++ b/modules/openapi-generator/src/main/resources/go/model.mustache @@ -1,43 +1,20 @@ {{>partial_header}} package {{packageName}} + {{#models}} -{{#imports}} -{{#-first}} import ( -{{/-first}} + "encoding/json" +{{#imports}} "{{import}}" -{{#-last}} -) -{{/-last}} {{/imports}} +) + {{#model}} {{#isEnum}} -// {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} - -// List of {{{name}}} -const ( - {{#allowableValues}} - {{#enumVars}} - {{^-first}} - {{/-first}} - {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = {{{value}}} - {{/enumVars}} - {{/allowableValues}} -) +{{>model_enum}} {{/isEnum}} {{^isEnum}} -// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} -type {{classname}} struct { -{{#allVars}} -{{^-first}} -{{/-first}} -{{#description}} - // {{{description}}} -{{/description}} - {{name}} {{#isNullable}}*{{/isNullable}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` -{{/allVars}} -} +{{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_simple}}{{/anyOf}}{{/oneOf}} {{/isEnum}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go/model_anyof.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache rename to modules/openapi-generator/src/main/resources/go/model_anyof.mustache diff --git a/modules/openapi-generator/src/main/resources/go/model_doc.mustache b/modules/openapi-generator/src/main/resources/go/model_doc.mustache index ae517d4a75a..9045d9fe088 100644 --- a/modules/openapi-generator/src/main/resources/go/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_doc.mustache @@ -4,8 +4,86 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#allVars}}**{{name}}** | {{#isNullable}}Pointer to {{/isNullable}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/allVars}} +{{#vendorExtensions.x-is-one-of-interface}} +**{{classname}}Interface** | **interface { {{#discriminator}}{{propertyGetter}}() {{propertyType}}{{/discriminator}} }** | An interface that can hold any of the proper implementing types | +{{/vendorExtensions.x-is-one-of-interface}} +{{^vendorExtensions.x-is-one-of-interface}} +{{#vars}}**{{name}}** | {{^required}}Pointer to {{/required}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} +{{/vendorExtensions.x-is-one-of-interface}} + +{{^isEnum}} +## Methods + +{{^vendorExtensions.x-is-one-of-interface}} +### New{{classname}} + +`func New{{classname}}({{#vars}}{{#required}}{{nameInCamelCase}} {{dataType}}, {{/required}}{{/vars}}) *{{classname}}` + +New{{classname}} instantiates a new {{classname}} object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### New{{classname}}WithDefaults + +`func New{{classname}}WithDefaults() *{{classname}}` + +New{{classname}}WithDefaults instantiates a new {{classname}} object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +{{#vars}} +### Get{{name}} + +`func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}}` + +Get{{name}} returns the {{name}} field if non-nil, zero value otherwise. + +### Get{{name}}Ok + +`func (o *{{classname}}) Get{{name}}Ok() (*{{vendorExtensions.x-go-base-type}}, bool)` + +Get{{name}}Ok returns a tuple with the {{name}} field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### Set{{name}} + +`func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}})` + +Set{{name}} sets {{name}} field to given value. + +{{^required}} +### Has{{name}} + +`func (o *{{classname}}) Has{{name}}() bool` + +Has{{name}} returns a boolean if a field has been set. +{{/required}} + +{{#isNullable}} +### Set{{name}}Nil + +`func (o *{{classname}}) Set{{name}}Nil(b bool)` + + Set{{name}}Nil sets the value for {{name}} to be an explicit nil + +### Unset{{name}} +`func (o *{{classname}}) Unset{{name}}()` + +Unset{{name}} ensures that no value is present for {{name}}, not even an explicit nil +{{/isNullable}} +{{/vars}} +{{#vendorExtensions.x-implements}} + +### As{{{.}}} + +`func (s *{{classname}}) As{{{.}}}() {{{.}}}` + +Convenience method to wrap this instance of {{classname}} in {{{.}}} +{{/vendorExtensions.x-implements}} +{{/vendorExtensions.x-is-one-of-interface}} +{{/isEnum}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache b/modules/openapi-generator/src/main/resources/go/model_enum.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache rename to modules/openapi-generator/src/main/resources/go/model_enum.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go/model_oneof.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache rename to modules/openapi-generator/src/main/resources/go/model_oneof.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache rename to modules/openapi-generator/src/main/resources/go/model_simple.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/nullable_model.mustache b/modules/openapi-generator/src/main/resources/go/nullable_model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/nullable_model.mustache rename to modules/openapi-generator/src/main/resources/go/nullable_model.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/go/signing.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/signing.mustache rename to modules/openapi-generator/src/main/resources/go/signing.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/utils.mustache b/modules/openapi-generator/src/main/resources/go/utils.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/go-experimental/utils.mustache rename to modules/openapi-generator/src/main/resources/go/utils.mustache diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java index 417cd43ccd3..dae8f0deb49 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java @@ -23,7 +23,7 @@ import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.GoClientCodegen; +import org.openapitools.codegen.languages.GoDeprecatedClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; @@ -31,7 +31,7 @@ public class GoClientCodegenTest { @Test public void testInitialConfigValues() throws Exception { - final GoClientCodegen codegen = new GoClientCodegen(); + final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); codegen.processOpts(); Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.TRUE); @@ -40,7 +40,7 @@ public class GoClientCodegenTest { @Test public void testSettersForConfigValues() throws Exception { - final GoClientCodegen codegen = new GoClientCodegen(); + final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); codegen.setHideGenerationTimestamp(false); codegen.processOpts(); @@ -50,7 +50,7 @@ public class GoClientCodegenTest { @Test public void testAdditionalPropertiesPutForConfigValues() throws Exception { - final GoClientCodegen codegen = new GoClientCodegen(); + final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, false); codegen.processOpts(); @@ -61,7 +61,7 @@ public class GoClientCodegenTest { @Test(description = "test example value for body parameter") public void bodyParameterTest() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); - final GoClientCodegen codegen = new GoClientCodegen(); + final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); codegen.setOpenAPI(openAPI); final String path = "/fake"; final Operation p = openAPI.getPaths().get(path).getGet(); @@ -73,7 +73,7 @@ public class GoClientCodegenTest { @Test public void testFilenames() throws Exception { - final GoClientCodegen codegen = new GoClientCodegen(); + final GoDeprecatedClientCodegen codegen = new GoDeprecatedClientCodegen(); // Model names are generated from schema / definition names Assert.assertEquals(codegen.toModelFilename("Animal"), "model_animal"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index 386b9f808d9..139c3162b57 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -19,7 +19,7 @@ package org.openapitools.codegen.go; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.GoClientCodegen; +import org.openapitools.codegen.languages.GoDeprecatedClientCodegen; import org.openapitools.codegen.options.GoClientOptionsProvider; import static org.mockito.Mockito.mock; @@ -27,7 +27,7 @@ import static org.mockito.Mockito.verify; public class GoClientOptionsTest extends AbstractOptionsTest { - private GoClientCodegen clientCodegen = mock(GoClientCodegen.class, mockSettings); + private GoDeprecatedClientCodegen clientCodegen = mock(GoDeprecatedClientCodegen.class, mockSettings); public GoClientOptionsTest() { super(new GoClientOptionsProvider()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java index 28276ab4daa..f4e3fc6bd3c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoModelTest.java @@ -25,7 +25,7 @@ import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.GoClientCodegen; +import org.openapitools.codegen.languages.GoDeprecatedClientCodegen; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -42,7 +42,7 @@ public class GoModelTest { .addProperties("createdAt", new DateTimeSchema()) .addRequiredItem("id") .addRequiredItem("name"); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -92,7 +92,7 @@ public class GoModelTest { .addProperties("urls", new ArraySchema() .items(new StringSchema())) .addRequiredItem("id"); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -130,7 +130,7 @@ public class GoModelTest { .addProperties("translations", new MapSchema() .additionalProperties(new StringSchema())) .addRequiredItem("id"); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -156,7 +156,7 @@ public class GoModelTest { final Schema model = new Schema() .description("a sample model") .addProperties("children", new Schema().$ref("#/definitions/Children")); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -180,7 +180,7 @@ public class GoModelTest { .description("a sample model") .addProperties("children", new ArraySchema() .items(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -206,7 +206,7 @@ public class GoModelTest { .description("a sample model") .addProperties("children", new MapSchema() .additionalProperties(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -233,7 +233,7 @@ public class GoModelTest { final Schema model = new ArraySchema() .items(new Schema().$ref("#/definitions/Children")) .description("an array model"); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -250,7 +250,7 @@ public class GoModelTest { final Schema model = new Schema() .additionalProperties(new Schema().$ref("#/definitions/Children")) .description("a map model"); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel("sample", model); @@ -265,7 +265,7 @@ public class GoModelTest { @Test(description = "convert file type and file schema models") public void filePropertyTest() { - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); final Schema model1 = new Schema().type("file"); Assert.assertEquals(codegen.getSchemaType(model1), "*os.File"); Assert.assertEquals(codegen.getTypeDeclaration(model1), "*os.File"); @@ -295,7 +295,7 @@ public class GoModelTest { @Test(dataProvider = "modelNames", description = "avoid inner class") public void modelNameTest(String name, String expectedName) { final Schema model = new Schema(); - final DefaultCodegen codegen = new GoClientCodegen(); + final DefaultCodegen codegen = new GoDeprecatedClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema(name, model); codegen.setOpenAPI(openAPI); final CodegenModel cm = codegen.fromModel(name, model); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java index 5a10f3d219d..242607a91de 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/OneOfImplementorAdditionalDataTest.java @@ -1,9 +1,8 @@ package org.openapitools.codegen.utils; -import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.languages.GoClientExperimentalCodegen; +import org.openapitools.codegen.languages.GoClientCodegen; import org.testng.Assert; import org.testng.annotations.Test; @@ -47,7 +46,7 @@ public class OneOfImplementorAdditionalDataTest { cp3.hasMore = false; implModel.vars.add(cp3); List> implModelImports = new ArrayList<>(); - GoClientExperimentalCodegen cc = new GoClientExperimentalCodegen(); + GoClientCodegen cc = new GoClientCodegen(); cc.setModelPackage("openapi"); o.addToImplementor(cc, implModel, implModelImports, false); diff --git a/pom.xml b/pom.xml index 27a3f39306c..7813aebeb26 100644 --- a/pom.xml +++ b/pom.xml @@ -1331,8 +1331,6 @@ samples/client/petstore/groovy samples/client/petstore/go - samples/client/petstore/go-experimental - samples/openapi3/client/petstore/go-experimental samples/openapi3/client/petstore/go samples/client/petstore/javascript-es6 samples/client/petstore/javascript-promise-es6 diff --git a/samples/client/petstore/go-experimental/auth_test.go b/samples/client/petstore/go-experimental/auth_test.go deleted file mode 100644 index 0e532aeff3a..00000000000 --- a/samples/client/petstore/go-experimental/auth_test.go +++ /dev/null @@ -1,259 +0,0 @@ -package main - -import ( - "context" - "net/http" - "net/http/httputil" - "strings" - "testing" - "time" - - "golang.org/x/oauth2" - - sw "./go-petstore" -) - -func TestOAuth2(t *testing.T) { - // Setup some fake oauth2 configuration - cfg := &oauth2.Config{ - ClientID: "1234567", - ClientSecret: "SuperSecret", - Endpoint: oauth2.Endpoint{ - AuthURL: "https://devnull", - TokenURL: "https://devnull", - }, - RedirectURL: "https://devnull", - } - - // and a fake token - tok := oauth2.Token{ - AccessToken: "FAKE", - RefreshToken: "So Fake", - Expiry: time.Now().Add(time.Hour * 100000), - TokenType: "Bearer", - } - - // then a fake tokenSource - tokenSource := cfg.TokenSource(createContext(nil), &tok) - auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - - if !strings.Contains((string)(reqb), "Authorization: Bearer FAKE") { - t.Errorf("OAuth2 Authentication is missing") - } -} - -func TestBasicAuth(t *testing.T) { - - auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "fakeUser", - Password: "f4k3p455", - }) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(auth).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Authorization: Basic ZmFrZVVzZXI6ZjRrM3A0NTU") { - t.Errorf("Basic Authentication is missing") - } -} - -func TestAccessToken(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Authorization: Bearer TESTFAKEACCESSTOKENISFAKE") { - t.Errorf("AccessToken Authentication is missing") - } -} - -func TestAPIKeyNoPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: TEST123") { - t.Errorf("APIKey Authentication is missing") - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestAPIKeyWithPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { - t.Errorf("APIKey Authentication is missing") - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestDefaultHeader(t *testing.T) { - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Testheader: testvalue") { - t.Errorf("Default Header is missing") - } -} - -func TestHostOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - - if err != nil { - t.Fatalf("Error while finding pets by status: %v", err) - } - - if r.Request.URL.Host != testHost { - t.Errorf("Request Host is %v, expected %v", r.Request.Host, testHost) - } -} - -func TestSchemeOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - - if err != nil { - t.Fatalf("Error while finding pets by status: %v", err) - } - - if r.Request.URL.Scheme != testScheme { - t.Errorf("Request Scheme is %v, expected %v", r.Request.URL.Scheme, testScheme) - } -} - -// Add custom clients to the context. -func createContext(httpClient *http.Client) context.Context { - parent := oauth2.NoContext - ctx := context.WithValue(parent, oauth2.HTTPClient, httpClient) - return ctx -} diff --git a/samples/client/petstore/go-experimental/fake_api_test.go b/samples/client/petstore/go-experimental/fake_api_test.go deleted file mode 100644 index d27137eeacf..00000000000 --- a/samples/client/petstore/go-experimental/fake_api_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "context" - "testing" - - sw "./go-petstore" -) - -// TestPutBodyWithFileSchema ensures a model with the name 'File' -// gets converted properly to the petstore.File struct vs. *os.File -// as specified in typeMapping for 'File'. -func TestPutBodyWithFileSchema(t *testing.T) { - return // early return to test compilation - - schema := sw.FileSchemaTestClass{ - File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, - Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} - - r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(schema).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} diff --git a/samples/client/petstore/go-experimental/go-petstore/.gitignore b/samples/client/petstore/go-experimental/go-petstore/.gitignore deleted file mode 100644 index daf913b1b34..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES deleted file mode 100644 index dda891d9edb..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES +++ /dev/null @@ -1,119 +0,0 @@ -.gitignore -.travis.yml -README.md -api/openapi.yaml -api_another_fake.go -api_fake.go -api_fake_classname_tags123.go -api_pet.go -api_store.go -api_user.go -client.go -configuration.go -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/Name.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/Return.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -go.mod -go.sum -model_200_response.go -model_additional_properties_any_type.go -model_additional_properties_array.go -model_additional_properties_boolean.go -model_additional_properties_class.go -model_additional_properties_integer.go -model_additional_properties_number.go -model_additional_properties_object.go -model_additional_properties_string.go -model_animal.go -model_api_response.go -model_array_of_array_of_number_only.go -model_array_of_number_only.go -model_array_test_.go -model_big_cat.go -model_big_cat_all_of.go -model_capitalization.go -model_cat.go -model_cat_all_of.go -model_category.go -model_class_model.go -model_client.go -model_dog.go -model_dog_all_of.go -model_enum_arrays.go -model_enum_class.go -model_enum_test_.go -model_file.go -model_file_schema_test_class.go -model_format_test_.go -model_has_only_read_only.go -model_list.go -model_map_test_.go -model_mixed_properties_and_additional_properties_class.go -model_name.go -model_number_only.go -model_order.go -model_outer_composite.go -model_outer_enum.go -model_pet.go -model_read_only_first.go -model_return.go -model_special_model_name.go -model_tag.go -model_type_holder_default.go -model_type_holder_example.go -model_user.go -model_xml_item.go -response.go -utils.go diff --git a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go-experimental/go-petstore/.travis.yml b/samples/client/petstore/go-experimental/go-petstore/.travis.yml deleted file mode 100644 index f5cb2ce9a5a..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ - diff --git a/samples/client/petstore/go-experimental/go-petstore/README.md b/samples/client/petstore/go-experimental/go-petstore/README.md deleted file mode 100644 index ad2c0aa80de..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/README.md +++ /dev/null @@ -1,252 +0,0 @@ -# Go API client for petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -``` - -Put the package under your project folder and add the following in import: - -```golang -import sw "./petstore" -``` - -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. - -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags -*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **Post** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | -*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | -*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | -*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string | -*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **Put** /fake/body-with-file-schema | -*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **Put** /fake/body-with-query-params | -*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters -*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | -*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case -*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet -*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID -*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user -*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name -*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - -## Documentation For Authorization - - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request. - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request. - - -### http_basic_test - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - - -### petstore_auth - - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - - -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: - -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` - -## Author - - - diff --git a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml deleted file mode 100644 index 2fe0565e0a5..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ /dev/null @@ -1,2128 +0,0 @@ -openapi: 3.0.1 -info: - description: 'This spec is mainly for testing Petstore server and contains fake - endpoints, models. Please do not use this for any other purpose. Special characters: - " \' - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - put: - operationId: updatePet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - /pet/findByTags: - get: - deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - uniqueItems: true - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http diff --git a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go deleted file mode 100644 index 171722aaba5..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ /dev/null @@ -1,153 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -) - -// Linger please -var ( - _ _context.Context -) - -type AnotherFakeApi interface { - - /* - * Call123TestSpecialTags To test special tags - * To test special tags and operation ID starting with number - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCall123TestSpecialTagsRequest - */ - Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest - - /* - * Call123TestSpecialTagsExecute executes the request - * @return Client - */ - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) -} - -// AnotherFakeApiService AnotherFakeApi service -type AnotherFakeApiService service - -type ApiCall123TestSpecialTagsRequest struct { - ctx _context.Context - ApiService AnotherFakeApi - body *Client -} - -func (r ApiCall123TestSpecialTagsRequest) Body(body Client) ApiCall123TestSpecialTagsRequest { - r.body = &body - return r -} - -func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { - return r.ApiService.Call123TestSpecialTagsExecute(r) -} - -/* - * Call123TestSpecialTags To test special tags - * To test special tags and operation ID starting with number - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCall123TestSpecialTagsRequest - */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { - return ApiCall123TestSpecialTagsRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Client - */ -func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/another-fake/dummy" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go deleted file mode 100644 index 943ad618f9a..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ /dev/null @@ -1,1944 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "os" - "time" - "reflect" -) - -// Linger please -var ( - _ _context.Context -) - -type FakeApi interface { - - /* - * CreateXmlItem creates an XmlItem - * this route creates an XmlItem - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateXmlItemRequest - */ - CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest - - /* - * CreateXmlItemExecute executes the request - */ - CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) - - /* - * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * Test serialization of outer boolean types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterBooleanSerializeRequest - */ - FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest - - /* - * FakeOuterBooleanSerializeExecute executes the request - * @return bool - */ - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) - - /* - * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * Test serialization of object with outer number type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterCompositeSerializeRequest - */ - FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest - - /* - * FakeOuterCompositeSerializeExecute executes the request - * @return OuterComposite - */ - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) - - /* - * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * Test serialization of outer number types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterNumberSerializeRequest - */ - FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest - - /* - * FakeOuterNumberSerializeExecute executes the request - * @return float32 - */ - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) - - /* - * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * Test serialization of outer string types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterStringSerializeRequest - */ - FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest - - /* - * FakeOuterStringSerializeExecute executes the request - * @return string - */ - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) - - /* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * For this test, the body for this request much reference a schema named `File`. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithFileSchemaRequest - */ - TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest - - /* - * TestBodyWithFileSchemaExecute executes the request - */ - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) - - /* - * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithQueryParamsRequest - */ - TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest - - /* - * TestBodyWithQueryParamsExecute executes the request - */ - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) - - /* - * TestClientModel To test \"client\" model - * To test "client" model - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClientModelRequest - */ - TestClientModel(ctx _context.Context) ApiTestClientModelRequest - - /* - * TestClientModelExecute executes the request - * @return Client - */ - TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) - - /* - * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEndpointParametersRequest - */ - TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest - - /* - * TestEndpointParametersExecute executes the request - */ - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) - - /* - * TestEnumParameters To test enum parameters - * To test enum parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEnumParametersRequest - */ - TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest - - /* - * TestEnumParametersExecute executes the request - */ - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) - - /* - * TestGroupParameters Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestGroupParametersRequest - */ - TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest - - /* - * TestGroupParametersExecute executes the request - */ - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) - - /* - * TestInlineAdditionalProperties test inline additionalProperties - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestInlineAdditionalPropertiesRequest - */ - TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest - - /* - * TestInlineAdditionalPropertiesExecute executes the request - */ - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) - - /* - * TestJsonFormData test json serialization of form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestJsonFormDataRequest - */ - TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest - - /* - * TestJsonFormDataExecute executes the request - */ - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) - - /* - * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * To test the collection format in query parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestQueryParameterCollectionFormatRequest - */ - TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest - - /* - * TestQueryParameterCollectionFormatExecute executes the request - */ - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) -} - -// FakeApiService FakeApi service -type FakeApiService service - -type ApiCreateXmlItemRequest struct { - ctx _context.Context - ApiService FakeApi - xmlItem *XmlItem -} - -func (r ApiCreateXmlItemRequest) XmlItem(xmlItem XmlItem) ApiCreateXmlItemRequest { - r.xmlItem = &xmlItem - return r -} - -func (r ApiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateXmlItemExecute(r) -} - -/* - * CreateXmlItem creates an XmlItem - * this route creates an XmlItem - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateXmlItemRequest - */ -func (a *FakeApiService) CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest { - return ApiCreateXmlItemRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/create_xml_item" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.xmlItem == nil { - return nil, reportError("xmlItem is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.xmlItem - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiFakeOuterBooleanSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *bool -} - -func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBooleanSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { - return r.ApiService.FakeOuterBooleanSerializeExecute(r) -} - -/* - * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * Test serialization of outer boolean types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterBooleanSerializeRequest - */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { - return ApiFakeOuterBooleanSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return bool - */ -func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue bool - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/boolean" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterCompositeSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *OuterComposite -} - -func (r ApiFakeOuterCompositeSerializeRequest) Body(body OuterComposite) ApiFakeOuterCompositeSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { - return r.ApiService.FakeOuterCompositeSerializeExecute(r) -} - -/* - * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * Test serialization of object with outer number type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterCompositeSerializeRequest - */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { - return ApiFakeOuterCompositeSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return OuterComposite - */ -func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OuterComposite - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/composite" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterNumberSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *float32 -} - -func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumberSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { - return r.ApiService.FakeOuterNumberSerializeExecute(r) -} - -/* - * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * Test serialization of outer number types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterNumberSerializeRequest - */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { - return ApiFakeOuterNumberSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return float32 - */ -func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue float32 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/number" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterStringSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *string -} - -func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterStringSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { - return r.ApiService.FakeOuterStringSerializeExecute(r) -} - -/* - * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * Test serialization of outer string types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterStringSerializeRequest - */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { - return ApiFakeOuterStringSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return string - */ -func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/string" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiTestBodyWithFileSchemaRequest struct { - ctx _context.Context - ApiService FakeApi - body *FileSchemaTestClass -} - -func (r ApiTestBodyWithFileSchemaRequest) Body(body FileSchemaTestClass) ApiTestBodyWithFileSchemaRequest { - r.body = &body - return r -} - -func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestBodyWithFileSchemaExecute(r) -} - -/* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * For this test, the body for this request much reference a schema named `File`. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithFileSchemaRequest - */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { - return ApiTestBodyWithFileSchemaRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/body-with-file-schema" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestBodyWithQueryParamsRequest struct { - ctx _context.Context - ApiService FakeApi - query *string - body *User -} - -func (r ApiTestBodyWithQueryParamsRequest) Query(query string) ApiTestBodyWithQueryParamsRequest { - r.query = &query - return r -} -func (r ApiTestBodyWithQueryParamsRequest) Body(body User) ApiTestBodyWithQueryParamsRequest { - r.body = &body - return r -} - -func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestBodyWithQueryParamsExecute(r) -} - -/* - * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithQueryParamsRequest - */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { - return ApiTestBodyWithQueryParamsRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/body-with-query-params" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.query == nil { - return nil, reportError("query is required and must be specified") - } - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - localVarQueryParams.Add("query", parameterToString(*r.query, "")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestClientModelRequest struct { - ctx _context.Context - ApiService FakeApi - body *Client -} - -func (r ApiTestClientModelRequest) Body(body Client) ApiTestClientModelRequest { - r.body = &body - return r -} - -func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { - return r.ApiService.TestClientModelExecute(r) -} - -/* - * TestClientModel To test \"client\" model - * To test "client" model - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClientModelRequest - */ -func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { - return ApiTestClientModelRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Client - */ -func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiTestEndpointParametersRequest struct { - ctx _context.Context - ApiService FakeApi - number *float32 - double *float64 - patternWithoutDelimiter *string - byte_ *string - integer *int32 - int32_ *int32 - int64_ *int64 - float *float32 - string_ *string - binary **os.File - date *string - dateTime *time.Time - password *string - callback *string -} - -func (r ApiTestEndpointParametersRequest) Number(number float32) ApiTestEndpointParametersRequest { - r.number = &number - return r -} -func (r ApiTestEndpointParametersRequest) Double(double float64) ApiTestEndpointParametersRequest { - r.double = &double - return r -} -func (r ApiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) ApiTestEndpointParametersRequest { - r.patternWithoutDelimiter = &patternWithoutDelimiter - return r -} -func (r ApiTestEndpointParametersRequest) Byte_(byte_ string) ApiTestEndpointParametersRequest { - r.byte_ = &byte_ - return r -} -func (r ApiTestEndpointParametersRequest) Integer(integer int32) ApiTestEndpointParametersRequest { - r.integer = &integer - return r -} -func (r ApiTestEndpointParametersRequest) Int32_(int32_ int32) ApiTestEndpointParametersRequest { - r.int32_ = &int32_ - return r -} -func (r ApiTestEndpointParametersRequest) Int64_(int64_ int64) ApiTestEndpointParametersRequest { - r.int64_ = &int64_ - return r -} -func (r ApiTestEndpointParametersRequest) Float(float float32) ApiTestEndpointParametersRequest { - r.float = &float - return r -} -func (r ApiTestEndpointParametersRequest) String_(string_ string) ApiTestEndpointParametersRequest { - r.string_ = &string_ - return r -} -func (r ApiTestEndpointParametersRequest) Binary(binary *os.File) ApiTestEndpointParametersRequest { - r.binary = &binary - return r -} -func (r ApiTestEndpointParametersRequest) Date(date string) ApiTestEndpointParametersRequest { - r.date = &date - return r -} -func (r ApiTestEndpointParametersRequest) DateTime(dateTime time.Time) ApiTestEndpointParametersRequest { - r.dateTime = &dateTime - return r -} -func (r ApiTestEndpointParametersRequest) Password(password string) ApiTestEndpointParametersRequest { - r.password = &password - return r -} -func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpointParametersRequest { - r.callback = &callback - return r -} - -func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestEndpointParametersExecute(r) -} - -/* - * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEndpointParametersRequest - */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { - return ApiTestEndpointParametersRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.number == nil { - return nil, reportError("number is required and must be specified") - } - if *r.number < 32.1 { - return nil, reportError("number must be greater than 32.1") - } - if *r.number > 543.2 { - return nil, reportError("number must be less than 543.2") - } - if r.double == nil { - return nil, reportError("double is required and must be specified") - } - if *r.double < 67.8 { - return nil, reportError("double must be greater than 67.8") - } - if *r.double > 123.4 { - return nil, reportError("double must be less than 123.4") - } - if r.patternWithoutDelimiter == nil { - return nil, reportError("patternWithoutDelimiter is required and must be specified") - } - if r.byte_ == nil { - return nil, reportError("byte_ is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.integer != nil { - localVarFormParams.Add("integer", parameterToString(*r.integer, "")) - } - if r.int32_ != nil { - localVarFormParams.Add("int32", parameterToString(*r.int32_, "")) - } - if r.int64_ != nil { - localVarFormParams.Add("int64", parameterToString(*r.int64_, "")) - } - localVarFormParams.Add("number", parameterToString(*r.number, "")) - if r.float != nil { - localVarFormParams.Add("float", parameterToString(*r.float, "")) - } - localVarFormParams.Add("double", parameterToString(*r.double, "")) - if r.string_ != nil { - localVarFormParams.Add("string", parameterToString(*r.string_, "")) - } - localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, "")) - localVarFormParams.Add("byte", parameterToString(*r.byte_, "")) - localVarFormFileName = "binary" - var localVarFile *os.File - if r.binary != nil { - localVarFile = *r.binary - } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - if r.date != nil { - localVarFormParams.Add("date", parameterToString(*r.date, "")) - } - if r.dateTime != nil { - localVarFormParams.Add("dateTime", parameterToString(*r.dateTime, "")) - } - if r.password != nil { - localVarFormParams.Add("password", parameterToString(*r.password, "")) - } - if r.callback != nil { - localVarFormParams.Add("callback", parameterToString(*r.callback, "")) - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestEnumParametersRequest struct { - ctx _context.Context - ApiService FakeApi - enumHeaderStringArray *[]string - enumHeaderString *string - enumQueryStringArray *[]string - enumQueryString *string - enumQueryInteger *int32 - enumQueryDouble *float64 - enumFormStringArray *[]string - enumFormString *string -} - -func (r ApiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArray []string) ApiTestEnumParametersRequest { - r.enumHeaderStringArray = &enumHeaderStringArray - return r -} -func (r ApiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) ApiTestEnumParametersRequest { - r.enumHeaderString = &enumHeaderString - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) ApiTestEnumParametersRequest { - r.enumQueryStringArray = &enumQueryStringArray - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryString(enumQueryString string) ApiTestEnumParametersRequest { - r.enumQueryString = &enumQueryString - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) ApiTestEnumParametersRequest { - r.enumQueryInteger = &enumQueryInteger - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) ApiTestEnumParametersRequest { - r.enumQueryDouble = &enumQueryDouble - return r -} -func (r ApiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) ApiTestEnumParametersRequest { - r.enumFormStringArray = &enumFormStringArray - return r -} -func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiTestEnumParametersRequest { - r.enumFormString = &enumFormString - return r -} - -func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestEnumParametersExecute(r) -} - -/* - * TestEnumParameters To test enum parameters - * To test enum parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEnumParametersRequest - */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { - return ApiTestEnumParametersRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.enumQueryStringArray != nil { - localVarQueryParams.Add("enum_query_string_array", parameterToString(*r.enumQueryStringArray, "csv")) - } - if r.enumQueryString != nil { - localVarQueryParams.Add("enum_query_string", parameterToString(*r.enumQueryString, "")) - } - if r.enumQueryInteger != nil { - localVarQueryParams.Add("enum_query_integer", parameterToString(*r.enumQueryInteger, "")) - } - if r.enumQueryDouble != nil { - localVarQueryParams.Add("enum_query_double", parameterToString(*r.enumQueryDouble, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.enumHeaderStringArray != nil { - localVarHeaderParams["enum_header_string_array"] = parameterToString(*r.enumHeaderStringArray, "csv") - } - if r.enumHeaderString != nil { - localVarHeaderParams["enum_header_string"] = parameterToString(*r.enumHeaderString, "") - } - if r.enumFormStringArray != nil { - localVarFormParams.Add("enum_form_string_array", parameterToString(*r.enumFormStringArray, "csv")) - } - if r.enumFormString != nil { - localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, "")) - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestGroupParametersRequest struct { - ctx _context.Context - ApiService FakeApi - requiredStringGroup *int32 - requiredBooleanGroup *bool - requiredInt64Group *int64 - stringGroup *int32 - booleanGroup *bool - int64Group *int64 -} - -func (r ApiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup int32) ApiTestGroupParametersRequest { - r.requiredStringGroup = &requiredStringGroup - return r -} -func (r ApiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) ApiTestGroupParametersRequest { - r.requiredBooleanGroup = &requiredBooleanGroup - return r -} -func (r ApiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) ApiTestGroupParametersRequest { - r.requiredInt64Group = &requiredInt64Group - return r -} -func (r ApiTestGroupParametersRequest) StringGroup(stringGroup int32) ApiTestGroupParametersRequest { - r.stringGroup = &stringGroup - return r -} -func (r ApiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) ApiTestGroupParametersRequest { - r.booleanGroup = &booleanGroup - return r -} -func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroupParametersRequest { - r.int64Group = &int64Group - return r -} - -func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestGroupParametersExecute(r) -} - -/* - * TestGroupParameters Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestGroupParametersRequest - */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { - return ApiTestGroupParametersRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.requiredStringGroup == nil { - return nil, reportError("requiredStringGroup is required and must be specified") - } - if r.requiredBooleanGroup == nil { - return nil, reportError("requiredBooleanGroup is required and must be specified") - } - if r.requiredInt64Group == nil { - return nil, reportError("requiredInt64Group is required and must be specified") - } - - localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) - localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, "")) - if r.stringGroup != nil { - localVarQueryParams.Add("string_group", parameterToString(*r.stringGroup, "")) - } - if r.int64Group != nil { - localVarQueryParams.Add("int64_group", parameterToString(*r.int64Group, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - localVarHeaderParams["required_boolean_group"] = parameterToString(*r.requiredBooleanGroup, "") - if r.booleanGroup != nil { - localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "") - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestInlineAdditionalPropertiesRequest struct { - ctx _context.Context - ApiService FakeApi - param *map[string]string -} - -func (r ApiTestInlineAdditionalPropertiesRequest) Param(param map[string]string) ApiTestInlineAdditionalPropertiesRequest { - r.param = ¶m - return r -} - -func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestInlineAdditionalPropertiesExecute(r) -} - -/* - * TestInlineAdditionalProperties test inline additionalProperties - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestInlineAdditionalPropertiesRequest - */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { - return ApiTestInlineAdditionalPropertiesRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/inline-additionalProperties" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.param == nil { - return nil, reportError("param is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.param - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestJsonFormDataRequest struct { - ctx _context.Context - ApiService FakeApi - param *string - param2 *string -} - -func (r ApiTestJsonFormDataRequest) Param(param string) ApiTestJsonFormDataRequest { - r.param = ¶m - return r -} -func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataRequest { - r.param2 = ¶m2 - return r -} - -func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestJsonFormDataExecute(r) -} - -/* - * TestJsonFormData test json serialization of form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestJsonFormDataRequest - */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { - return ApiTestJsonFormDataRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/jsonFormData" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.param == nil { - return nil, reportError("param is required and must be specified") - } - if r.param2 == nil { - return nil, reportError("param2 is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - localVarFormParams.Add("param", parameterToString(*r.param, "")) - localVarFormParams.Add("param2", parameterToString(*r.param2, "")) - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestQueryParameterCollectionFormatRequest struct { - ctx _context.Context - ApiService FakeApi - pipe *[]string - ioutil *[]string - http *[]string - url *[]string - context *[]string -} - -func (r ApiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) ApiTestQueryParameterCollectionFormatRequest { - r.pipe = &pipe - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) ApiTestQueryParameterCollectionFormatRequest { - r.ioutil = &ioutil - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Http(http []string) ApiTestQueryParameterCollectionFormatRequest { - r.http = &http - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Url(url []string) ApiTestQueryParameterCollectionFormatRequest { - r.url = &url - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) ApiTestQueryParameterCollectionFormatRequest { - r.context = &context - return r -} - -func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestQueryParameterCollectionFormatExecute(r) -} - -/* - * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * To test the collection format in query parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestQueryParameterCollectionFormatRequest - */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { - return ApiTestQueryParameterCollectionFormatRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/test-query-paramters" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.pipe == nil { - return nil, reportError("pipe is required and must be specified") - } - if r.ioutil == nil { - return nil, reportError("ioutil is required and must be specified") - } - if r.http == nil { - return nil, reportError("http is required and must be specified") - } - if r.url == nil { - return nil, reportError("url is required and must be specified") - } - if r.context == nil { - return nil, reportError("context is required and must be specified") - } - - localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv")) - localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(*r.http, "ssv")) - localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) - { - t := *r.context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) - } - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go deleted file mode 100644 index 9c80d94ba93..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ /dev/null @@ -1,167 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -) - -// Linger please -var ( - _ _context.Context -) - -type FakeClassnameTags123Api interface { - - /* - * TestClassname To test class name in snake case - * To test class name in snake case - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClassnameRequest - */ - TestClassname(ctx _context.Context) ApiTestClassnameRequest - - /* - * TestClassnameExecute executes the request - * @return Client - */ - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) -} - -// FakeClassnameTags123ApiService FakeClassnameTags123Api service -type FakeClassnameTags123ApiService service - -type ApiTestClassnameRequest struct { - ctx _context.Context - ApiService FakeClassnameTags123Api - body *Client -} - -func (r ApiTestClassnameRequest) Body(body Client) ApiTestClassnameRequest { - r.body = &body - return r -} - -func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { - return r.ApiService.TestClassnameExecute(r) -} - -/* - * TestClassname To test class name in snake case - * To test class name in snake case - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClassnameRequest - */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { - return ApiTestClassnameRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Client - */ -func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake_classname_test" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["api_key_query"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("api_key_query", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/client/petstore/go-experimental/go-petstore/api_pet.go deleted file mode 100644 index d1c359febfd..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api_pet.go +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" - "os" -) - -// Linger please -var ( - _ _context.Context -) - -type PetApi interface { - - /* - * AddPet Add a new pet to the store - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiAddPetRequest - */ - AddPet(ctx _context.Context) ApiAddPetRequest - - /* - * AddPetExecute executes the request - */ - AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) - - /* - * DeletePet Deletes a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId Pet id to delete - * @return ApiDeletePetRequest - */ - DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest - - /* - * DeletePetExecute executes the request - */ - DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) - - /* - * FindPetsByStatus Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByStatusRequest - */ - FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest - - /* - * FindPetsByStatusExecute executes the request - * @return []Pet - */ - FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) - - /* - * FindPetsByTags Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByTagsRequest - */ - FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest - - /* - * FindPetsByTagsExecute executes the request - * @return []Pet - */ - FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) - - /* - * GetPetById Find pet by ID - * Returns a single pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to return - * @return ApiGetPetByIdRequest - */ - GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest - - /* - * GetPetByIdExecute executes the request - * @return Pet - */ - GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) - - /* - * UpdatePet Update an existing pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiUpdatePetRequest - */ - UpdatePet(ctx _context.Context) ApiUpdatePetRequest - - /* - * UpdatePetExecute executes the request - */ - UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) - - /* - * UpdatePetWithForm Updates a pet in the store with form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet that needs to be updated - * @return ApiUpdatePetWithFormRequest - */ - UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest - - /* - * UpdatePetWithFormExecute executes the request - */ - UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) - - /* - * UploadFile uploads an image - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileRequest - */ - UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest - - /* - * UploadFileExecute executes the request - * @return ApiResponse - */ - UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) - - /* - * UploadFileWithRequiredFile uploads an image (required) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileWithRequiredFileRequest - */ - UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest - - /* - * UploadFileWithRequiredFileExecute executes the request - * @return ApiResponse - */ - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) -} - -// PetApiService PetApi service -type PetApiService service - -type ApiAddPetRequest struct { - ctx _context.Context - ApiService PetApi - body *Pet -} - -func (r ApiAddPetRequest) Body(body Pet) ApiAddPetRequest { - r.body = &body - return r -} - -func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.AddPetExecute(r) -} - -/* - * AddPet Add a new pet to the store - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiAddPetRequest - */ -func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { - return ApiAddPetRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeletePetRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - apiKey *string -} - -func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { - r.apiKey = &apiKey - return r -} - -func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.DeletePetExecute(r) -} - -/* - * DeletePet Deletes a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId Pet id to delete - * @return ApiDeletePetRequest - */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { - return ApiDeletePetRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.apiKey != nil { - localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "") - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiFindPetsByStatusRequest struct { - ctx _context.Context - ApiService PetApi - status *[]string -} - -func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusRequest { - r.status = &status - return r -} - -func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { - return r.ApiService.FindPetsByStatusExecute(r) -} - -/* - * FindPetsByStatus Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByStatusRequest - */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { - return ApiFindPetsByStatusRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return []Pet - */ -func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Pet - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/findByStatus" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.status == nil { - return localVarReturnValue, nil, reportError("status is required and must be specified") - } - - localVarQueryParams.Add("status", parameterToString(*r.status, "csv")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFindPetsByTagsRequest struct { - ctx _context.Context - ApiService PetApi - tags *[]string -} - -func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { - r.tags = &tags - return r -} - -func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { - return r.ApiService.FindPetsByTagsExecute(r) -} - -/* - * FindPetsByTags Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByTagsRequest - */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { - return ApiFindPetsByTagsRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return []Pet - */ -func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Pet - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/findByTags" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.tags == nil { - return localVarReturnValue, nil, reportError("tags is required and must be specified") - } - - localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiGetPetByIdRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 -} - - -func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { - return r.ApiService.GetPetByIdExecute(r) -} - -/* - * GetPetById Find pet by ID - * Returns a single pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to return - * @return ApiGetPetByIdRequest - */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { - return ApiGetPetByIdRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - * @return Pet - */ -func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Pet - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["api_key"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["api_key"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUpdatePetRequest struct { - ctx _context.Context - ApiService PetApi - body *Pet -} - -func (r ApiUpdatePetRequest) Body(body Pet) ApiUpdatePetRequest { - r.body = &body - return r -} - -func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.UpdatePetExecute(r) -} - -/* - * UpdatePet Update an existing pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiUpdatePetRequest - */ -func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { - return ApiUpdatePetRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiUpdatePetWithFormRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - name *string - status *string -} - -func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormRequest { - r.name = &name - return r -} -func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest { - r.status = &status - return r -} - -func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.UpdatePetWithFormExecute(r) -} - -/* - * UpdatePetWithForm Updates a pet in the store with form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet that needs to be updated - * @return ApiUpdatePetWithFormRequest - */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { - return ApiUpdatePetWithFormRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.name != nil { - localVarFormParams.Add("name", parameterToString(*r.name, "")) - } - if r.status != nil { - localVarFormParams.Add("status", parameterToString(*r.status, "")) - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiUploadFileRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - additionalMetadata *string - file **os.File -} - -func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileRequest { - r.additionalMetadata = &additionalMetadata - return r -} -func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { - r.file = &file - return r -} - -func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { - return r.ApiService.UploadFileExecute(r) -} - -/* - * UploadFile uploads an image - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileRequest - */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { - return ApiUploadFileRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - * @return ApiResponse - */ -func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApiResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.additionalMetadata != nil { - localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) - } - localVarFormFileName = "file" - var localVarFile *os.File - if r.file != nil { - localVarFile = *r.file - } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUploadFileWithRequiredFileRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - requiredFile **os.File - additionalMetadata *string -} - -func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) ApiUploadFileWithRequiredFileRequest { - r.requiredFile = &requiredFile - return r -} -func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest { - r.additionalMetadata = &additionalMetadata - return r -} - -func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { - return r.ApiService.UploadFileWithRequiredFileExecute(r) -} - -/* - * UploadFileWithRequiredFile uploads an image (required) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileWithRequiredFileRequest - */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { - return ApiUploadFileWithRequiredFileRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - * @return ApiResponse - */ -func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApiResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.requiredFile == nil { - return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.additionalMetadata != nil { - localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) - } - localVarFormFileName = "requiredFile" - localVarFile := *r.requiredFile - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_store.go b/samples/client/petstore/go-experimental/go-petstore/api_store.go deleted file mode 100644 index 900593e388e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api_store.go +++ /dev/null @@ -1,515 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -type StoreApi interface { - - /* - * DeleteOrder Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of the order that needs to be deleted - * @return ApiDeleteOrderRequest - */ - DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest - - /* - * DeleteOrderExecute executes the request - */ - DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) - - /* - * GetInventory Returns pet inventories by status - * Returns a map of status codes to quantities - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetInventoryRequest - */ - GetInventory(ctx _context.Context) ApiGetInventoryRequest - - /* - * GetInventoryExecute executes the request - * @return map[string]int32 - */ - GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) - - /* - * GetOrderById Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of pet that needs to be fetched - * @return ApiGetOrderByIdRequest - */ - GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest - - /* - * GetOrderByIdExecute executes the request - * @return Order - */ - GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) - - /* - * PlaceOrder Place an order for a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPlaceOrderRequest - */ - PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest - - /* - * PlaceOrderExecute executes the request - * @return Order - */ - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) -} - -// StoreApiService StoreApi service -type StoreApiService service - -type ApiDeleteOrderRequest struct { - ctx _context.Context - ApiService StoreApi - orderId string -} - - -func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.DeleteOrderExecute(r) -} - -/* - * DeleteOrder Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of the order that needs to be deleted - * @return ApiDeleteOrderRequest - */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { - return ApiDeleteOrderRequest{ - ApiService: a, - ctx: ctx, - orderId: orderId, - } -} - -/* - * Execute executes the request - */ -func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiGetInventoryRequest struct { - ctx _context.Context - ApiService StoreApi -} - - -func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { - return r.ApiService.GetInventoryExecute(r) -} - -/* - * GetInventory Returns pet inventories by status - * Returns a map of status codes to quantities - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetInventoryRequest - */ -func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { - return ApiGetInventoryRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return map[string]int32 - */ -func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue map[string]int32 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/inventory" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["api_key"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["api_key"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiGetOrderByIdRequest struct { - ctx _context.Context - ApiService StoreApi - orderId int64 -} - - -func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { - return r.ApiService.GetOrderByIdExecute(r) -} - -/* - * GetOrderById Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of pet that needs to be fetched - * @return ApiGetOrderByIdRequest - */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { - return ApiGetOrderByIdRequest{ - ApiService: a, - ctx: ctx, - orderId: orderId, - } -} - -/* - * Execute executes the request - * @return Order - */ -func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Order - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.orderId < 1 { - return localVarReturnValue, nil, reportError("orderId must be greater than 1") - } - if r.orderId > 5 { - return localVarReturnValue, nil, reportError("orderId must be less than 5") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiPlaceOrderRequest struct { - ctx _context.Context - ApiService StoreApi - body *Order -} - -func (r ApiPlaceOrderRequest) Body(body Order) ApiPlaceOrderRequest { - r.body = &body - return r -} - -func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { - return r.ApiService.PlaceOrderExecute(r) -} - -/* - * PlaceOrder Place an order for a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPlaceOrderRequest - */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { - return ApiPlaceOrderRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Order - */ -func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Order - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/order" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return localVarReturnValue, nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_user.go b/samples/client/petstore/go-experimental/go-petstore/api_user.go deleted file mode 100644 index 3f3814d618b..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/api_user.go +++ /dev/null @@ -1,940 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -type UserApi interface { - - /* - * CreateUser Create user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUserRequest - */ - CreateUser(ctx _context.Context) ApiCreateUserRequest - - /* - * CreateUserExecute executes the request - */ - CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) - - /* - * CreateUsersWithArrayInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithArrayInputRequest - */ - CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest - - /* - * CreateUsersWithArrayInputExecute executes the request - */ - CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) - - /* - * CreateUsersWithListInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithListInputRequest - */ - CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest - - /* - * CreateUsersWithListInputExecute executes the request - */ - CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) - - /* - * DeleteUser Delete user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be deleted - * @return ApiDeleteUserRequest - */ - DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest - - /* - * DeleteUserExecute executes the request - */ - DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) - - /* - * GetUserByName Get user by user name - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiGetUserByNameRequest - */ - GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest - - /* - * GetUserByNameExecute executes the request - * @return User - */ - GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) - - /* - * LoginUser Logs user into the system - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLoginUserRequest - */ - LoginUser(ctx _context.Context) ApiLoginUserRequest - - /* - * LoginUserExecute executes the request - * @return string - */ - LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) - - /* - * LogoutUser Logs out current logged in user session - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLogoutUserRequest - */ - LogoutUser(ctx _context.Context) ApiLogoutUserRequest - - /* - * LogoutUserExecute executes the request - */ - LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) - - /* - * UpdateUser Updated user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username name that need to be deleted - * @return ApiUpdateUserRequest - */ - UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest - - /* - * UpdateUserExecute executes the request - */ - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) -} - -// UserApiService UserApi service -type UserApiService service - -type ApiCreateUserRequest struct { - ctx _context.Context - ApiService UserApi - body *User -} - -func (r ApiCreateUserRequest) Body(body User) ApiCreateUserRequest { - r.body = &body - return r -} - -func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateUserExecute(r) -} - -/* - * CreateUser Create user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUserRequest - */ -func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { - return ApiCreateUserRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiCreateUsersWithArrayInputRequest struct { - ctx _context.Context - ApiService UserApi - body *[]User -} - -func (r ApiCreateUsersWithArrayInputRequest) Body(body []User) ApiCreateUsersWithArrayInputRequest { - r.body = &body - return r -} - -func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateUsersWithArrayInputExecute(r) -} - -/* - * CreateUsersWithArrayInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithArrayInputRequest - */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { - return ApiCreateUsersWithArrayInputRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/createWithArray" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiCreateUsersWithListInputRequest struct { - ctx _context.Context - ApiService UserApi - body *[]User -} - -func (r ApiCreateUsersWithListInputRequest) Body(body []User) ApiCreateUsersWithListInputRequest { - r.body = &body - return r -} - -func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateUsersWithListInputExecute(r) -} - -/* - * CreateUsersWithListInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithListInputRequest - */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { - return ApiCreateUsersWithListInputRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/createWithList" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteUserRequest struct { - ctx _context.Context - ApiService UserApi - username string -} - - -func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.DeleteUserExecute(r) -} - -/* - * DeleteUser Delete user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be deleted - * @return ApiDeleteUserRequest - */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { - return ApiDeleteUserRequest{ - ApiService: a, - ctx: ctx, - username: username, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiGetUserByNameRequest struct { - ctx _context.Context - ApiService UserApi - username string -} - - -func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { - return r.ApiService.GetUserByNameExecute(r) -} - -/* - * GetUserByName Get user by user name - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiGetUserByNameRequest - */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { - return ApiGetUserByNameRequest{ - ApiService: a, - ctx: ctx, - username: username, - } -} - -/* - * Execute executes the request - * @return User - */ -func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiLoginUserRequest struct { - ctx _context.Context - ApiService UserApi - username *string - password *string -} - -func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest { - r.username = &username - return r -} -func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { - r.password = &password - return r -} - -func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { - return r.ApiService.LoginUserExecute(r) -} - -/* - * LoginUser Logs user into the system - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLoginUserRequest - */ -func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { - return ApiLoginUserRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return string - */ -func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/login" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.username == nil { - return localVarReturnValue, nil, reportError("username is required and must be specified") - } - if r.password == nil { - return localVarReturnValue, nil, reportError("password is required and must be specified") - } - - localVarQueryParams.Add("username", parameterToString(*r.username, "")) - localVarQueryParams.Add("password", parameterToString(*r.password, "")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiLogoutUserRequest struct { - ctx _context.Context - ApiService UserApi -} - - -func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.LogoutUserExecute(r) -} - -/* - * LogoutUser Logs out current logged in user session - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLogoutUserRequest - */ -func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { - return ApiLogoutUserRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/logout" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiUpdateUserRequest struct { - ctx _context.Context - ApiService UserApi - username string - body *User -} - -func (r ApiUpdateUserRequest) Body(body User) ApiUpdateUserRequest { - r.body = &body - return r -} - -func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.UpdateUserExecute(r) -} - -/* - * UpdateUser Updated user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username name that need to be deleted - * @return ApiUpdateUserRequest - */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { - return ApiUpdateUserRequest{ - ApiService: a, - ctx: ctx, - username: username, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.body == nil { - return nil, reportError("body is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go-experimental/go-petstore/client.go b/samples/client/petstore/go-experimental/go-petstore/client.go deleted file mode 100644 index 3c87567745c..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/client.go +++ /dev/null @@ -1,548 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "golang.org/x/oauth2" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) -) - -// APIClient manages communication with the OpenAPI Petstore API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - AnotherFakeApi AnotherFakeApi - - FakeApi FakeApi - - FakeClassnameTags123Api FakeClassnameTags123Api - - PetApi PetApi - - StoreApi StoreApi - - UserApi UserApi -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) - c.FakeApi = (*FakeApiService)(&c.common) - c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) - c.PetApi = (*PetApiService)(&c.common) - c.StoreApi = (*StoreApiService)(&c.common) - c.UserApi = (*UserApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) - } - - return fmt.Sprintf("%v", obj) -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err!= nil { - return err - } - } else { - errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} diff --git a/samples/client/petstore/go-experimental/go-petstore/configuration.go b/samples/client/petstore/go-experimental/go-petstore/configuration.go deleted file mode 100644 index 4c503f92637..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/configuration.go +++ /dev/null @@ -1,229 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: ServerConfigurations{ - { - URL: "http://petstore.swagger.io:80/v2", - Description: "No description provided", - }, - }, - OperationServers: map[string]ServerConfigurations{ - }, - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index bcce58bb763..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesAnyType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesAnyType - -`func NewAdditionalPropertiesAnyType() *AdditionalPropertiesAnyType` - -NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesAnyTypeWithDefaults - -`func NewAdditionalPropertiesAnyTypeWithDefaults() *AdditionalPropertiesAnyType` - -NewAdditionalPropertiesAnyTypeWithDefaults instantiates a new AdditionalPropertiesAnyType object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesAnyType) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesAnyType) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesAnyType) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesAnyType) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 9b01a34cbbf..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesArray - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesArray - -`func NewAdditionalPropertiesArray() *AdditionalPropertiesArray` - -NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesArrayWithDefaults - -`func NewAdditionalPropertiesArrayWithDefaults() *AdditionalPropertiesArray` - -NewAdditionalPropertiesArrayWithDefaults instantiates a new AdditionalPropertiesArray object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesArray) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesArray) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesArray) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesArray) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index da3ebcea97e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesBoolean - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesBoolean - -`func NewAdditionalPropertiesBoolean() *AdditionalPropertiesBoolean` - -NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesBooleanWithDefaults - -`func NewAdditionalPropertiesBooleanWithDefaults() *AdditionalPropertiesBoolean` - -NewAdditionalPropertiesBooleanWithDefaults instantiates a new AdditionalPropertiesBoolean object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesBoolean) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesBoolean) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesBoolean) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesBoolean) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md deleted file mode 100644 index a035ff98c8f..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,316 +0,0 @@ -# AdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MapString** | Pointer to **map[string]string** | | [optional] -**MapNumber** | Pointer to **map[string]float32** | | [optional] -**MapInteger** | Pointer to **map[string]int32** | | [optional] -**MapBoolean** | Pointer to **map[string]bool** | | [optional] -**MapArrayInteger** | Pointer to [**map[string][]int32**](array.md) | | [optional] -**MapArrayAnytype** | Pointer to [**map[string][]map[string]interface{}**](array.md) | | [optional] -**MapMapString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapMapAnytype** | Pointer to [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] -**Anytype1** | Pointer to **map[string]interface{}** | | [optional] -**Anytype2** | Pointer to **map[string]interface{}** | | [optional] -**Anytype3** | Pointer to **map[string]interface{}** | | [optional] - -## Methods - -### NewAdditionalPropertiesClass - -`func NewAdditionalPropertiesClass() *AdditionalPropertiesClass` - -NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesClassWithDefaults - -`func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass` - -NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMapString - -`func (o *AdditionalPropertiesClass) GetMapString() map[string]string` - -GetMapString returns the MapString field if non-nil, zero value otherwise. - -### GetMapStringOk - -`func (o *AdditionalPropertiesClass) GetMapStringOk() (*map[string]string, bool)` - -GetMapStringOk returns a tuple with the MapString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapString - -`func (o *AdditionalPropertiesClass) SetMapString(v map[string]string)` - -SetMapString sets MapString field to given value. - -### HasMapString - -`func (o *AdditionalPropertiesClass) HasMapString() bool` - -HasMapString returns a boolean if a field has been set. - -### GetMapNumber - -`func (o *AdditionalPropertiesClass) GetMapNumber() map[string]float32` - -GetMapNumber returns the MapNumber field if non-nil, zero value otherwise. - -### GetMapNumberOk - -`func (o *AdditionalPropertiesClass) GetMapNumberOk() (*map[string]float32, bool)` - -GetMapNumberOk returns a tuple with the MapNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapNumber - -`func (o *AdditionalPropertiesClass) SetMapNumber(v map[string]float32)` - -SetMapNumber sets MapNumber field to given value. - -### HasMapNumber - -`func (o *AdditionalPropertiesClass) HasMapNumber() bool` - -HasMapNumber returns a boolean if a field has been set. - -### GetMapInteger - -`func (o *AdditionalPropertiesClass) GetMapInteger() map[string]int32` - -GetMapInteger returns the MapInteger field if non-nil, zero value otherwise. - -### GetMapIntegerOk - -`func (o *AdditionalPropertiesClass) GetMapIntegerOk() (*map[string]int32, bool)` - -GetMapIntegerOk returns a tuple with the MapInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapInteger - -`func (o *AdditionalPropertiesClass) SetMapInteger(v map[string]int32)` - -SetMapInteger sets MapInteger field to given value. - -### HasMapInteger - -`func (o *AdditionalPropertiesClass) HasMapInteger() bool` - -HasMapInteger returns a boolean if a field has been set. - -### GetMapBoolean - -`func (o *AdditionalPropertiesClass) GetMapBoolean() map[string]bool` - -GetMapBoolean returns the MapBoolean field if non-nil, zero value otherwise. - -### GetMapBooleanOk - -`func (o *AdditionalPropertiesClass) GetMapBooleanOk() (*map[string]bool, bool)` - -GetMapBooleanOk returns a tuple with the MapBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapBoolean - -`func (o *AdditionalPropertiesClass) SetMapBoolean(v map[string]bool)` - -SetMapBoolean sets MapBoolean field to given value. - -### HasMapBoolean - -`func (o *AdditionalPropertiesClass) HasMapBoolean() bool` - -HasMapBoolean returns a boolean if a field has been set. - -### GetMapArrayInteger - -`func (o *AdditionalPropertiesClass) GetMapArrayInteger() map[string][]int32` - -GetMapArrayInteger returns the MapArrayInteger field if non-nil, zero value otherwise. - -### GetMapArrayIntegerOk - -`func (o *AdditionalPropertiesClass) GetMapArrayIntegerOk() (*map[string][]int32, bool)` - -GetMapArrayIntegerOk returns a tuple with the MapArrayInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapArrayInteger - -`func (o *AdditionalPropertiesClass) SetMapArrayInteger(v map[string][]int32)` - -SetMapArrayInteger sets MapArrayInteger field to given value. - -### HasMapArrayInteger - -`func (o *AdditionalPropertiesClass) HasMapArrayInteger() bool` - -HasMapArrayInteger returns a boolean if a field has been set. - -### GetMapArrayAnytype - -`func (o *AdditionalPropertiesClass) GetMapArrayAnytype() map[string][]map[string]interface{}` - -GetMapArrayAnytype returns the MapArrayAnytype field if non-nil, zero value otherwise. - -### GetMapArrayAnytypeOk - -`func (o *AdditionalPropertiesClass) GetMapArrayAnytypeOk() (*map[string][]map[string]interface{}, bool)` - -GetMapArrayAnytypeOk returns a tuple with the MapArrayAnytype field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapArrayAnytype - -`func (o *AdditionalPropertiesClass) SetMapArrayAnytype(v map[string][]map[string]interface{})` - -SetMapArrayAnytype sets MapArrayAnytype field to given value. - -### HasMapArrayAnytype - -`func (o *AdditionalPropertiesClass) HasMapArrayAnytype() bool` - -HasMapArrayAnytype returns a boolean if a field has been set. - -### GetMapMapString - -`func (o *AdditionalPropertiesClass) GetMapMapString() map[string]map[string]string` - -GetMapMapString returns the MapMapString field if non-nil, zero value otherwise. - -### GetMapMapStringOk - -`func (o *AdditionalPropertiesClass) GetMapMapStringOk() (*map[string]map[string]string, bool)` - -GetMapMapStringOk returns a tuple with the MapMapString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapMapString - -`func (o *AdditionalPropertiesClass) SetMapMapString(v map[string]map[string]string)` - -SetMapMapString sets MapMapString field to given value. - -### HasMapMapString - -`func (o *AdditionalPropertiesClass) HasMapMapString() bool` - -HasMapMapString returns a boolean if a field has been set. - -### GetMapMapAnytype - -`func (o *AdditionalPropertiesClass) GetMapMapAnytype() map[string]map[string]map[string]interface{}` - -GetMapMapAnytype returns the MapMapAnytype field if non-nil, zero value otherwise. - -### GetMapMapAnytypeOk - -`func (o *AdditionalPropertiesClass) GetMapMapAnytypeOk() (*map[string]map[string]map[string]interface{}, bool)` - -GetMapMapAnytypeOk returns a tuple with the MapMapAnytype field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapMapAnytype - -`func (o *AdditionalPropertiesClass) SetMapMapAnytype(v map[string]map[string]map[string]interface{})` - -SetMapMapAnytype sets MapMapAnytype field to given value. - -### HasMapMapAnytype - -`func (o *AdditionalPropertiesClass) HasMapMapAnytype() bool` - -HasMapMapAnytype returns a boolean if a field has been set. - -### GetAnytype1 - -`func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{}` - -GetAnytype1 returns the Anytype1 field if non-nil, zero value otherwise. - -### GetAnytype1Ok - -`func (o *AdditionalPropertiesClass) GetAnytype1Ok() (*map[string]interface{}, bool)` - -GetAnytype1Ok returns a tuple with the Anytype1 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAnytype1 - -`func (o *AdditionalPropertiesClass) SetAnytype1(v map[string]interface{})` - -SetAnytype1 sets Anytype1 field to given value. - -### HasAnytype1 - -`func (o *AdditionalPropertiesClass) HasAnytype1() bool` - -HasAnytype1 returns a boolean if a field has been set. - -### GetAnytype2 - -`func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{}` - -GetAnytype2 returns the Anytype2 field if non-nil, zero value otherwise. - -### GetAnytype2Ok - -`func (o *AdditionalPropertiesClass) GetAnytype2Ok() (*map[string]interface{}, bool)` - -GetAnytype2Ok returns a tuple with the Anytype2 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAnytype2 - -`func (o *AdditionalPropertiesClass) SetAnytype2(v map[string]interface{})` - -SetAnytype2 sets Anytype2 field to given value. - -### HasAnytype2 - -`func (o *AdditionalPropertiesClass) HasAnytype2() bool` - -HasAnytype2 returns a boolean if a field has been set. - -### GetAnytype3 - -`func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{}` - -GetAnytype3 returns the Anytype3 field if non-nil, zero value otherwise. - -### GetAnytype3Ok - -`func (o *AdditionalPropertiesClass) GetAnytype3Ok() (*map[string]interface{}, bool)` - -GetAnytype3Ok returns a tuple with the Anytype3 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAnytype3 - -`func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{})` - -SetAnytype3 sets Anytype3 field to given value. - -### HasAnytype3 - -`func (o *AdditionalPropertiesClass) HasAnytype3() bool` - -HasAnytype3 returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 68d29ef339a..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesInteger - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesInteger - -`func NewAdditionalPropertiesInteger() *AdditionalPropertiesInteger` - -NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesIntegerWithDefaults - -`func NewAdditionalPropertiesIntegerWithDefaults() *AdditionalPropertiesInteger` - -NewAdditionalPropertiesIntegerWithDefaults instantiates a new AdditionalPropertiesInteger object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesInteger) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesInteger) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesInteger) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesInteger) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 53fb9c858c0..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesNumber - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesNumber - -`func NewAdditionalPropertiesNumber() *AdditionalPropertiesNumber` - -NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesNumberWithDefaults - -`func NewAdditionalPropertiesNumberWithDefaults() *AdditionalPropertiesNumber` - -NewAdditionalPropertiesNumberWithDefaults instantiates a new AdditionalPropertiesNumber object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesNumber) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesNumber) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesNumber) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesNumber) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md deleted file mode 100644 index 8444c127941..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesObject - -`func NewAdditionalPropertiesObject() *AdditionalPropertiesObject` - -NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesObjectWithDefaults - -`func NewAdditionalPropertiesObjectWithDefaults() *AdditionalPropertiesObject` - -NewAdditionalPropertiesObjectWithDefaults instantiates a new AdditionalPropertiesObject object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesObject) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesObject) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesObject) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesObject) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md b/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md deleted file mode 100644 index 6a95762122b..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,56 +0,0 @@ -# AdditionalPropertiesString - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewAdditionalPropertiesString - -`func NewAdditionalPropertiesString() *AdditionalPropertiesString` - -NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesStringWithDefaults - -`func NewAdditionalPropertiesStringWithDefaults() *AdditionalPropertiesString` - -NewAdditionalPropertiesStringWithDefaults instantiates a new AdditionalPropertiesString object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *AdditionalPropertiesString) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *AdditionalPropertiesString) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *AdditionalPropertiesString) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *AdditionalPropertiesString) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Animal.md b/samples/client/petstore/go-experimental/go-petstore/docs/Animal.md deleted file mode 100644 index 293f75c5171..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Animal.md +++ /dev/null @@ -1,77 +0,0 @@ -# Animal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | Pointer to **string** | | [optional] [default to "red"] - -## Methods - -### NewAnimal - -`func NewAnimal(className string, ) *Animal` - -NewAnimal instantiates a new Animal object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAnimalWithDefaults - -`func NewAnimalWithDefaults() *Animal` - -NewAnimalWithDefaults instantiates a new Animal object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetClassName - -`func (o *Animal) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *Animal) GetClassNameOk() (*string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClassName - -`func (o *Animal) SetClassName(v string)` - -SetClassName sets ClassName field to given value. - - -### GetColor - -`func (o *Animal) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *Animal) GetColorOk() (*string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetColor - -`func (o *Animal) SetColor(v string)` - -SetColor sets Color field to given value. - -### HasColor - -`func (o *Animal) HasColor() bool` - -HasColor returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md b/samples/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md deleted file mode 100644 index 669daa616b7..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md +++ /dev/null @@ -1,75 +0,0 @@ -# \AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**Call123TestSpecialTags**](AnotherFakeApi.md#Call123TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags - - - -## Call123TestSpecialTags - -> Client Call123TestSpecialTags(ctx).Body(body).Execute() - -To test special tags - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.Client{Client: "Client_example"} // Client | client model - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `Call123TestSpecialTags`: Client - fmt.Fprintf(os.Stdout, "Response from `AnotherFakeApi.Call123TestSpecialTags`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCall123TestSpecialTagsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md b/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md deleted file mode 100644 index 877dacb4293..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md +++ /dev/null @@ -1,108 +0,0 @@ -# ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | Pointer to **int32** | | [optional] -**Type** | Pointer to **string** | | [optional] -**Message** | Pointer to **string** | | [optional] - -## Methods - -### NewApiResponse - -`func NewApiResponse() *ApiResponse` - -NewApiResponse instantiates a new ApiResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewApiResponseWithDefaults - -`func NewApiResponseWithDefaults() *ApiResponse` - -NewApiResponseWithDefaults instantiates a new ApiResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCode - -`func (o *ApiResponse) GetCode() int32` - -GetCode returns the Code field if non-nil, zero value otherwise. - -### GetCodeOk - -`func (o *ApiResponse) GetCodeOk() (*int32, bool)` - -GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCode - -`func (o *ApiResponse) SetCode(v int32)` - -SetCode sets Code field to given value. - -### HasCode - -`func (o *ApiResponse) HasCode() bool` - -HasCode returns a boolean if a field has been set. - -### GetType - -`func (o *ApiResponse) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ApiResponse) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ApiResponse) SetType(v string)` - -SetType sets Type field to given value. - -### HasType - -`func (o *ApiResponse) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetMessage - -`func (o *ApiResponse) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ApiResponse) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ApiResponse) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *ApiResponse) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index cb46da598b1..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,56 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] - -## Methods - -### NewArrayOfArrayOfNumberOnly - -`func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly` - -NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArrayOfArrayOfNumberOnlyWithDefaults - -`func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly` - -NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetArrayArrayNumber - -`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32` - -GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. - -### GetArrayArrayNumberOk - -`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool)` - -GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayArrayNumber - -`func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32)` - -SetArrayArrayNumber sets ArrayArrayNumber field to given value. - -### HasArrayArrayNumber - -`func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool` - -HasArrayArrayNumber returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f0aaaa443b3..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,56 +0,0 @@ -# ArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayNumber** | Pointer to **[]float32** | | [optional] - -## Methods - -### NewArrayOfNumberOnly - -`func NewArrayOfNumberOnly() *ArrayOfNumberOnly` - -NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArrayOfNumberOnlyWithDefaults - -`func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly` - -NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetArrayNumber - -`func (o *ArrayOfNumberOnly) GetArrayNumber() []float32` - -GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. - -### GetArrayNumberOk - -`func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool)` - -GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayNumber - -`func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32)` - -SetArrayNumber sets ArrayNumber field to given value. - -### HasArrayNumber - -`func (o *ArrayOfNumberOnly) HasArrayNumber() bool` - -HasArrayNumber returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md deleted file mode 100644 index a0f8d7528c3..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md +++ /dev/null @@ -1,108 +0,0 @@ -# ArrayTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayOfString** | Pointer to **[]string** | | [optional] -**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] - -## Methods - -### NewArrayTest - -`func NewArrayTest() *ArrayTest` - -NewArrayTest instantiates a new ArrayTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArrayTestWithDefaults - -`func NewArrayTestWithDefaults() *ArrayTest` - -NewArrayTestWithDefaults instantiates a new ArrayTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetArrayOfString - -`func (o *ArrayTest) GetArrayOfString() []string` - -GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. - -### GetArrayOfStringOk - -`func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool)` - -GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayOfString - -`func (o *ArrayTest) SetArrayOfString(v []string)` - -SetArrayOfString sets ArrayOfString field to given value. - -### HasArrayOfString - -`func (o *ArrayTest) HasArrayOfString() bool` - -HasArrayOfString returns a boolean if a field has been set. - -### GetArrayArrayOfInteger - -`func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64` - -GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. - -### GetArrayArrayOfIntegerOk - -`func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool)` - -GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayArrayOfInteger - -`func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64)` - -SetArrayArrayOfInteger sets ArrayArrayOfInteger field to given value. - -### HasArrayArrayOfInteger - -`func (o *ArrayTest) HasArrayArrayOfInteger() bool` - -HasArrayArrayOfInteger returns a boolean if a field has been set. - -### GetArrayArrayOfModel - -`func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst` - -GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. - -### GetArrayArrayOfModelOk - -`func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool)` - -GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayArrayOfModel - -`func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst)` - -SetArrayArrayOfModel sets ArrayArrayOfModel field to given value. - -### HasArrayArrayOfModel - -`func (o *ArrayTest) HasArrayArrayOfModel() bool` - -HasArrayArrayOfModel returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md b/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md deleted file mode 100644 index fb9db929939..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md +++ /dev/null @@ -1,56 +0,0 @@ -# BigCat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Kind** | Pointer to **string** | | [optional] - -## Methods - -### NewBigCat - -`func NewBigCat() *BigCat` - -NewBigCat instantiates a new BigCat object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBigCatWithDefaults - -`func NewBigCatWithDefaults() *BigCat` - -NewBigCatWithDefaults instantiates a new BigCat object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetKind - -`func (o *BigCat) GetKind() string` - -GetKind returns the Kind field if non-nil, zero value otherwise. - -### GetKindOk - -`func (o *BigCat) GetKindOk() (*string, bool)` - -GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKind - -`func (o *BigCat) SetKind(v string)` - -SetKind sets Kind field to given value. - -### HasKind - -`func (o *BigCat) HasKind() bool` - -HasKind returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md deleted file mode 100644 index b237a6b2144..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/BigCatAllOf.md +++ /dev/null @@ -1,56 +0,0 @@ -# BigCatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Kind** | Pointer to **string** | | [optional] - -## Methods - -### NewBigCatAllOf - -`func NewBigCatAllOf() *BigCatAllOf` - -NewBigCatAllOf instantiates a new BigCatAllOf object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewBigCatAllOfWithDefaults - -`func NewBigCatAllOfWithDefaults() *BigCatAllOf` - -NewBigCatAllOfWithDefaults instantiates a new BigCatAllOf object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetKind - -`func (o *BigCatAllOf) GetKind() string` - -GetKind returns the Kind field if non-nil, zero value otherwise. - -### GetKindOk - -`func (o *BigCatAllOf) GetKindOk() (*string, bool)` - -GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKind - -`func (o *BigCatAllOf) SetKind(v string)` - -SetKind sets Kind field to given value. - -### HasKind - -`func (o *BigCatAllOf) HasKind() bool` - -HasKind returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md b/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md deleted file mode 100644 index 3f37bb13e00..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Capitalization.md +++ /dev/null @@ -1,186 +0,0 @@ -# Capitalization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SmallCamel** | Pointer to **string** | | [optional] -**CapitalCamel** | Pointer to **string** | | [optional] -**SmallSnake** | Pointer to **string** | | [optional] -**CapitalSnake** | Pointer to **string** | | [optional] -**SCAETHFlowPoints** | Pointer to **string** | | [optional] -**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] - -## Methods - -### NewCapitalization - -`func NewCapitalization() *Capitalization` - -NewCapitalization instantiates a new Capitalization object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCapitalizationWithDefaults - -`func NewCapitalizationWithDefaults() *Capitalization` - -NewCapitalizationWithDefaults instantiates a new Capitalization object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSmallCamel - -`func (o *Capitalization) GetSmallCamel() string` - -GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. - -### GetSmallCamelOk - -`func (o *Capitalization) GetSmallCamelOk() (*string, bool)` - -GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSmallCamel - -`func (o *Capitalization) SetSmallCamel(v string)` - -SetSmallCamel sets SmallCamel field to given value. - -### HasSmallCamel - -`func (o *Capitalization) HasSmallCamel() bool` - -HasSmallCamel returns a boolean if a field has been set. - -### GetCapitalCamel - -`func (o *Capitalization) GetCapitalCamel() string` - -GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. - -### GetCapitalCamelOk - -`func (o *Capitalization) GetCapitalCamelOk() (*string, bool)` - -GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCapitalCamel - -`func (o *Capitalization) SetCapitalCamel(v string)` - -SetCapitalCamel sets CapitalCamel field to given value. - -### HasCapitalCamel - -`func (o *Capitalization) HasCapitalCamel() bool` - -HasCapitalCamel returns a boolean if a field has been set. - -### GetSmallSnake - -`func (o *Capitalization) GetSmallSnake() string` - -GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. - -### GetSmallSnakeOk - -`func (o *Capitalization) GetSmallSnakeOk() (*string, bool)` - -GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSmallSnake - -`func (o *Capitalization) SetSmallSnake(v string)` - -SetSmallSnake sets SmallSnake field to given value. - -### HasSmallSnake - -`func (o *Capitalization) HasSmallSnake() bool` - -HasSmallSnake returns a boolean if a field has been set. - -### GetCapitalSnake - -`func (o *Capitalization) GetCapitalSnake() string` - -GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. - -### GetCapitalSnakeOk - -`func (o *Capitalization) GetCapitalSnakeOk() (*string, bool)` - -GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCapitalSnake - -`func (o *Capitalization) SetCapitalSnake(v string)` - -SetCapitalSnake sets CapitalSnake field to given value. - -### HasCapitalSnake - -`func (o *Capitalization) HasCapitalSnake() bool` - -HasCapitalSnake returns a boolean if a field has been set. - -### GetSCAETHFlowPoints - -`func (o *Capitalization) GetSCAETHFlowPoints() string` - -GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. - -### GetSCAETHFlowPointsOk - -`func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool)` - -GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSCAETHFlowPoints - -`func (o *Capitalization) SetSCAETHFlowPoints(v string)` - -SetSCAETHFlowPoints sets SCAETHFlowPoints field to given value. - -### HasSCAETHFlowPoints - -`func (o *Capitalization) HasSCAETHFlowPoints() bool` - -HasSCAETHFlowPoints returns a boolean if a field has been set. - -### GetATT_NAME - -`func (o *Capitalization) GetATT_NAME() string` - -GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. - -### GetATT_NAMEOk - -`func (o *Capitalization) GetATT_NAMEOk() (*string, bool)` - -GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetATT_NAME - -`func (o *Capitalization) SetATT_NAME(v string)` - -SetATT_NAME sets ATT_NAME field to given value. - -### HasATT_NAME - -`func (o *Capitalization) HasATT_NAME() bool` - -HasATT_NAME returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md deleted file mode 100644 index 9f7f4f783cb..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md +++ /dev/null @@ -1,56 +0,0 @@ -# Cat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Declawed** | Pointer to **bool** | | [optional] - -## Methods - -### NewCat - -`func NewCat() *Cat` - -NewCat instantiates a new Cat object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCatWithDefaults - -`func NewCatWithDefaults() *Cat` - -NewCatWithDefaults instantiates a new Cat object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDeclawed - -`func (o *Cat) GetDeclawed() bool` - -GetDeclawed returns the Declawed field if non-nil, zero value otherwise. - -### GetDeclawedOk - -`func (o *Cat) GetDeclawedOk() (*bool, bool)` - -GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeclawed - -`func (o *Cat) SetDeclawed(v bool)` - -SetDeclawed sets Declawed field to given value. - -### HasDeclawed - -`func (o *Cat) HasDeclawed() bool` - -HasDeclawed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md deleted file mode 100644 index be0cc6c8519..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md +++ /dev/null @@ -1,56 +0,0 @@ -# CatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Declawed** | Pointer to **bool** | | [optional] - -## Methods - -### NewCatAllOf - -`func NewCatAllOf() *CatAllOf` - -NewCatAllOf instantiates a new CatAllOf object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCatAllOfWithDefaults - -`func NewCatAllOfWithDefaults() *CatAllOf` - -NewCatAllOfWithDefaults instantiates a new CatAllOf object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDeclawed - -`func (o *CatAllOf) GetDeclawed() bool` - -GetDeclawed returns the Declawed field if non-nil, zero value otherwise. - -### GetDeclawedOk - -`func (o *CatAllOf) GetDeclawedOk() (*bool, bool)` - -GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeclawed - -`func (o *CatAllOf) SetDeclawed(v bool)` - -SetDeclawed sets Declawed field to given value. - -### HasDeclawed - -`func (o *CatAllOf) HasDeclawed() bool` - -HasDeclawed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Category.md b/samples/client/petstore/go-experimental/go-petstore/docs/Category.md deleted file mode 100644 index 0d3f6d4ff22..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Category.md +++ /dev/null @@ -1,77 +0,0 @@ -# Category - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | **string** | | [default to "default-name"] - -## Methods - -### NewCategory - -`func NewCategory(name string, ) *Category` - -NewCategory instantiates a new Category object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCategoryWithDefaults - -`func NewCategoryWithDefaults() *Category` - -NewCategoryWithDefaults instantiates a new Category object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Category) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Category) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Category) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Category) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *Category) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Category) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Category) SetName(v string)` - -SetName sets Name field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md b/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md deleted file mode 100644 index 51954107bc0..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ClassModel.md +++ /dev/null @@ -1,56 +0,0 @@ -# ClassModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Class** | Pointer to **string** | | [optional] - -## Methods - -### NewClassModel - -`func NewClassModel() *ClassModel` - -NewClassModel instantiates a new ClassModel object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewClassModelWithDefaults - -`func NewClassModelWithDefaults() *ClassModel` - -NewClassModelWithDefaults instantiates a new ClassModel object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetClass - -`func (o *ClassModel) GetClass() string` - -GetClass returns the Class field if non-nil, zero value otherwise. - -### GetClassOk - -`func (o *ClassModel) GetClassOk() (*string, bool)` - -GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClass - -`func (o *ClassModel) SetClass(v string)` - -SetClass sets Class field to given value. - -### HasClass - -`func (o *ClassModel) HasClass() bool` - -HasClass returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Client.md b/samples/client/petstore/go-experimental/go-petstore/docs/Client.md deleted file mode 100644 index e24e7c05be5..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Client.md +++ /dev/null @@ -1,56 +0,0 @@ -# Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Client** | Pointer to **string** | | [optional] - -## Methods - -### NewClient - -`func NewClient() *Client` - -NewClient instantiates a new Client object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewClientWithDefaults - -`func NewClientWithDefaults() *Client` - -NewClientWithDefaults instantiates a new Client object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetClient - -`func (o *Client) GetClient() string` - -GetClient returns the Client field if non-nil, zero value otherwise. - -### GetClientOk - -`func (o *Client) GetClientOk() (*string, bool)` - -GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClient - -`func (o *Client) SetClient(v string)` - -SetClient sets Client field to given value. - -### HasClient - -`func (o *Client) HasClient() bool` - -HasClient returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md deleted file mode 100644 index edf746aaf55..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md +++ /dev/null @@ -1,56 +0,0 @@ -# Dog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Breed** | Pointer to **string** | | [optional] - -## Methods - -### NewDog - -`func NewDog() *Dog` - -NewDog instantiates a new Dog object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDogWithDefaults - -`func NewDogWithDefaults() *Dog` - -NewDogWithDefaults instantiates a new Dog object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBreed - -`func (o *Dog) GetBreed() string` - -GetBreed returns the Breed field if non-nil, zero value otherwise. - -### GetBreedOk - -`func (o *Dog) GetBreedOk() (*string, bool)` - -GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBreed - -`func (o *Dog) SetBreed(v string)` - -SetBreed sets Breed field to given value. - -### HasBreed - -`func (o *Dog) HasBreed() bool` - -HasBreed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md b/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md deleted file mode 100644 index 3ed4dfa5ea2..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md +++ /dev/null @@ -1,56 +0,0 @@ -# DogAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Breed** | Pointer to **string** | | [optional] - -## Methods - -### NewDogAllOf - -`func NewDogAllOf() *DogAllOf` - -NewDogAllOf instantiates a new DogAllOf object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDogAllOfWithDefaults - -`func NewDogAllOfWithDefaults() *DogAllOf` - -NewDogAllOfWithDefaults instantiates a new DogAllOf object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBreed - -`func (o *DogAllOf) GetBreed() string` - -GetBreed returns the Breed field if non-nil, zero value otherwise. - -### GetBreedOk - -`func (o *DogAllOf) GetBreedOk() (*string, bool)` - -GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBreed - -`func (o *DogAllOf) SetBreed(v string)` - -SetBreed sets Breed field to given value. - -### HasBreed - -`func (o *DogAllOf) HasBreed() bool` - -HasBreed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md deleted file mode 100644 index 28011e23f56..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md +++ /dev/null @@ -1,82 +0,0 @@ -# EnumArrays - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JustSymbol** | Pointer to **string** | | [optional] -**ArrayEnum** | Pointer to **[]string** | | [optional] - -## Methods - -### NewEnumArrays - -`func NewEnumArrays() *EnumArrays` - -NewEnumArrays instantiates a new EnumArrays object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnumArraysWithDefaults - -`func NewEnumArraysWithDefaults() *EnumArrays` - -NewEnumArraysWithDefaults instantiates a new EnumArrays object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetJustSymbol - -`func (o *EnumArrays) GetJustSymbol() string` - -GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. - -### GetJustSymbolOk - -`func (o *EnumArrays) GetJustSymbolOk() (*string, bool)` - -GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetJustSymbol - -`func (o *EnumArrays) SetJustSymbol(v string)` - -SetJustSymbol sets JustSymbol field to given value. - -### HasJustSymbol - -`func (o *EnumArrays) HasJustSymbol() bool` - -HasJustSymbol returns a boolean if a field has been set. - -### GetArrayEnum - -`func (o *EnumArrays) GetArrayEnum() []string` - -GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. - -### GetArrayEnumOk - -`func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool)` - -GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayEnum - -`func (o *EnumArrays) SetArrayEnum(v []string)` - -SetArrayEnum sets ArrayEnum field to given value. - -### HasArrayEnum - -`func (o *EnumArrays) HasArrayEnum() bool` - -HasArrayEnum returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumClass.md deleted file mode 100644 index e231f94bd73..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md deleted file mode 100644 index 131b8e110a0..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/EnumTest.md +++ /dev/null @@ -1,155 +0,0 @@ -# EnumTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EnumString** | Pointer to **string** | | [optional] -**EnumStringRequired** | **string** | | -**EnumInteger** | Pointer to **int32** | | [optional] -**EnumNumber** | Pointer to **float64** | | [optional] -**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] - -## Methods - -### NewEnumTest - -`func NewEnumTest(enumStringRequired string, ) *EnumTest` - -NewEnumTest instantiates a new EnumTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnumTestWithDefaults - -`func NewEnumTestWithDefaults() *EnumTest` - -NewEnumTestWithDefaults instantiates a new EnumTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEnumString - -`func (o *EnumTest) GetEnumString() string` - -GetEnumString returns the EnumString field if non-nil, zero value otherwise. - -### GetEnumStringOk - -`func (o *EnumTest) GetEnumStringOk() (*string, bool)` - -GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumString - -`func (o *EnumTest) SetEnumString(v string)` - -SetEnumString sets EnumString field to given value. - -### HasEnumString - -`func (o *EnumTest) HasEnumString() bool` - -HasEnumString returns a boolean if a field has been set. - -### GetEnumStringRequired - -`func (o *EnumTest) GetEnumStringRequired() string` - -GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. - -### GetEnumStringRequiredOk - -`func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool)` - -GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumStringRequired - -`func (o *EnumTest) SetEnumStringRequired(v string)` - -SetEnumStringRequired sets EnumStringRequired field to given value. - - -### GetEnumInteger - -`func (o *EnumTest) GetEnumInteger() int32` - -GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. - -### GetEnumIntegerOk - -`func (o *EnumTest) GetEnumIntegerOk() (*int32, bool)` - -GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumInteger - -`func (o *EnumTest) SetEnumInteger(v int32)` - -SetEnumInteger sets EnumInteger field to given value. - -### HasEnumInteger - -`func (o *EnumTest) HasEnumInteger() bool` - -HasEnumInteger returns a boolean if a field has been set. - -### GetEnumNumber - -`func (o *EnumTest) GetEnumNumber() float64` - -GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. - -### GetEnumNumberOk - -`func (o *EnumTest) GetEnumNumberOk() (*float64, bool)` - -GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumNumber - -`func (o *EnumTest) SetEnumNumber(v float64)` - -SetEnumNumber sets EnumNumber field to given value. - -### HasEnumNumber - -`func (o *EnumTest) HasEnumNumber() bool` - -HasEnumNumber returns a boolean if a field has been set. - -### GetOuterEnum - -`func (o *EnumTest) GetOuterEnum() OuterEnum` - -GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. - -### GetOuterEnumOk - -`func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool)` - -GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOuterEnum - -`func (o *EnumTest) SetOuterEnum(v OuterEnum)` - -SetOuterEnum sets OuterEnum field to given value. - -### HasOuterEnum - -`func (o *EnumTest) HasOuterEnum() bool` - -HasOuterEnum returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md b/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md deleted file mode 100644 index 93be8280eb6..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FakeApi.md +++ /dev/null @@ -1,984 +0,0 @@ -# \FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateXmlItem**](FakeApi.md#CreateXmlItem) | **Post** /fake/create_xml_item | creates an XmlItem -[**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | -[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | -[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | -[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string | -[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema | -[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params | -[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters -[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) -[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data -[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | - - - -## CreateXmlItem - -> CreateXmlItem(ctx).XmlItem(xmlItem).Execute() - -creates an XmlItem - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - xmlItem := openapiclient.XmlItem{AttributeString: "AttributeString_example", AttributeNumber: 123, AttributeInteger: 123, AttributeBoolean: true, WrappedArray: []int32{123), NameString: "NameString_example", NameNumber: 123, NameInteger: 123, NameBoolean: true, NameArray: []int32{123), NameWrappedArray: []int32{123), PrefixString: "PrefixString_example", PrefixNumber: 123, PrefixInteger: 123, PrefixBoolean: true, PrefixArray: []int32{123), PrefixWrappedArray: []int32{123), NamespaceString: "NamespaceString_example", NamespaceNumber: 123, NamespaceInteger: 123, NamespaceBoolean: true, NamespaceArray: []int32{123), NamespaceWrappedArray: []int32{123), PrefixNsString: "PrefixNsString_example", PrefixNsNumber: 123, PrefixNsInteger: 123, PrefixNsBoolean: true, PrefixNsArray: []int32{123), PrefixNsWrappedArray: []int32{123)} // XmlItem | XmlItem Body - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.CreateXmlItem(context.Background(), xmlItem).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.CreateXmlItem``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateXmlItemRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterBooleanSerialize - -> bool FakeOuterBooleanSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := true // bool | Input boolean as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterBooleanSerialize`: bool - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterBooleanSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterBooleanSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool** | Input boolean as post body | - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterCompositeSerialize - -> OuterComposite FakeOuterCompositeSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.OuterComposite{MyNumber: 123, MyString: "MyString_example", MyBoolean: false} // OuterComposite | Input composite as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterCompositeSerialize`: OuterComposite - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterCompositeSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterCompositeSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterNumberSerialize - -> float32 FakeOuterNumberSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := 987 // float32 | Input number as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterNumberSerialize`: float32 - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterNumberSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterNumberSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float32** | Input number as post body | - -### Return type - -**float32** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterStringSerialize - -> string FakeOuterStringSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := "body_example" // string | Input string as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterStringSerialize`: string - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterStringSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterStringSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **string** | Input string as post body | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestBodyWithFileSchema - -> TestBodyWithFileSchema(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.FileSchemaTestClass{File: openapiclient.File{SourceURI: "SourceURI_example"}, Files: []File{openapiclient.File{SourceURI: "SourceURI_example"})} // FileSchemaTestClass | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestBodyWithFileSchemaRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestBodyWithQueryParams - -> TestBodyWithQueryParams(ctx).Query(query).Body(body).Execute() - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - query := "query_example" // string | - body := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123} // User | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background(), query, body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestBodyWithQueryParamsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **string** | | - **body** | [**User**](User.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestClientModel - -> Client TestClientModel(ctx).Body(body).Execute() - -To test \"client\" model - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.Client{Client: "Client_example"} // Client | client model - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestClientModel(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClientModel`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeApi.TestClientModel`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestClientModelRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestEndpointParameters - -> TestEndpointParameters(ctx).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - number := 987 // float32 | None - double := 987 // float64 | None - patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None - byte_ := 987 // string | None - integer := 987 // int32 | None (optional) - int32_ := 987 // int32 | None (optional) - int64_ := 987 // int64 | None (optional) - float := 987 // float32 | None (optional) - string_ := "string__example" // string | None (optional) - binary := 987 // *os.File | None (optional) - date := Get-Date // string | None (optional) - dateTime := Get-Date // time.Time | None (optional) - password := "password_example" // string | None (optional) - callback := "callback_example" // string | None (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background(), number, double, patternWithoutDelimiter, byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestEndpointParametersRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float32** | None | - **double** | **float64** | None | - **patternWithoutDelimiter** | **string** | None | - **byte_** | **string** | None | - **integer** | **int32** | None | - **int32_** | **int32** | None | - **int64_** | **int64** | None | - **float** | **float32** | None | - **string_** | **string** | None | - **binary** | ***os.File** | None | - **date** | **string** | None | - **dateTime** | **time.Time** | None | - **password** | **string** | None | - **callback** | **string** | None | - -### Return type - - (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestEnumParameters - -> TestEnumParameters(ctx).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - -To test enum parameters - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) - enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") - enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) - enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") - enumQueryInteger := 987 // int32 | Query parameter enum test (double) (optional) - enumQueryDouble := 987 // float64 | Query parameter enum test (double) (optional) - enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") - enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background(), ).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestEnumParametersRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[]string**](string.md) | Header parameter enum test (string array) | - **enumHeaderString** | **string** | Header parameter enum test (string) | [default to "-efg"] - **enumQueryStringArray** | [**[]string**](string.md) | Query parameter enum test (string array) | - **enumQueryString** | **string** | Query parameter enum test (string) | [default to "-efg"] - **enumQueryInteger** | **int32** | Query parameter enum test (double) | - **enumQueryDouble** | **float64** | Query parameter enum test (double) | - **enumFormStringArray** | [**[]string**](string.md) | Form parameter enum test (string array) | [default to "$"] - **enumFormString** | **string** | Form parameter enum test (string) | [default to "-efg"] - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestGroupParameters - -> TestGroupParameters(ctx).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - -Fake endpoint to test group parameters (optional) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - requiredStringGroup := 987 // int32 | Required String in group parameters - requiredBooleanGroup := true // bool | Required Boolean in group parameters - requiredInt64Group := 987 // int64 | Required Integer in group parameters - stringGroup := 987 // int32 | String in group parameters (optional) - booleanGroup := true // bool | Boolean in group parameters (optional) - int64Group := 987 // int64 | Integer in group parameters (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background(), requiredStringGroup, requiredBooleanGroup, requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestGroupParametersRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int32** | Required String in group parameters | - **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | - **requiredInt64Group** | **int64** | Required Integer in group parameters | - **stringGroup** | **int32** | String in group parameters | - **booleanGroup** | **bool** | Boolean in group parameters | - **int64Group** | **int64** | Integer in group parameters | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestInlineAdditionalProperties - -> TestInlineAdditionalProperties(ctx).Param(param).Execute() - -test inline additionalProperties - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - param := map[string]string{ "Key" = "Value" } // map[string]string | request body - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background(), param).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestInlineAdditionalPropertiesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**map[string]string**](string.md) | request body | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestJsonFormData - -> TestJsonFormData(ctx).Param(param).Param2(param2).Execute() - -test json serialization of form data - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - param := "param_example" // string | field1 - param2 := "param2_example" // string | field2 - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background(), param, param2).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestJsonFormDataRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **string** | field1 | - **param2** | **string** | field2 | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestQueryParameterCollectionFormat - -> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pipe := []string{"Inner_example"} // []string | - ioutil := []string{"Inner_example"} // []string | - http := []string{"Inner_example"} // []string | - url := []string{"Inner_example"} // []string | - context := []string{"Inner_example"} // []string | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background(), pipe, ioutil, http, url, context).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestQueryParameterCollectionFormatRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**[]string**](string.md) | | - **ioutil** | [**[]string**](string.md) | | - **http** | [**[]string**](string.md) | | - **url** | [**[]string**](string.md) | | - **context** | [**[]string**](string.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 3f8d0a41de3..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,75 +0,0 @@ -# \FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**TestClassname**](FakeClassnameTags123Api.md#TestClassname) | **Patch** /fake_classname_test | To test class name in snake case - - - -## TestClassname - -> Client TestClassname(ctx).Body(body).Execute() - -To test class name in snake case - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.Client{Client: "Client_example"} // Client | client model - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClassname`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123Api.TestClassname`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestClassnameRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/File.md b/samples/client/petstore/go-experimental/go-petstore/docs/File.md deleted file mode 100644 index 91fe90e06f1..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/File.md +++ /dev/null @@ -1,56 +0,0 @@ -# File - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SourceURI** | Pointer to **string** | Test capitalization | [optional] - -## Methods - -### NewFile - -`func NewFile() *File` - -NewFile instantiates a new File object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFileWithDefaults - -`func NewFileWithDefaults() *File` - -NewFileWithDefaults instantiates a new File object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSourceURI - -`func (o *File) GetSourceURI() string` - -GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. - -### GetSourceURIOk - -`func (o *File) GetSourceURIOk() (*string, bool)` - -GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceURI - -`func (o *File) SetSourceURI(v string)` - -SetSourceURI sets SourceURI field to given value. - -### HasSourceURI - -`func (o *File) HasSourceURI() bool` - -HasSourceURI returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md deleted file mode 100644 index 2db8eb31902..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,82 +0,0 @@ -# FileSchemaTestClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**File** | Pointer to [**File**](File.md) | | [optional] -**Files** | Pointer to [**[]File**](File.md) | | [optional] - -## Methods - -### NewFileSchemaTestClass - -`func NewFileSchemaTestClass() *FileSchemaTestClass` - -NewFileSchemaTestClass instantiates a new FileSchemaTestClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFileSchemaTestClassWithDefaults - -`func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass` - -NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetFile - -`func (o *FileSchemaTestClass) GetFile() File` - -GetFile returns the File field if non-nil, zero value otherwise. - -### GetFileOk - -`func (o *FileSchemaTestClass) GetFileOk() (*File, bool)` - -GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFile - -`func (o *FileSchemaTestClass) SetFile(v File)` - -SetFile sets File field to given value. - -### HasFile - -`func (o *FileSchemaTestClass) HasFile() bool` - -HasFile returns a boolean if a field has been set. - -### GetFiles - -`func (o *FileSchemaTestClass) GetFiles() []File` - -GetFiles returns the Files field if non-nil, zero value otherwise. - -### GetFilesOk - -`func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool)` - -GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFiles - -`func (o *FileSchemaTestClass) SetFiles(v []File)` - -SetFiles sets Files field to given value. - -### HasFiles - -`func (o *FileSchemaTestClass) HasFiles() bool` - -HasFiles returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md deleted file mode 100644 index 9235479afc1..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/FormatTest.md +++ /dev/null @@ -1,374 +0,0 @@ -# FormatTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Integer** | Pointer to **int32** | | [optional] -**Int32** | Pointer to **int32** | | [optional] -**Int64** | Pointer to **int64** | | [optional] -**Number** | **float32** | | -**Float** | Pointer to **float32** | | [optional] -**Double** | Pointer to **float64** | | [optional] -**String** | Pointer to **string** | | [optional] -**Byte** | **string** | | -**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] -**Date** | **string** | | -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Uuid** | Pointer to **string** | | [optional] -**Password** | **string** | | -**BigDecimal** | Pointer to **float64** | | [optional] - -## Methods - -### NewFormatTest - -`func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest` - -NewFormatTest instantiates a new FormatTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFormatTestWithDefaults - -`func NewFormatTestWithDefaults() *FormatTest` - -NewFormatTestWithDefaults instantiates a new FormatTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInteger - -`func (o *FormatTest) GetInteger() int32` - -GetInteger returns the Integer field if non-nil, zero value otherwise. - -### GetIntegerOk - -`func (o *FormatTest) GetIntegerOk() (*int32, bool)` - -GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInteger - -`func (o *FormatTest) SetInteger(v int32)` - -SetInteger sets Integer field to given value. - -### HasInteger - -`func (o *FormatTest) HasInteger() bool` - -HasInteger returns a boolean if a field has been set. - -### GetInt32 - -`func (o *FormatTest) GetInt32() int32` - -GetInt32 returns the Int32 field if non-nil, zero value otherwise. - -### GetInt32Ok - -`func (o *FormatTest) GetInt32Ok() (*int32, bool)` - -GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInt32 - -`func (o *FormatTest) SetInt32(v int32)` - -SetInt32 sets Int32 field to given value. - -### HasInt32 - -`func (o *FormatTest) HasInt32() bool` - -HasInt32 returns a boolean if a field has been set. - -### GetInt64 - -`func (o *FormatTest) GetInt64() int64` - -GetInt64 returns the Int64 field if non-nil, zero value otherwise. - -### GetInt64Ok - -`func (o *FormatTest) GetInt64Ok() (*int64, bool)` - -GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInt64 - -`func (o *FormatTest) SetInt64(v int64)` - -SetInt64 sets Int64 field to given value. - -### HasInt64 - -`func (o *FormatTest) HasInt64() bool` - -HasInt64 returns a boolean if a field has been set. - -### GetNumber - -`func (o *FormatTest) GetNumber() float32` - -GetNumber returns the Number field if non-nil, zero value otherwise. - -### GetNumberOk - -`func (o *FormatTest) GetNumberOk() (*float32, bool)` - -GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumber - -`func (o *FormatTest) SetNumber(v float32)` - -SetNumber sets Number field to given value. - - -### GetFloat - -`func (o *FormatTest) GetFloat() float32` - -GetFloat returns the Float field if non-nil, zero value otherwise. - -### GetFloatOk - -`func (o *FormatTest) GetFloatOk() (*float32, bool)` - -GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFloat - -`func (o *FormatTest) SetFloat(v float32)` - -SetFloat sets Float field to given value. - -### HasFloat - -`func (o *FormatTest) HasFloat() bool` - -HasFloat returns a boolean if a field has been set. - -### GetDouble - -`func (o *FormatTest) GetDouble() float64` - -GetDouble returns the Double field if non-nil, zero value otherwise. - -### GetDoubleOk - -`func (o *FormatTest) GetDoubleOk() (*float64, bool)` - -GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDouble - -`func (o *FormatTest) SetDouble(v float64)` - -SetDouble sets Double field to given value. - -### HasDouble - -`func (o *FormatTest) HasDouble() bool` - -HasDouble returns a boolean if a field has been set. - -### GetString - -`func (o *FormatTest) GetString() string` - -GetString returns the String field if non-nil, zero value otherwise. - -### GetStringOk - -`func (o *FormatTest) GetStringOk() (*string, bool)` - -GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetString - -`func (o *FormatTest) SetString(v string)` - -SetString sets String field to given value. - -### HasString - -`func (o *FormatTest) HasString() bool` - -HasString returns a boolean if a field has been set. - -### GetByte - -`func (o *FormatTest) GetByte() string` - -GetByte returns the Byte field if non-nil, zero value otherwise. - -### GetByteOk - -`func (o *FormatTest) GetByteOk() (*string, bool)` - -GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetByte - -`func (o *FormatTest) SetByte(v string)` - -SetByte sets Byte field to given value. - - -### GetBinary - -`func (o *FormatTest) GetBinary() *os.File` - -GetBinary returns the Binary field if non-nil, zero value otherwise. - -### GetBinaryOk - -`func (o *FormatTest) GetBinaryOk() (**os.File, bool)` - -GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBinary - -`func (o *FormatTest) SetBinary(v *os.File)` - -SetBinary sets Binary field to given value. - -### HasBinary - -`func (o *FormatTest) HasBinary() bool` - -HasBinary returns a boolean if a field has been set. - -### GetDate - -`func (o *FormatTest) GetDate() string` - -GetDate returns the Date field if non-nil, zero value otherwise. - -### GetDateOk - -`func (o *FormatTest) GetDateOk() (*string, bool)` - -GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDate - -`func (o *FormatTest) SetDate(v string)` - -SetDate sets Date field to given value. - - -### GetDateTime - -`func (o *FormatTest) GetDateTime() time.Time` - -GetDateTime returns the DateTime field if non-nil, zero value otherwise. - -### GetDateTimeOk - -`func (o *FormatTest) GetDateTimeOk() (*time.Time, bool)` - -GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDateTime - -`func (o *FormatTest) SetDateTime(v time.Time)` - -SetDateTime sets DateTime field to given value. - -### HasDateTime - -`func (o *FormatTest) HasDateTime() bool` - -HasDateTime returns a boolean if a field has been set. - -### GetUuid - -`func (o *FormatTest) GetUuid() string` - -GetUuid returns the Uuid field if non-nil, zero value otherwise. - -### GetUuidOk - -`func (o *FormatTest) GetUuidOk() (*string, bool)` - -GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUuid - -`func (o *FormatTest) SetUuid(v string)` - -SetUuid sets Uuid field to given value. - -### HasUuid - -`func (o *FormatTest) HasUuid() bool` - -HasUuid returns a boolean if a field has been set. - -### GetPassword - -`func (o *FormatTest) GetPassword() string` - -GetPassword returns the Password field if non-nil, zero value otherwise. - -### GetPasswordOk - -`func (o *FormatTest) GetPasswordOk() (*string, bool)` - -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPassword - -`func (o *FormatTest) SetPassword(v string)` - -SetPassword sets Password field to given value. - - -### GetBigDecimal - -`func (o *FormatTest) GetBigDecimal() float64` - -GetBigDecimal returns the BigDecimal field if non-nil, zero value otherwise. - -### GetBigDecimalOk - -`func (o *FormatTest) GetBigDecimalOk() (*float64, bool)` - -GetBigDecimalOk returns a tuple with the BigDecimal field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBigDecimal - -`func (o *FormatTest) SetBigDecimal(v float64)` - -SetBigDecimal sets BigDecimal field to given value. - -### HasBigDecimal - -`func (o *FormatTest) HasBigDecimal() bool` - -HasBigDecimal returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md deleted file mode 100644 index 7f54d772840..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,82 +0,0 @@ -# HasOnlyReadOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] [readonly] -**Foo** | Pointer to **string** | | [optional] [readonly] - -## Methods - -### NewHasOnlyReadOnly - -`func NewHasOnlyReadOnly() *HasOnlyReadOnly` - -NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHasOnlyReadOnlyWithDefaults - -`func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly` - -NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBar - -`func (o *HasOnlyReadOnly) GetBar() string` - -GetBar returns the Bar field if non-nil, zero value otherwise. - -### GetBarOk - -`func (o *HasOnlyReadOnly) GetBarOk() (*string, bool)` - -GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBar - -`func (o *HasOnlyReadOnly) SetBar(v string)` - -SetBar sets Bar field to given value. - -### HasBar - -`func (o *HasOnlyReadOnly) HasBar() bool` - -HasBar returns a boolean if a field has been set. - -### GetFoo - -`func (o *HasOnlyReadOnly) GetFoo() string` - -GetFoo returns the Foo field if non-nil, zero value otherwise. - -### GetFooOk - -`func (o *HasOnlyReadOnly) GetFooOk() (*string, bool)` - -GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFoo - -`func (o *HasOnlyReadOnly) SetFoo(v string)` - -SetFoo sets Foo field to given value. - -### HasFoo - -`func (o *HasOnlyReadOnly) HasFoo() bool` - -HasFoo returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/List.md b/samples/client/petstore/go-experimental/go-petstore/docs/List.md deleted file mode 100644 index 271c8236a8b..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/List.md +++ /dev/null @@ -1,56 +0,0 @@ -# List - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Var123List** | Pointer to **string** | | [optional] - -## Methods - -### NewList - -`func NewList() *List` - -NewList instantiates a new List object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListWithDefaults - -`func NewListWithDefaults() *List` - -NewListWithDefaults instantiates a new List object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetVar123List - -`func (o *List) GetVar123List() string` - -GetVar123List returns the Var123List field if non-nil, zero value otherwise. - -### GetVar123ListOk - -`func (o *List) GetVar123ListOk() (*string, bool)` - -GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVar123List - -`func (o *List) SetVar123List(v string)` - -SetVar123List sets Var123List field to given value. - -### HasVar123List - -`func (o *List) HasVar123List() bool` - -HasVar123List returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md b/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md deleted file mode 100644 index 6b35263c4e3..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/MapTest.md +++ /dev/null @@ -1,134 +0,0 @@ -# MapTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | Pointer to **map[string]string** | | [optional] -**DirectMap** | Pointer to **map[string]bool** | | [optional] -**IndirectMap** | Pointer to **map[string]bool** | | [optional] - -## Methods - -### NewMapTest - -`func NewMapTest() *MapTest` - -NewMapTest instantiates a new MapTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMapTestWithDefaults - -`func NewMapTestWithDefaults() *MapTest` - -NewMapTestWithDefaults instantiates a new MapTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMapMapOfString - -`func (o *MapTest) GetMapMapOfString() map[string]map[string]string` - -GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. - -### GetMapMapOfStringOk - -`func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool)` - -GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapMapOfString - -`func (o *MapTest) SetMapMapOfString(v map[string]map[string]string)` - -SetMapMapOfString sets MapMapOfString field to given value. - -### HasMapMapOfString - -`func (o *MapTest) HasMapMapOfString() bool` - -HasMapMapOfString returns a boolean if a field has been set. - -### GetMapOfEnumString - -`func (o *MapTest) GetMapOfEnumString() map[string]string` - -GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. - -### GetMapOfEnumStringOk - -`func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool)` - -GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapOfEnumString - -`func (o *MapTest) SetMapOfEnumString(v map[string]string)` - -SetMapOfEnumString sets MapOfEnumString field to given value. - -### HasMapOfEnumString - -`func (o *MapTest) HasMapOfEnumString() bool` - -HasMapOfEnumString returns a boolean if a field has been set. - -### GetDirectMap - -`func (o *MapTest) GetDirectMap() map[string]bool` - -GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. - -### GetDirectMapOk - -`func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool)` - -GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDirectMap - -`func (o *MapTest) SetDirectMap(v map[string]bool)` - -SetDirectMap sets DirectMap field to given value. - -### HasDirectMap - -`func (o *MapTest) HasDirectMap() bool` - -HasDirectMap returns a boolean if a field has been set. - -### GetIndirectMap - -`func (o *MapTest) GetIndirectMap() map[string]bool` - -GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. - -### GetIndirectMapOk - -`func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool)` - -GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIndirectMap - -`func (o *MapTest) SetIndirectMap(v map[string]bool)` - -SetIndirectMap sets IndirectMap field to given value. - -### HasIndirectMap - -`func (o *MapTest) HasIndirectMap() bool` - -HasIndirectMap returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index f726ffe63e1..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,108 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Uuid** | Pointer to **string** | | [optional] -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] - -## Methods - -### NewMixedPropertiesAndAdditionalPropertiesClass - -`func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass` - -NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults - -`func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass` - -NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUuid - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string` - -GetUuid returns the Uuid field if non-nil, zero value otherwise. - -### GetUuidOk - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool)` - -GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUuid - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string)` - -SetUuid sets Uuid field to given value. - -### HasUuid - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool` - -HasUuid returns a boolean if a field has been set. - -### GetDateTime - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time` - -GetDateTime returns the DateTime field if non-nil, zero value otherwise. - -### GetDateTimeOk - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool)` - -GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDateTime - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time)` - -SetDateTime sets DateTime field to given value. - -### HasDateTime - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool` - -HasDateTime returns a boolean if a field has been set. - -### GetMap - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal` - -GetMap returns the Map field if non-nil, zero value otherwise. - -### GetMapOk - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool)` - -GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMap - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal)` - -SetMap sets Map field to given value. - -### HasMap - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool` - -HasMap returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md b/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md deleted file mode 100644 index 4e0d89fe88f..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Model200Response.md +++ /dev/null @@ -1,82 +0,0 @@ -# Model200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **int32** | | [optional] -**Class** | Pointer to **string** | | [optional] - -## Methods - -### NewModel200Response - -`func NewModel200Response() *Model200Response` - -NewModel200Response instantiates a new Model200Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewModel200ResponseWithDefaults - -`func NewModel200ResponseWithDefaults() *Model200Response` - -NewModel200ResponseWithDefaults instantiates a new Model200Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *Model200Response) GetName() int32` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Model200Response) GetNameOk() (*int32, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Model200Response) SetName(v int32)` - -SetName sets Name field to given value. - -### HasName - -`func (o *Model200Response) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetClass - -`func (o *Model200Response) GetClass() string` - -GetClass returns the Class field if non-nil, zero value otherwise. - -### GetClassOk - -`func (o *Model200Response) GetClassOk() (*string, bool)` - -GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClass - -`func (o *Model200Response) SetClass(v string)` - -SetClass sets Class field to given value. - -### HasClass - -`func (o *Model200Response) HasClass() bool` - -HasClass returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Name.md b/samples/client/petstore/go-experimental/go-petstore/docs/Name.md deleted file mode 100644 index 18cf04789d6..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Name.md +++ /dev/null @@ -1,129 +0,0 @@ -# Name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **int32** | | -**SnakeCase** | Pointer to **int32** | | [optional] [readonly] -**Property** | Pointer to **string** | | [optional] -**Var123Number** | Pointer to **int32** | | [optional] [readonly] - -## Methods - -### NewName - -`func NewName(name int32, ) *Name` - -NewName instantiates a new Name object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNameWithDefaults - -`func NewNameWithDefaults() *Name` - -NewNameWithDefaults instantiates a new Name object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *Name) GetName() int32` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Name) GetNameOk() (*int32, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Name) SetName(v int32)` - -SetName sets Name field to given value. - - -### GetSnakeCase - -`func (o *Name) GetSnakeCase() int32` - -GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. - -### GetSnakeCaseOk - -`func (o *Name) GetSnakeCaseOk() (*int32, bool)` - -GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSnakeCase - -`func (o *Name) SetSnakeCase(v int32)` - -SetSnakeCase sets SnakeCase field to given value. - -### HasSnakeCase - -`func (o *Name) HasSnakeCase() bool` - -HasSnakeCase returns a boolean if a field has been set. - -### GetProperty - -`func (o *Name) GetProperty() string` - -GetProperty returns the Property field if non-nil, zero value otherwise. - -### GetPropertyOk - -`func (o *Name) GetPropertyOk() (*string, bool)` - -GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProperty - -`func (o *Name) SetProperty(v string)` - -SetProperty sets Property field to given value. - -### HasProperty - -`func (o *Name) HasProperty() bool` - -HasProperty returns a boolean if a field has been set. - -### GetVar123Number - -`func (o *Name) GetVar123Number() int32` - -GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. - -### GetVar123NumberOk - -`func (o *Name) GetVar123NumberOk() (*int32, bool)` - -GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVar123Number - -`func (o *Name) SetVar123Number(v int32)` - -SetVar123Number sets Var123Number field to given value. - -### HasVar123Number - -`func (o *Name) HasVar123Number() bool` - -HasVar123Number returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md b/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md deleted file mode 100644 index 81941828b62..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md +++ /dev/null @@ -1,56 +0,0 @@ -# NumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JustNumber** | Pointer to **float32** | | [optional] - -## Methods - -### NewNumberOnly - -`func NewNumberOnly() *NumberOnly` - -NewNumberOnly instantiates a new NumberOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNumberOnlyWithDefaults - -`func NewNumberOnlyWithDefaults() *NumberOnly` - -NewNumberOnlyWithDefaults instantiates a new NumberOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetJustNumber - -`func (o *NumberOnly) GetJustNumber() float32` - -GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. - -### GetJustNumberOk - -`func (o *NumberOnly) GetJustNumberOk() (*float32, bool)` - -GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetJustNumber - -`func (o *NumberOnly) SetJustNumber(v float32)` - -SetJustNumber sets JustNumber field to given value. - -### HasJustNumber - -`func (o *NumberOnly) HasJustNumber() bool` - -HasJustNumber returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Order.md b/samples/client/petstore/go-experimental/go-petstore/docs/Order.md deleted file mode 100644 index 78cace2f229..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Order.md +++ /dev/null @@ -1,186 +0,0 @@ -# Order - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**PetId** | Pointer to **int64** | | [optional] -**Quantity** | Pointer to **int32** | | [optional] -**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Status** | Pointer to **string** | Order Status | [optional] -**Complete** | Pointer to **bool** | | [optional] [default to false] - -## Methods - -### NewOrder - -`func NewOrder() *Order` - -NewOrder instantiates a new Order object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOrderWithDefaults - -`func NewOrderWithDefaults() *Order` - -NewOrderWithDefaults instantiates a new Order object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Order) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Order) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Order) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Order) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetPetId - -`func (o *Order) GetPetId() int64` - -GetPetId returns the PetId field if non-nil, zero value otherwise. - -### GetPetIdOk - -`func (o *Order) GetPetIdOk() (*int64, bool)` - -GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPetId - -`func (o *Order) SetPetId(v int64)` - -SetPetId sets PetId field to given value. - -### HasPetId - -`func (o *Order) HasPetId() bool` - -HasPetId returns a boolean if a field has been set. - -### GetQuantity - -`func (o *Order) GetQuantity() int32` - -GetQuantity returns the Quantity field if non-nil, zero value otherwise. - -### GetQuantityOk - -`func (o *Order) GetQuantityOk() (*int32, bool)` - -GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQuantity - -`func (o *Order) SetQuantity(v int32)` - -SetQuantity sets Quantity field to given value. - -### HasQuantity - -`func (o *Order) HasQuantity() bool` - -HasQuantity returns a boolean if a field has been set. - -### GetShipDate - -`func (o *Order) GetShipDate() time.Time` - -GetShipDate returns the ShipDate field if non-nil, zero value otherwise. - -### GetShipDateOk - -`func (o *Order) GetShipDateOk() (*time.Time, bool)` - -GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShipDate - -`func (o *Order) SetShipDate(v time.Time)` - -SetShipDate sets ShipDate field to given value. - -### HasShipDate - -`func (o *Order) HasShipDate() bool` - -HasShipDate returns a boolean if a field has been set. - -### GetStatus - -`func (o *Order) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *Order) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *Order) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *Order) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - -### GetComplete - -`func (o *Order) GetComplete() bool` - -GetComplete returns the Complete field if non-nil, zero value otherwise. - -### GetCompleteOk - -`func (o *Order) GetCompleteOk() (*bool, bool)` - -GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetComplete - -`func (o *Order) SetComplete(v bool)` - -SetComplete sets Complete field to given value. - -### HasComplete - -`func (o *Order) HasComplete() bool` - -HasComplete returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md b/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md deleted file mode 100644 index 1ebf86c0a2e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md +++ /dev/null @@ -1,108 +0,0 @@ -# OuterComposite - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MyNumber** | Pointer to **float32** | | [optional] -**MyString** | Pointer to **string** | | [optional] -**MyBoolean** | Pointer to **bool** | | [optional] - -## Methods - -### NewOuterComposite - -`func NewOuterComposite() *OuterComposite` - -NewOuterComposite instantiates a new OuterComposite object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOuterCompositeWithDefaults - -`func NewOuterCompositeWithDefaults() *OuterComposite` - -NewOuterCompositeWithDefaults instantiates a new OuterComposite object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMyNumber - -`func (o *OuterComposite) GetMyNumber() float32` - -GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. - -### GetMyNumberOk - -`func (o *OuterComposite) GetMyNumberOk() (*float32, bool)` - -GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMyNumber - -`func (o *OuterComposite) SetMyNumber(v float32)` - -SetMyNumber sets MyNumber field to given value. - -### HasMyNumber - -`func (o *OuterComposite) HasMyNumber() bool` - -HasMyNumber returns a boolean if a field has been set. - -### GetMyString - -`func (o *OuterComposite) GetMyString() string` - -GetMyString returns the MyString field if non-nil, zero value otherwise. - -### GetMyStringOk - -`func (o *OuterComposite) GetMyStringOk() (*string, bool)` - -GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMyString - -`func (o *OuterComposite) SetMyString(v string)` - -SetMyString sets MyString field to given value. - -### HasMyString - -`func (o *OuterComposite) HasMyString() bool` - -HasMyString returns a boolean if a field has been set. - -### GetMyBoolean - -`func (o *OuterComposite) GetMyBoolean() bool` - -GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. - -### GetMyBooleanOk - -`func (o *OuterComposite) GetMyBooleanOk() (*bool, bool)` - -GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMyBoolean - -`func (o *OuterComposite) SetMyBoolean(v bool)` - -SetMyBoolean sets MyBoolean field to given value. - -### HasMyBoolean - -`func (o *OuterComposite) HasMyBoolean() bool` - -HasMyBoolean returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md b/samples/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md deleted file mode 100644 index 13bed2d17fd..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# OuterEnum - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md b/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md deleted file mode 100644 index a6eae34657d..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Pet.md +++ /dev/null @@ -1,176 +0,0 @@ -# Pet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Category** | Pointer to [**Category**](Category.md) | | [optional] -**Name** | **string** | | -**PhotoUrls** | **[]string** | | -**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] -**Status** | Pointer to **string** | pet status in the store | [optional] - -## Methods - -### NewPet - -`func NewPet(name string, photoUrls []string, ) *Pet` - -NewPet instantiates a new Pet object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPetWithDefaults - -`func NewPetWithDefaults() *Pet` - -NewPetWithDefaults instantiates a new Pet object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Pet) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Pet) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Pet) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Pet) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetCategory - -`func (o *Pet) GetCategory() Category` - -GetCategory returns the Category field if non-nil, zero value otherwise. - -### GetCategoryOk - -`func (o *Pet) GetCategoryOk() (*Category, bool)` - -GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCategory - -`func (o *Pet) SetCategory(v Category)` - -SetCategory sets Category field to given value. - -### HasCategory - -`func (o *Pet) HasCategory() bool` - -HasCategory returns a boolean if a field has been set. - -### GetName - -`func (o *Pet) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Pet) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Pet) SetName(v string)` - -SetName sets Name field to given value. - - -### GetPhotoUrls - -`func (o *Pet) GetPhotoUrls() []string` - -GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. - -### GetPhotoUrlsOk - -`func (o *Pet) GetPhotoUrlsOk() (*[]string, bool)` - -GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPhotoUrls - -`func (o *Pet) SetPhotoUrls(v []string)` - -SetPhotoUrls sets PhotoUrls field to given value. - - -### GetTags - -`func (o *Pet) GetTags() []Tag` - -GetTags returns the Tags field if non-nil, zero value otherwise. - -### GetTagsOk - -`func (o *Pet) GetTagsOk() (*[]Tag, bool)` - -GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTags - -`func (o *Pet) SetTags(v []Tag)` - -SetTags sets Tags field to given value. - -### HasTags - -`func (o *Pet) HasTags() bool` - -HasTags returns a boolean if a field has been set. - -### GetStatus - -`func (o *Pet) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *Pet) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *Pet) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *Pet) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/PetApi.md b/samples/client/petstore/go-experimental/go-petstore/docs/PetApi.md deleted file mode 100644 index c2559ac673a..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/PetApi.md +++ /dev/null @@ -1,625 +0,0 @@ -# \PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AddPet**](PetApi.md#AddPet) | **Post** /pet | Add a new pet to the store -[**DeletePet**](PetApi.md#DeletePet) | **Delete** /pet/{petId} | Deletes a pet -[**FindPetsByStatus**](PetApi.md#FindPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status -[**FindPetsByTags**](PetApi.md#FindPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags -[**GetPetById**](PetApi.md#GetPetById) | **Get** /pet/{petId} | Find pet by ID -[**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet -[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data -[**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image -[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - - -## AddPet - -> AddPet(ctx).Body(body).Execute() - -Add a new pet to the store - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.AddPet(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiAddPetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeletePet - -> DeletePet(ctx, petId).ApiKey(apiKey).Execute() - -Deletes a pet - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | Pet id to delete - apiKey := "apiKey_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | Pet id to delete | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeletePetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **apiKey** | **string** | | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FindPetsByStatus - -> []Pet FindPetsByStatus(ctx).Status(status).Execute() - -Finds Pets by status - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - status := []string{"Status_example"} // []string | Status values that need to be considered for filter - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background(), status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByStatus`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByStatus`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFindPetsByStatusRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[]string**](string.md) | Status values that need to be considered for filter | - -### Return type - -[**[]Pet**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FindPetsByTags - -> []Pet FindPetsByTags(ctx).Tags(tags).Execute() - -Finds Pets by tags - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - tags := []string{"Inner_example"} // []string | Tags to filter by - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByTags(context.Background(), tags).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByTags`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByTags`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFindPetsByTagsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[]string**](string.md) | Tags to filter by | - -### Return type - -[**[]Pet**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetPetById - -> Pet GetPetById(ctx, petId).Execute() - -Find pet by ID - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet to return - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPetById`: Pet - fmt.Fprintf(os.Stdout, "Response from `PetApi.GetPetById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet to return | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetPetByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePet - -> UpdatePet(ctx).Body(body).Execute() - -Update an existing pet - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePet(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdatePetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePetWithForm - -> UpdatePetWithForm(ctx, petId).Name(name).Status(status).Execute() - -Updates a pet in the store with form data - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet that needs to be updated - name := "name_example" // string | Updated name of the pet (optional) - status := "status_example" // string | Updated status of the pet (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet that needs to be updated | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdatePetWithFormRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **name** | **string** | Updated name of the pet | - **status** | **string** | Updated status of the pet | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UploadFile - -> ApiResponse UploadFile(ctx, petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - -uploads an image - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet to update - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - file := 987 // *os.File | file to upload (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFile`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet to update | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUploadFileRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **additionalMetadata** | **string** | Additional data to pass to server | - **file** | ***os.File** | file to upload | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UploadFileWithRequiredFile - -> ApiResponse UploadFileWithRequiredFile(ctx, petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() - -uploads an image (required) - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet to update - requiredFile := 987 // *os.File | file to upload - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId, requiredFile).AdditionalMetadata(additionalMetadata).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFileWithRequiredFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFileWithRequiredFile`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet to update | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUploadFileWithRequiredFileRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requiredFile** | ***os.File** | file to upload | - **additionalMetadata** | **string** | Additional data to pass to server | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md b/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md deleted file mode 100644 index 2e25d6d230e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,82 +0,0 @@ -# ReadOnlyFirst - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] [readonly] -**Baz** | Pointer to **string** | | [optional] - -## Methods - -### NewReadOnlyFirst - -`func NewReadOnlyFirst() *ReadOnlyFirst` - -NewReadOnlyFirst instantiates a new ReadOnlyFirst object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewReadOnlyFirstWithDefaults - -`func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst` - -NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBar - -`func (o *ReadOnlyFirst) GetBar() string` - -GetBar returns the Bar field if non-nil, zero value otherwise. - -### GetBarOk - -`func (o *ReadOnlyFirst) GetBarOk() (*string, bool)` - -GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBar - -`func (o *ReadOnlyFirst) SetBar(v string)` - -SetBar sets Bar field to given value. - -### HasBar - -`func (o *ReadOnlyFirst) HasBar() bool` - -HasBar returns a boolean if a field has been set. - -### GetBaz - -`func (o *ReadOnlyFirst) GetBaz() string` - -GetBaz returns the Baz field if non-nil, zero value otherwise. - -### GetBazOk - -`func (o *ReadOnlyFirst) GetBazOk() (*string, bool)` - -GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBaz - -`func (o *ReadOnlyFirst) SetBaz(v string)` - -SetBaz sets Baz field to given value. - -### HasBaz - -`func (o *ReadOnlyFirst) HasBaz() bool` - -HasBaz returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Return.md b/samples/client/petstore/go-experimental/go-petstore/docs/Return.md deleted file mode 100644 index d6be5a42f31..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Return.md +++ /dev/null @@ -1,56 +0,0 @@ -# Return - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Return** | Pointer to **int32** | | [optional] - -## Methods - -### NewReturn - -`func NewReturn() *Return` - -NewReturn instantiates a new Return object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewReturnWithDefaults - -`func NewReturnWithDefaults() *Return` - -NewReturnWithDefaults instantiates a new Return object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetReturn - -`func (o *Return) GetReturn() int32` - -GetReturn returns the Return field if non-nil, zero value otherwise. - -### GetReturnOk - -`func (o *Return) GetReturnOk() (*int32, bool)` - -GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReturn - -`func (o *Return) SetReturn(v int32)` - -SetReturn sets Return field to given value. - -### HasReturn - -`func (o *Return) HasReturn() bool` - -HasReturn returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md b/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md deleted file mode 100644 index 3e5a187c1d1..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md +++ /dev/null @@ -1,56 +0,0 @@ -# SpecialModelName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SpecialPropertyName** | Pointer to **int64** | | [optional] - -## Methods - -### NewSpecialModelName - -`func NewSpecialModelName() *SpecialModelName` - -NewSpecialModelName instantiates a new SpecialModelName object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSpecialModelNameWithDefaults - -`func NewSpecialModelNameWithDefaults() *SpecialModelName` - -NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSpecialPropertyName - -`func (o *SpecialModelName) GetSpecialPropertyName() int64` - -GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. - -### GetSpecialPropertyNameOk - -`func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool)` - -GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSpecialPropertyName - -`func (o *SpecialModelName) SetSpecialPropertyName(v int64)` - -SetSpecialPropertyName sets SpecialPropertyName field to given value. - -### HasSpecialPropertyName - -`func (o *SpecialModelName) HasSpecialPropertyName() bool` - -HasSpecialPropertyName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/StoreApi.md b/samples/client/petstore/go-experimental/go-petstore/docs/StoreApi.md deleted file mode 100644 index 58a65c02215..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/StoreApi.md +++ /dev/null @@ -1,275 +0,0 @@ -# \StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID -[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID -[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet - - - -## DeleteOrder - -> DeleteOrder(ctx, orderId).Execute() - -Delete purchase order by ID - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - orderId := "orderId_example" // string | ID of the order that needs to be deleted - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **string** | ID of the order that needs to be deleted | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteOrderRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetInventory - -> map[string]int32 GetInventory(ctx).Execute() - -Returns pet inventories by status - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetInventory(context.Background(), ).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetInventory`: map[string]int32 - fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetInventory`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetInventoryRequest struct via the builder pattern - - -### Return type - -**map[string]int32** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetOrderById - -> Order GetOrderById(ctx, orderId).Execute() - -Find purchase order by ID - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - orderId := 987 // int64 | ID of pet that needs to be fetched - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOrderById`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetOrderById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **int64** | ID of pet that needs to be fetched | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetOrderByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PlaceOrder - -> Order PlaceOrder(ctx).Body(body).Execute() - -Place an order for a pet - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.Order{Id: int64(123), PetId: int64(123), Quantity: 123, ShipDate: "TODO", Status: "Status_example", Complete: false} // Order | order placed for purchasing the pet - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.PlaceOrder(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PlaceOrder`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreApi.PlaceOrder`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiPlaceOrderRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md b/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md deleted file mode 100644 index 391be6b4900..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Tag.md +++ /dev/null @@ -1,82 +0,0 @@ -# Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewTag - -`func NewTag() *Tag` - -NewTag instantiates a new Tag object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTagWithDefaults - -`func NewTagWithDefaults() *Tag` - -NewTagWithDefaults instantiates a new Tag object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Tag) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Tag) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Tag) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Tag) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *Tag) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Tag) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Tag) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *Tag) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md b/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md deleted file mode 100644 index 34b38a6065f..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderDefault.md +++ /dev/null @@ -1,135 +0,0 @@ -# TypeHolderDefault - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StringItem** | **string** | | [default to "what"] -**NumberItem** | **float32** | | -**IntegerItem** | **int32** | | -**BoolItem** | **bool** | | [default to true] -**ArrayItem** | **[]int32** | | - -## Methods - -### NewTypeHolderDefault - -`func NewTypeHolderDefault(stringItem string, numberItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderDefault` - -NewTypeHolderDefault instantiates a new TypeHolderDefault object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTypeHolderDefaultWithDefaults - -`func NewTypeHolderDefaultWithDefaults() *TypeHolderDefault` - -NewTypeHolderDefaultWithDefaults instantiates a new TypeHolderDefault object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStringItem - -`func (o *TypeHolderDefault) GetStringItem() string` - -GetStringItem returns the StringItem field if non-nil, zero value otherwise. - -### GetStringItemOk - -`func (o *TypeHolderDefault) GetStringItemOk() (*string, bool)` - -GetStringItemOk returns a tuple with the StringItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStringItem - -`func (o *TypeHolderDefault) SetStringItem(v string)` - -SetStringItem sets StringItem field to given value. - - -### GetNumberItem - -`func (o *TypeHolderDefault) GetNumberItem() float32` - -GetNumberItem returns the NumberItem field if non-nil, zero value otherwise. - -### GetNumberItemOk - -`func (o *TypeHolderDefault) GetNumberItemOk() (*float32, bool)` - -GetNumberItemOk returns a tuple with the NumberItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumberItem - -`func (o *TypeHolderDefault) SetNumberItem(v float32)` - -SetNumberItem sets NumberItem field to given value. - - -### GetIntegerItem - -`func (o *TypeHolderDefault) GetIntegerItem() int32` - -GetIntegerItem returns the IntegerItem field if non-nil, zero value otherwise. - -### GetIntegerItemOk - -`func (o *TypeHolderDefault) GetIntegerItemOk() (*int32, bool)` - -GetIntegerItemOk returns a tuple with the IntegerItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIntegerItem - -`func (o *TypeHolderDefault) SetIntegerItem(v int32)` - -SetIntegerItem sets IntegerItem field to given value. - - -### GetBoolItem - -`func (o *TypeHolderDefault) GetBoolItem() bool` - -GetBoolItem returns the BoolItem field if non-nil, zero value otherwise. - -### GetBoolItemOk - -`func (o *TypeHolderDefault) GetBoolItemOk() (*bool, bool)` - -GetBoolItemOk returns a tuple with the BoolItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBoolItem - -`func (o *TypeHolderDefault) SetBoolItem(v bool)` - -SetBoolItem sets BoolItem field to given value. - - -### GetArrayItem - -`func (o *TypeHolderDefault) GetArrayItem() []int32` - -GetArrayItem returns the ArrayItem field if non-nil, zero value otherwise. - -### GetArrayItemOk - -`func (o *TypeHolderDefault) GetArrayItemOk() (*[]int32, bool)` - -GetArrayItemOk returns a tuple with the ArrayItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayItem - -`func (o *TypeHolderDefault) SetArrayItem(v []int32)` - -SetArrayItem sets ArrayItem field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderExample.md b/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderExample.md deleted file mode 100644 index 259aae8df56..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/TypeHolderExample.md +++ /dev/null @@ -1,156 +0,0 @@ -# TypeHolderExample - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StringItem** | **string** | | -**NumberItem** | **float32** | | -**FloatItem** | **float32** | | -**IntegerItem** | **int32** | | -**BoolItem** | **bool** | | -**ArrayItem** | **[]int32** | | - -## Methods - -### NewTypeHolderExample - -`func NewTypeHolderExample(stringItem string, numberItem float32, floatItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderExample` - -NewTypeHolderExample instantiates a new TypeHolderExample object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTypeHolderExampleWithDefaults - -`func NewTypeHolderExampleWithDefaults() *TypeHolderExample` - -NewTypeHolderExampleWithDefaults instantiates a new TypeHolderExample object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStringItem - -`func (o *TypeHolderExample) GetStringItem() string` - -GetStringItem returns the StringItem field if non-nil, zero value otherwise. - -### GetStringItemOk - -`func (o *TypeHolderExample) GetStringItemOk() (*string, bool)` - -GetStringItemOk returns a tuple with the StringItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStringItem - -`func (o *TypeHolderExample) SetStringItem(v string)` - -SetStringItem sets StringItem field to given value. - - -### GetNumberItem - -`func (o *TypeHolderExample) GetNumberItem() float32` - -GetNumberItem returns the NumberItem field if non-nil, zero value otherwise. - -### GetNumberItemOk - -`func (o *TypeHolderExample) GetNumberItemOk() (*float32, bool)` - -GetNumberItemOk returns a tuple with the NumberItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumberItem - -`func (o *TypeHolderExample) SetNumberItem(v float32)` - -SetNumberItem sets NumberItem field to given value. - - -### GetFloatItem - -`func (o *TypeHolderExample) GetFloatItem() float32` - -GetFloatItem returns the FloatItem field if non-nil, zero value otherwise. - -### GetFloatItemOk - -`func (o *TypeHolderExample) GetFloatItemOk() (*float32, bool)` - -GetFloatItemOk returns a tuple with the FloatItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFloatItem - -`func (o *TypeHolderExample) SetFloatItem(v float32)` - -SetFloatItem sets FloatItem field to given value. - - -### GetIntegerItem - -`func (o *TypeHolderExample) GetIntegerItem() int32` - -GetIntegerItem returns the IntegerItem field if non-nil, zero value otherwise. - -### GetIntegerItemOk - -`func (o *TypeHolderExample) GetIntegerItemOk() (*int32, bool)` - -GetIntegerItemOk returns a tuple with the IntegerItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIntegerItem - -`func (o *TypeHolderExample) SetIntegerItem(v int32)` - -SetIntegerItem sets IntegerItem field to given value. - - -### GetBoolItem - -`func (o *TypeHolderExample) GetBoolItem() bool` - -GetBoolItem returns the BoolItem field if non-nil, zero value otherwise. - -### GetBoolItemOk - -`func (o *TypeHolderExample) GetBoolItemOk() (*bool, bool)` - -GetBoolItemOk returns a tuple with the BoolItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBoolItem - -`func (o *TypeHolderExample) SetBoolItem(v bool)` - -SetBoolItem sets BoolItem field to given value. - - -### GetArrayItem - -`func (o *TypeHolderExample) GetArrayItem() []int32` - -GetArrayItem returns the ArrayItem field if non-nil, zero value otherwise. - -### GetArrayItemOk - -`func (o *TypeHolderExample) GetArrayItemOk() (*[]int32, bool)` - -GetArrayItemOk returns a tuple with the ArrayItem field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayItem - -`func (o *TypeHolderExample) SetArrayItem(v []int32)` - -SetArrayItem sets ArrayItem field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/User.md b/samples/client/petstore/go-experimental/go-petstore/docs/User.md deleted file mode 100644 index a6bea41030b..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/User.md +++ /dev/null @@ -1,238 +0,0 @@ -# User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Username** | Pointer to **string** | | [optional] -**FirstName** | Pointer to **string** | | [optional] -**LastName** | Pointer to **string** | | [optional] -**Email** | Pointer to **string** | | [optional] -**Password** | Pointer to **string** | | [optional] -**Phone** | Pointer to **string** | | [optional] -**UserStatus** | Pointer to **int32** | User Status | [optional] - -## Methods - -### NewUser - -`func NewUser() *User` - -NewUser instantiates a new User object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUserWithDefaults - -`func NewUserWithDefaults() *User` - -NewUserWithDefaults instantiates a new User object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *User) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *User) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *User) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *User) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetUsername - -`func (o *User) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *User) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *User) SetUsername(v string)` - -SetUsername sets Username field to given value. - -### HasUsername - -`func (o *User) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. - -### GetFirstName - -`func (o *User) GetFirstName() string` - -GetFirstName returns the FirstName field if non-nil, zero value otherwise. - -### GetFirstNameOk - -`func (o *User) GetFirstNameOk() (*string, bool)` - -GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFirstName - -`func (o *User) SetFirstName(v string)` - -SetFirstName sets FirstName field to given value. - -### HasFirstName - -`func (o *User) HasFirstName() bool` - -HasFirstName returns a boolean if a field has been set. - -### GetLastName - -`func (o *User) GetLastName() string` - -GetLastName returns the LastName field if non-nil, zero value otherwise. - -### GetLastNameOk - -`func (o *User) GetLastNameOk() (*string, bool)` - -GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastName - -`func (o *User) SetLastName(v string)` - -SetLastName sets LastName field to given value. - -### HasLastName - -`func (o *User) HasLastName() bool` - -HasLastName returns a boolean if a field has been set. - -### GetEmail - -`func (o *User) GetEmail() string` - -GetEmail returns the Email field if non-nil, zero value otherwise. - -### GetEmailOk - -`func (o *User) GetEmailOk() (*string, bool)` - -GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEmail - -`func (o *User) SetEmail(v string)` - -SetEmail sets Email field to given value. - -### HasEmail - -`func (o *User) HasEmail() bool` - -HasEmail returns a boolean if a field has been set. - -### GetPassword - -`func (o *User) GetPassword() string` - -GetPassword returns the Password field if non-nil, zero value otherwise. - -### GetPasswordOk - -`func (o *User) GetPasswordOk() (*string, bool)` - -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPassword - -`func (o *User) SetPassword(v string)` - -SetPassword sets Password field to given value. - -### HasPassword - -`func (o *User) HasPassword() bool` - -HasPassword returns a boolean if a field has been set. - -### GetPhone - -`func (o *User) GetPhone() string` - -GetPhone returns the Phone field if non-nil, zero value otherwise. - -### GetPhoneOk - -`func (o *User) GetPhoneOk() (*string, bool)` - -GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPhone - -`func (o *User) SetPhone(v string)` - -SetPhone sets Phone field to given value. - -### HasPhone - -`func (o *User) HasPhone() bool` - -HasPhone returns a boolean if a field has been set. - -### GetUserStatus - -`func (o *User) GetUserStatus() int32` - -GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. - -### GetUserStatusOk - -`func (o *User) GetUserStatusOk() (*int32, bool)` - -GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserStatus - -`func (o *User) SetUserStatus(v int32)` - -SetUserStatus sets UserStatus field to given value. - -### HasUserStatus - -`func (o *User) HasUserStatus() bool` - -HasUserStatus returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/UserApi.md b/samples/client/petstore/go-experimental/go-petstore/docs/UserApi.md deleted file mode 100644 index 761b86e84be..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/UserApi.md +++ /dev/null @@ -1,533 +0,0 @@ -# \UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateUser**](UserApi.md#CreateUser) | **Post** /user | Create user -[**CreateUsersWithArrayInput**](UserApi.md#CreateUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array -[**CreateUsersWithListInput**](UserApi.md#CreateUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array -[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /user/{username} | Delete user -[**GetUserByName**](UserApi.md#GetUserByName) | **Get** /user/{username} | Get user by user name -[**LoginUser**](UserApi.md#LoginUser) | **Get** /user/login | Logs user into the system -[**LogoutUser**](UserApi.md#LogoutUser) | **Get** /user/logout | Logs out current logged in user session -[**UpdateUser**](UserApi.md#UpdateUser) | **Put** /user/{username} | Updated user - - - -## CreateUser - -> CreateUser(ctx).Body(body).Execute() - -Create user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123} // User | Created user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUser(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## CreateUsersWithArrayInput - -> CreateUsersWithArrayInput(ctx).Body(body).Execute() - -Creates list of users with given input array - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := []User{openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123}} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUsersWithArrayInputRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[]User**](User.md) | List of user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## CreateUsersWithListInput - -> CreateUsersWithListInput(ctx).Body(body).Execute() - -Creates list of users with given input array - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := []User{} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background(), body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUsersWithListInputRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[]User**](User.md) | List of user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeleteUser - -> DeleteUser(ctx, username).Execute() - -Delete user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | The name that needs to be deleted - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string** | The name that needs to be deleted | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetUserByName - -> User GetUserByName(ctx, username).Execute() - -Get user by user name - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUserByName`: User - fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserByName`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string** | The name that needs to be fetched. Use user1 for testing. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetUserByNameRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## LoginUser - -> string LoginUser(ctx).Username(username).Password(password).Execute() - -Logs user into the system - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | The user name for login - password := "password_example" // string | The password for login in clear text - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LoginUser(context.Background(), username, password).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `LoginUser`: string - fmt.Fprintf(os.Stdout, "Response from `UserApi.LoginUser`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiLoginUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string** | The user name for login | - **password** | **string** | The password for login in clear text | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## LogoutUser - -> LogoutUser(ctx).Execute() - -Logs out current logged in user session - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LogoutUser(context.Background(), ).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiLogoutUserRequest struct via the builder pattern - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdateUser - -> UpdateUser(ctx, username).Body(body).Execute() - -Updated user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | name that need to be deleted - body := // User | Updated user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username, body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string** | name that need to be deleted | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | [**User**](User.md) | Updated user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md b/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md deleted file mode 100644 index b309819923e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/docs/XmlItem.md +++ /dev/null @@ -1,784 +0,0 @@ -# XmlItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AttributeString** | Pointer to **string** | | [optional] -**AttributeNumber** | Pointer to **float32** | | [optional] -**AttributeInteger** | Pointer to **int32** | | [optional] -**AttributeBoolean** | Pointer to **bool** | | [optional] -**WrappedArray** | Pointer to **[]int32** | | [optional] -**NameString** | Pointer to **string** | | [optional] -**NameNumber** | Pointer to **float32** | | [optional] -**NameInteger** | Pointer to **int32** | | [optional] -**NameBoolean** | Pointer to **bool** | | [optional] -**NameArray** | Pointer to **[]int32** | | [optional] -**NameWrappedArray** | Pointer to **[]int32** | | [optional] -**PrefixString** | Pointer to **string** | | [optional] -**PrefixNumber** | Pointer to **float32** | | [optional] -**PrefixInteger** | Pointer to **int32** | | [optional] -**PrefixBoolean** | Pointer to **bool** | | [optional] -**PrefixArray** | Pointer to **[]int32** | | [optional] -**PrefixWrappedArray** | Pointer to **[]int32** | | [optional] -**NamespaceString** | Pointer to **string** | | [optional] -**NamespaceNumber** | Pointer to **float32** | | [optional] -**NamespaceInteger** | Pointer to **int32** | | [optional] -**NamespaceBoolean** | Pointer to **bool** | | [optional] -**NamespaceArray** | Pointer to **[]int32** | | [optional] -**NamespaceWrappedArray** | Pointer to **[]int32** | | [optional] -**PrefixNsString** | Pointer to **string** | | [optional] -**PrefixNsNumber** | Pointer to **float32** | | [optional] -**PrefixNsInteger** | Pointer to **int32** | | [optional] -**PrefixNsBoolean** | Pointer to **bool** | | [optional] -**PrefixNsArray** | Pointer to **[]int32** | | [optional] -**PrefixNsWrappedArray** | Pointer to **[]int32** | | [optional] - -## Methods - -### NewXmlItem - -`func NewXmlItem() *XmlItem` - -NewXmlItem instantiates a new XmlItem object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewXmlItemWithDefaults - -`func NewXmlItemWithDefaults() *XmlItem` - -NewXmlItemWithDefaults instantiates a new XmlItem object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetAttributeString - -`func (o *XmlItem) GetAttributeString() string` - -GetAttributeString returns the AttributeString field if non-nil, zero value otherwise. - -### GetAttributeStringOk - -`func (o *XmlItem) GetAttributeStringOk() (*string, bool)` - -GetAttributeStringOk returns a tuple with the AttributeString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAttributeString - -`func (o *XmlItem) SetAttributeString(v string)` - -SetAttributeString sets AttributeString field to given value. - -### HasAttributeString - -`func (o *XmlItem) HasAttributeString() bool` - -HasAttributeString returns a boolean if a field has been set. - -### GetAttributeNumber - -`func (o *XmlItem) GetAttributeNumber() float32` - -GetAttributeNumber returns the AttributeNumber field if non-nil, zero value otherwise. - -### GetAttributeNumberOk - -`func (o *XmlItem) GetAttributeNumberOk() (*float32, bool)` - -GetAttributeNumberOk returns a tuple with the AttributeNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAttributeNumber - -`func (o *XmlItem) SetAttributeNumber(v float32)` - -SetAttributeNumber sets AttributeNumber field to given value. - -### HasAttributeNumber - -`func (o *XmlItem) HasAttributeNumber() bool` - -HasAttributeNumber returns a boolean if a field has been set. - -### GetAttributeInteger - -`func (o *XmlItem) GetAttributeInteger() int32` - -GetAttributeInteger returns the AttributeInteger field if non-nil, zero value otherwise. - -### GetAttributeIntegerOk - -`func (o *XmlItem) GetAttributeIntegerOk() (*int32, bool)` - -GetAttributeIntegerOk returns a tuple with the AttributeInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAttributeInteger - -`func (o *XmlItem) SetAttributeInteger(v int32)` - -SetAttributeInteger sets AttributeInteger field to given value. - -### HasAttributeInteger - -`func (o *XmlItem) HasAttributeInteger() bool` - -HasAttributeInteger returns a boolean if a field has been set. - -### GetAttributeBoolean - -`func (o *XmlItem) GetAttributeBoolean() bool` - -GetAttributeBoolean returns the AttributeBoolean field if non-nil, zero value otherwise. - -### GetAttributeBooleanOk - -`func (o *XmlItem) GetAttributeBooleanOk() (*bool, bool)` - -GetAttributeBooleanOk returns a tuple with the AttributeBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAttributeBoolean - -`func (o *XmlItem) SetAttributeBoolean(v bool)` - -SetAttributeBoolean sets AttributeBoolean field to given value. - -### HasAttributeBoolean - -`func (o *XmlItem) HasAttributeBoolean() bool` - -HasAttributeBoolean returns a boolean if a field has been set. - -### GetWrappedArray - -`func (o *XmlItem) GetWrappedArray() []int32` - -GetWrappedArray returns the WrappedArray field if non-nil, zero value otherwise. - -### GetWrappedArrayOk - -`func (o *XmlItem) GetWrappedArrayOk() (*[]int32, bool)` - -GetWrappedArrayOk returns a tuple with the WrappedArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWrappedArray - -`func (o *XmlItem) SetWrappedArray(v []int32)` - -SetWrappedArray sets WrappedArray field to given value. - -### HasWrappedArray - -`func (o *XmlItem) HasWrappedArray() bool` - -HasWrappedArray returns a boolean if a field has been set. - -### GetNameString - -`func (o *XmlItem) GetNameString() string` - -GetNameString returns the NameString field if non-nil, zero value otherwise. - -### GetNameStringOk - -`func (o *XmlItem) GetNameStringOk() (*string, bool)` - -GetNameStringOk returns a tuple with the NameString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNameString - -`func (o *XmlItem) SetNameString(v string)` - -SetNameString sets NameString field to given value. - -### HasNameString - -`func (o *XmlItem) HasNameString() bool` - -HasNameString returns a boolean if a field has been set. - -### GetNameNumber - -`func (o *XmlItem) GetNameNumber() float32` - -GetNameNumber returns the NameNumber field if non-nil, zero value otherwise. - -### GetNameNumberOk - -`func (o *XmlItem) GetNameNumberOk() (*float32, bool)` - -GetNameNumberOk returns a tuple with the NameNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNameNumber - -`func (o *XmlItem) SetNameNumber(v float32)` - -SetNameNumber sets NameNumber field to given value. - -### HasNameNumber - -`func (o *XmlItem) HasNameNumber() bool` - -HasNameNumber returns a boolean if a field has been set. - -### GetNameInteger - -`func (o *XmlItem) GetNameInteger() int32` - -GetNameInteger returns the NameInteger field if non-nil, zero value otherwise. - -### GetNameIntegerOk - -`func (o *XmlItem) GetNameIntegerOk() (*int32, bool)` - -GetNameIntegerOk returns a tuple with the NameInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNameInteger - -`func (o *XmlItem) SetNameInteger(v int32)` - -SetNameInteger sets NameInteger field to given value. - -### HasNameInteger - -`func (o *XmlItem) HasNameInteger() bool` - -HasNameInteger returns a boolean if a field has been set. - -### GetNameBoolean - -`func (o *XmlItem) GetNameBoolean() bool` - -GetNameBoolean returns the NameBoolean field if non-nil, zero value otherwise. - -### GetNameBooleanOk - -`func (o *XmlItem) GetNameBooleanOk() (*bool, bool)` - -GetNameBooleanOk returns a tuple with the NameBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNameBoolean - -`func (o *XmlItem) SetNameBoolean(v bool)` - -SetNameBoolean sets NameBoolean field to given value. - -### HasNameBoolean - -`func (o *XmlItem) HasNameBoolean() bool` - -HasNameBoolean returns a boolean if a field has been set. - -### GetNameArray - -`func (o *XmlItem) GetNameArray() []int32` - -GetNameArray returns the NameArray field if non-nil, zero value otherwise. - -### GetNameArrayOk - -`func (o *XmlItem) GetNameArrayOk() (*[]int32, bool)` - -GetNameArrayOk returns a tuple with the NameArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNameArray - -`func (o *XmlItem) SetNameArray(v []int32)` - -SetNameArray sets NameArray field to given value. - -### HasNameArray - -`func (o *XmlItem) HasNameArray() bool` - -HasNameArray returns a boolean if a field has been set. - -### GetNameWrappedArray - -`func (o *XmlItem) GetNameWrappedArray() []int32` - -GetNameWrappedArray returns the NameWrappedArray field if non-nil, zero value otherwise. - -### GetNameWrappedArrayOk - -`func (o *XmlItem) GetNameWrappedArrayOk() (*[]int32, bool)` - -GetNameWrappedArrayOk returns a tuple with the NameWrappedArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNameWrappedArray - -`func (o *XmlItem) SetNameWrappedArray(v []int32)` - -SetNameWrappedArray sets NameWrappedArray field to given value. - -### HasNameWrappedArray - -`func (o *XmlItem) HasNameWrappedArray() bool` - -HasNameWrappedArray returns a boolean if a field has been set. - -### GetPrefixString - -`func (o *XmlItem) GetPrefixString() string` - -GetPrefixString returns the PrefixString field if non-nil, zero value otherwise. - -### GetPrefixStringOk - -`func (o *XmlItem) GetPrefixStringOk() (*string, bool)` - -GetPrefixStringOk returns a tuple with the PrefixString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixString - -`func (o *XmlItem) SetPrefixString(v string)` - -SetPrefixString sets PrefixString field to given value. - -### HasPrefixString - -`func (o *XmlItem) HasPrefixString() bool` - -HasPrefixString returns a boolean if a field has been set. - -### GetPrefixNumber - -`func (o *XmlItem) GetPrefixNumber() float32` - -GetPrefixNumber returns the PrefixNumber field if non-nil, zero value otherwise. - -### GetPrefixNumberOk - -`func (o *XmlItem) GetPrefixNumberOk() (*float32, bool)` - -GetPrefixNumberOk returns a tuple with the PrefixNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNumber - -`func (o *XmlItem) SetPrefixNumber(v float32)` - -SetPrefixNumber sets PrefixNumber field to given value. - -### HasPrefixNumber - -`func (o *XmlItem) HasPrefixNumber() bool` - -HasPrefixNumber returns a boolean if a field has been set. - -### GetPrefixInteger - -`func (o *XmlItem) GetPrefixInteger() int32` - -GetPrefixInteger returns the PrefixInteger field if non-nil, zero value otherwise. - -### GetPrefixIntegerOk - -`func (o *XmlItem) GetPrefixIntegerOk() (*int32, bool)` - -GetPrefixIntegerOk returns a tuple with the PrefixInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixInteger - -`func (o *XmlItem) SetPrefixInteger(v int32)` - -SetPrefixInteger sets PrefixInteger field to given value. - -### HasPrefixInteger - -`func (o *XmlItem) HasPrefixInteger() bool` - -HasPrefixInteger returns a boolean if a field has been set. - -### GetPrefixBoolean - -`func (o *XmlItem) GetPrefixBoolean() bool` - -GetPrefixBoolean returns the PrefixBoolean field if non-nil, zero value otherwise. - -### GetPrefixBooleanOk - -`func (o *XmlItem) GetPrefixBooleanOk() (*bool, bool)` - -GetPrefixBooleanOk returns a tuple with the PrefixBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixBoolean - -`func (o *XmlItem) SetPrefixBoolean(v bool)` - -SetPrefixBoolean sets PrefixBoolean field to given value. - -### HasPrefixBoolean - -`func (o *XmlItem) HasPrefixBoolean() bool` - -HasPrefixBoolean returns a boolean if a field has been set. - -### GetPrefixArray - -`func (o *XmlItem) GetPrefixArray() []int32` - -GetPrefixArray returns the PrefixArray field if non-nil, zero value otherwise. - -### GetPrefixArrayOk - -`func (o *XmlItem) GetPrefixArrayOk() (*[]int32, bool)` - -GetPrefixArrayOk returns a tuple with the PrefixArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixArray - -`func (o *XmlItem) SetPrefixArray(v []int32)` - -SetPrefixArray sets PrefixArray field to given value. - -### HasPrefixArray - -`func (o *XmlItem) HasPrefixArray() bool` - -HasPrefixArray returns a boolean if a field has been set. - -### GetPrefixWrappedArray - -`func (o *XmlItem) GetPrefixWrappedArray() []int32` - -GetPrefixWrappedArray returns the PrefixWrappedArray field if non-nil, zero value otherwise. - -### GetPrefixWrappedArrayOk - -`func (o *XmlItem) GetPrefixWrappedArrayOk() (*[]int32, bool)` - -GetPrefixWrappedArrayOk returns a tuple with the PrefixWrappedArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixWrappedArray - -`func (o *XmlItem) SetPrefixWrappedArray(v []int32)` - -SetPrefixWrappedArray sets PrefixWrappedArray field to given value. - -### HasPrefixWrappedArray - -`func (o *XmlItem) HasPrefixWrappedArray() bool` - -HasPrefixWrappedArray returns a boolean if a field has been set. - -### GetNamespaceString - -`func (o *XmlItem) GetNamespaceString() string` - -GetNamespaceString returns the NamespaceString field if non-nil, zero value otherwise. - -### GetNamespaceStringOk - -`func (o *XmlItem) GetNamespaceStringOk() (*string, bool)` - -GetNamespaceStringOk returns a tuple with the NamespaceString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaceString - -`func (o *XmlItem) SetNamespaceString(v string)` - -SetNamespaceString sets NamespaceString field to given value. - -### HasNamespaceString - -`func (o *XmlItem) HasNamespaceString() bool` - -HasNamespaceString returns a boolean if a field has been set. - -### GetNamespaceNumber - -`func (o *XmlItem) GetNamespaceNumber() float32` - -GetNamespaceNumber returns the NamespaceNumber field if non-nil, zero value otherwise. - -### GetNamespaceNumberOk - -`func (o *XmlItem) GetNamespaceNumberOk() (*float32, bool)` - -GetNamespaceNumberOk returns a tuple with the NamespaceNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaceNumber - -`func (o *XmlItem) SetNamespaceNumber(v float32)` - -SetNamespaceNumber sets NamespaceNumber field to given value. - -### HasNamespaceNumber - -`func (o *XmlItem) HasNamespaceNumber() bool` - -HasNamespaceNumber returns a boolean if a field has been set. - -### GetNamespaceInteger - -`func (o *XmlItem) GetNamespaceInteger() int32` - -GetNamespaceInteger returns the NamespaceInteger field if non-nil, zero value otherwise. - -### GetNamespaceIntegerOk - -`func (o *XmlItem) GetNamespaceIntegerOk() (*int32, bool)` - -GetNamespaceIntegerOk returns a tuple with the NamespaceInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaceInteger - -`func (o *XmlItem) SetNamespaceInteger(v int32)` - -SetNamespaceInteger sets NamespaceInteger field to given value. - -### HasNamespaceInteger - -`func (o *XmlItem) HasNamespaceInteger() bool` - -HasNamespaceInteger returns a boolean if a field has been set. - -### GetNamespaceBoolean - -`func (o *XmlItem) GetNamespaceBoolean() bool` - -GetNamespaceBoolean returns the NamespaceBoolean field if non-nil, zero value otherwise. - -### GetNamespaceBooleanOk - -`func (o *XmlItem) GetNamespaceBooleanOk() (*bool, bool)` - -GetNamespaceBooleanOk returns a tuple with the NamespaceBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaceBoolean - -`func (o *XmlItem) SetNamespaceBoolean(v bool)` - -SetNamespaceBoolean sets NamespaceBoolean field to given value. - -### HasNamespaceBoolean - -`func (o *XmlItem) HasNamespaceBoolean() bool` - -HasNamespaceBoolean returns a boolean if a field has been set. - -### GetNamespaceArray - -`func (o *XmlItem) GetNamespaceArray() []int32` - -GetNamespaceArray returns the NamespaceArray field if non-nil, zero value otherwise. - -### GetNamespaceArrayOk - -`func (o *XmlItem) GetNamespaceArrayOk() (*[]int32, bool)` - -GetNamespaceArrayOk returns a tuple with the NamespaceArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaceArray - -`func (o *XmlItem) SetNamespaceArray(v []int32)` - -SetNamespaceArray sets NamespaceArray field to given value. - -### HasNamespaceArray - -`func (o *XmlItem) HasNamespaceArray() bool` - -HasNamespaceArray returns a boolean if a field has been set. - -### GetNamespaceWrappedArray - -`func (o *XmlItem) GetNamespaceWrappedArray() []int32` - -GetNamespaceWrappedArray returns the NamespaceWrappedArray field if non-nil, zero value otherwise. - -### GetNamespaceWrappedArrayOk - -`func (o *XmlItem) GetNamespaceWrappedArrayOk() (*[]int32, bool)` - -GetNamespaceWrappedArrayOk returns a tuple with the NamespaceWrappedArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaceWrappedArray - -`func (o *XmlItem) SetNamespaceWrappedArray(v []int32)` - -SetNamespaceWrappedArray sets NamespaceWrappedArray field to given value. - -### HasNamespaceWrappedArray - -`func (o *XmlItem) HasNamespaceWrappedArray() bool` - -HasNamespaceWrappedArray returns a boolean if a field has been set. - -### GetPrefixNsString - -`func (o *XmlItem) GetPrefixNsString() string` - -GetPrefixNsString returns the PrefixNsString field if non-nil, zero value otherwise. - -### GetPrefixNsStringOk - -`func (o *XmlItem) GetPrefixNsStringOk() (*string, bool)` - -GetPrefixNsStringOk returns a tuple with the PrefixNsString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNsString - -`func (o *XmlItem) SetPrefixNsString(v string)` - -SetPrefixNsString sets PrefixNsString field to given value. - -### HasPrefixNsString - -`func (o *XmlItem) HasPrefixNsString() bool` - -HasPrefixNsString returns a boolean if a field has been set. - -### GetPrefixNsNumber - -`func (o *XmlItem) GetPrefixNsNumber() float32` - -GetPrefixNsNumber returns the PrefixNsNumber field if non-nil, zero value otherwise. - -### GetPrefixNsNumberOk - -`func (o *XmlItem) GetPrefixNsNumberOk() (*float32, bool)` - -GetPrefixNsNumberOk returns a tuple with the PrefixNsNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNsNumber - -`func (o *XmlItem) SetPrefixNsNumber(v float32)` - -SetPrefixNsNumber sets PrefixNsNumber field to given value. - -### HasPrefixNsNumber - -`func (o *XmlItem) HasPrefixNsNumber() bool` - -HasPrefixNsNumber returns a boolean if a field has been set. - -### GetPrefixNsInteger - -`func (o *XmlItem) GetPrefixNsInteger() int32` - -GetPrefixNsInteger returns the PrefixNsInteger field if non-nil, zero value otherwise. - -### GetPrefixNsIntegerOk - -`func (o *XmlItem) GetPrefixNsIntegerOk() (*int32, bool)` - -GetPrefixNsIntegerOk returns a tuple with the PrefixNsInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNsInteger - -`func (o *XmlItem) SetPrefixNsInteger(v int32)` - -SetPrefixNsInteger sets PrefixNsInteger field to given value. - -### HasPrefixNsInteger - -`func (o *XmlItem) HasPrefixNsInteger() bool` - -HasPrefixNsInteger returns a boolean if a field has been set. - -### GetPrefixNsBoolean - -`func (o *XmlItem) GetPrefixNsBoolean() bool` - -GetPrefixNsBoolean returns the PrefixNsBoolean field if non-nil, zero value otherwise. - -### GetPrefixNsBooleanOk - -`func (o *XmlItem) GetPrefixNsBooleanOk() (*bool, bool)` - -GetPrefixNsBooleanOk returns a tuple with the PrefixNsBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNsBoolean - -`func (o *XmlItem) SetPrefixNsBoolean(v bool)` - -SetPrefixNsBoolean sets PrefixNsBoolean field to given value. - -### HasPrefixNsBoolean - -`func (o *XmlItem) HasPrefixNsBoolean() bool` - -HasPrefixNsBoolean returns a boolean if a field has been set. - -### GetPrefixNsArray - -`func (o *XmlItem) GetPrefixNsArray() []int32` - -GetPrefixNsArray returns the PrefixNsArray field if non-nil, zero value otherwise. - -### GetPrefixNsArrayOk - -`func (o *XmlItem) GetPrefixNsArrayOk() (*[]int32, bool)` - -GetPrefixNsArrayOk returns a tuple with the PrefixNsArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNsArray - -`func (o *XmlItem) SetPrefixNsArray(v []int32)` - -SetPrefixNsArray sets PrefixNsArray field to given value. - -### HasPrefixNsArray - -`func (o *XmlItem) HasPrefixNsArray() bool` - -HasPrefixNsArray returns a boolean if a field has been set. - -### GetPrefixNsWrappedArray - -`func (o *XmlItem) GetPrefixNsWrappedArray() []int32` - -GetPrefixNsWrappedArray returns the PrefixNsWrappedArray field if non-nil, zero value otherwise. - -### GetPrefixNsWrappedArrayOk - -`func (o *XmlItem) GetPrefixNsWrappedArrayOk() (*[]int32, bool)` - -GetPrefixNsWrappedArrayOk returns a tuple with the PrefixNsWrappedArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPrefixNsWrappedArray - -`func (o *XmlItem) SetPrefixNsWrappedArray(v []int32)` - -SetPrefixNsWrappedArray sets PrefixNsWrappedArray field to given value. - -### HasPrefixNsWrappedArray - -`func (o *XmlItem) HasPrefixNsWrappedArray() bool` - -HasPrefixNsWrappedArray returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go-experimental/go-petstore/git_push.sh b/samples/client/petstore/go-experimental/go-petstore/git_push.sh deleted file mode 100644 index ced3be2b0c7..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/go-experimental/go-petstore/go.mod b/samples/client/petstore/go-experimental/go-petstore/go.mod deleted file mode 100644 index f9811556cc5..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/GIT_USER_ID/GIT_REPO_ID - -go 1.13 - -require ( - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 -) diff --git a/samples/client/petstore/go-experimental/go-petstore/go.sum b/samples/client/petstore/go-experimental/go-petstore/go.sum deleted file mode 100644 index ce55b3c6a08..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/go.sum +++ /dev/null @@ -1,15 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/client/petstore/go-experimental/go-petstore/model_200_response.go deleted file mode 100644 index c23c13c54c2..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_200_response.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Model200Response Model for testing model name starting with number -type Model200Response struct { - Name *int32 `json:"name,omitempty"` - Class *string `json:"class,omitempty"` -} - -// NewModel200Response instantiates a new Model200Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModel200Response() *Model200Response { - this := Model200Response{} - return &this -} - -// NewModel200ResponseWithDefaults instantiates a new Model200Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModel200ResponseWithDefaults() *Model200Response { - this := Model200Response{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Model200Response) GetName() int32 { - if o == nil || o.Name == nil { - var ret int32 - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model200Response) GetNameOk() (*int32, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *Model200Response) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given int32 and assigns it to the Name field. -func (o *Model200Response) SetName(v int32) { - o.Name = &v -} - -// GetClass returns the Class field value if set, zero value otherwise. -func (o *Model200Response) GetClass() string { - if o == nil || o.Class == nil { - var ret string - return ret - } - return *o.Class -} - -// GetClassOk returns a tuple with the Class field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model200Response) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false - } - return o.Class, true -} - -// HasClass returns a boolean if a field has been set. -func (o *Model200Response) HasClass() bool { - if o != nil && o.Class != nil { - return true - } - - return false -} - -// SetClass gets a reference to the given string and assigns it to the Class field. -func (o *Model200Response) SetClass(v string) { - o.Class = &v -} - -func (o Model200Response) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Class != nil { - toSerialize["class"] = o.Class - } - return json.Marshal(toSerialize) -} - -type NullableModel200Response struct { - value *Model200Response - isSet bool -} - -func (v NullableModel200Response) Get() *Model200Response { - return v.value -} - -func (v *NullableModel200Response) Set(val *Model200Response) { - v.value = val - v.isSet = true -} - -func (v NullableModel200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableModel200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModel200Response(val *Model200Response) *NullableModel200Response { - return &NullableModel200Response{value: val, isSet: true} -} - -func (v NullableModel200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModel200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go deleted file mode 100644 index a511ab6d5be..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_any_type.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType -type AdditionalPropertiesAnyType struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesAnyType() *AdditionalPropertiesAnyType { - this := AdditionalPropertiesAnyType{} - return &this -} - -// NewAdditionalPropertiesAnyTypeWithDefaults instantiates a new AdditionalPropertiesAnyType object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesAnyTypeWithDefaults() *AdditionalPropertiesAnyType { - this := AdditionalPropertiesAnyType{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesAnyType) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesAnyType) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesAnyType) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesAnyType) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesAnyType struct { - value *AdditionalPropertiesAnyType - isSet bool -} - -func (v NullableAdditionalPropertiesAnyType) Get() *AdditionalPropertiesAnyType { - return v.value -} - -func (v *NullableAdditionalPropertiesAnyType) Set(val *AdditionalPropertiesAnyType) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesAnyType) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesAnyType) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesAnyType(val *AdditionalPropertiesAnyType) *NullableAdditionalPropertiesAnyType { - return &NullableAdditionalPropertiesAnyType{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesAnyType) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go deleted file mode 100644 index 7952e9cd56a..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_array.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesArray struct for AdditionalPropertiesArray -type AdditionalPropertiesArray struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesArray() *AdditionalPropertiesArray { - this := AdditionalPropertiesArray{} - return &this -} - -// NewAdditionalPropertiesArrayWithDefaults instantiates a new AdditionalPropertiesArray object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesArrayWithDefaults() *AdditionalPropertiesArray { - this := AdditionalPropertiesArray{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesArray) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesArray) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesArray) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesArray) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesArray) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesArray struct { - value *AdditionalPropertiesArray - isSet bool -} - -func (v NullableAdditionalPropertiesArray) Get() *AdditionalPropertiesArray { - return v.value -} - -func (v *NullableAdditionalPropertiesArray) Set(val *AdditionalPropertiesArray) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesArray) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesArray) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesArray(val *AdditionalPropertiesArray) *NullableAdditionalPropertiesArray { - return &NullableAdditionalPropertiesArray{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesArray) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesArray) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go deleted file mode 100644 index f64d9633a47..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_boolean.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean -type AdditionalPropertiesBoolean struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesBoolean() *AdditionalPropertiesBoolean { - this := AdditionalPropertiesBoolean{} - return &this -} - -// NewAdditionalPropertiesBooleanWithDefaults instantiates a new AdditionalPropertiesBoolean object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesBooleanWithDefaults() *AdditionalPropertiesBoolean { - this := AdditionalPropertiesBoolean{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesBoolean) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesBoolean) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesBoolean) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesBoolean) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesBoolean struct { - value *AdditionalPropertiesBoolean - isSet bool -} - -func (v NullableAdditionalPropertiesBoolean) Get() *AdditionalPropertiesBoolean { - return v.value -} - -func (v *NullableAdditionalPropertiesBoolean) Set(val *AdditionalPropertiesBoolean) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesBoolean) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesBoolean) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesBoolean(val *AdditionalPropertiesBoolean) *NullableAdditionalPropertiesBoolean { - return &NullableAdditionalPropertiesBoolean{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesBoolean) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go deleted file mode 100644 index d60a6889b74..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ /dev/null @@ -1,474 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesClass struct for AdditionalPropertiesClass -type AdditionalPropertiesClass struct { - MapString *map[string]string `json:"map_string,omitempty"` - MapNumber *map[string]float32 `json:"map_number,omitempty"` - MapInteger *map[string]int32 `json:"map_integer,omitempty"` - MapBoolean *map[string]bool `json:"map_boolean,omitempty"` - MapArrayInteger *map[string][]int32 `json:"map_array_integer,omitempty"` - MapArrayAnytype *map[string][]map[string]interface{} `json:"map_array_anytype,omitempty"` - MapMapString *map[string]map[string]string `json:"map_map_string,omitempty"` - MapMapAnytype *map[string]map[string]map[string]interface{} `json:"map_map_anytype,omitempty"` - Anytype1 *map[string]interface{} `json:"anytype_1,omitempty"` - Anytype2 *map[string]interface{} `json:"anytype_2,omitempty"` - Anytype3 *map[string]interface{} `json:"anytype_3,omitempty"` -} - -// NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesClass() *AdditionalPropertiesClass { - this := AdditionalPropertiesClass{} - return &this -} - -// NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass { - this := AdditionalPropertiesClass{} - return &this -} - -// GetMapString returns the MapString field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapString() map[string]string { - if o == nil || o.MapString == nil { - var ret map[string]string - return ret - } - return *o.MapString -} - -// GetMapStringOk returns a tuple with the MapString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapStringOk() (*map[string]string, bool) { - if o == nil || o.MapString == nil { - return nil, false - } - return o.MapString, true -} - -// HasMapString returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapString() bool { - if o != nil && o.MapString != nil { - return true - } - - return false -} - -// SetMapString gets a reference to the given map[string]string and assigns it to the MapString field. -func (o *AdditionalPropertiesClass) SetMapString(v map[string]string) { - o.MapString = &v -} - -// GetMapNumber returns the MapNumber field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapNumber() map[string]float32 { - if o == nil || o.MapNumber == nil { - var ret map[string]float32 - return ret - } - return *o.MapNumber -} - -// GetMapNumberOk returns a tuple with the MapNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapNumberOk() (*map[string]float32, bool) { - if o == nil || o.MapNumber == nil { - return nil, false - } - return o.MapNumber, true -} - -// HasMapNumber returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapNumber() bool { - if o != nil && o.MapNumber != nil { - return true - } - - return false -} - -// SetMapNumber gets a reference to the given map[string]float32 and assigns it to the MapNumber field. -func (o *AdditionalPropertiesClass) SetMapNumber(v map[string]float32) { - o.MapNumber = &v -} - -// GetMapInteger returns the MapInteger field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapInteger() map[string]int32 { - if o == nil || o.MapInteger == nil { - var ret map[string]int32 - return ret - } - return *o.MapInteger -} - -// GetMapIntegerOk returns a tuple with the MapInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapIntegerOk() (*map[string]int32, bool) { - if o == nil || o.MapInteger == nil { - return nil, false - } - return o.MapInteger, true -} - -// HasMapInteger returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapInteger() bool { - if o != nil && o.MapInteger != nil { - return true - } - - return false -} - -// SetMapInteger gets a reference to the given map[string]int32 and assigns it to the MapInteger field. -func (o *AdditionalPropertiesClass) SetMapInteger(v map[string]int32) { - o.MapInteger = &v -} - -// GetMapBoolean returns the MapBoolean field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapBoolean() map[string]bool { - if o == nil || o.MapBoolean == nil { - var ret map[string]bool - return ret - } - return *o.MapBoolean -} - -// GetMapBooleanOk returns a tuple with the MapBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapBooleanOk() (*map[string]bool, bool) { - if o == nil || o.MapBoolean == nil { - return nil, false - } - return o.MapBoolean, true -} - -// HasMapBoolean returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapBoolean() bool { - if o != nil && o.MapBoolean != nil { - return true - } - - return false -} - -// SetMapBoolean gets a reference to the given map[string]bool and assigns it to the MapBoolean field. -func (o *AdditionalPropertiesClass) SetMapBoolean(v map[string]bool) { - o.MapBoolean = &v -} - -// GetMapArrayInteger returns the MapArrayInteger field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapArrayInteger() map[string][]int32 { - if o == nil || o.MapArrayInteger == nil { - var ret map[string][]int32 - return ret - } - return *o.MapArrayInteger -} - -// GetMapArrayIntegerOk returns a tuple with the MapArrayInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapArrayIntegerOk() (*map[string][]int32, bool) { - if o == nil || o.MapArrayInteger == nil { - return nil, false - } - return o.MapArrayInteger, true -} - -// HasMapArrayInteger returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapArrayInteger() bool { - if o != nil && o.MapArrayInteger != nil { - return true - } - - return false -} - -// SetMapArrayInteger gets a reference to the given map[string][]int32 and assigns it to the MapArrayInteger field. -func (o *AdditionalPropertiesClass) SetMapArrayInteger(v map[string][]int32) { - o.MapArrayInteger = &v -} - -// GetMapArrayAnytype returns the MapArrayAnytype field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapArrayAnytype() map[string][]map[string]interface{} { - if o == nil || o.MapArrayAnytype == nil { - var ret map[string][]map[string]interface{} - return ret - } - return *o.MapArrayAnytype -} - -// GetMapArrayAnytypeOk returns a tuple with the MapArrayAnytype field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapArrayAnytypeOk() (*map[string][]map[string]interface{}, bool) { - if o == nil || o.MapArrayAnytype == nil { - return nil, false - } - return o.MapArrayAnytype, true -} - -// HasMapArrayAnytype returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapArrayAnytype() bool { - if o != nil && o.MapArrayAnytype != nil { - return true - } - - return false -} - -// SetMapArrayAnytype gets a reference to the given map[string][]map[string]interface{} and assigns it to the MapArrayAnytype field. -func (o *AdditionalPropertiesClass) SetMapArrayAnytype(v map[string][]map[string]interface{}) { - o.MapArrayAnytype = &v -} - -// GetMapMapString returns the MapMapString field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapMapString() map[string]map[string]string { - if o == nil || o.MapMapString == nil { - var ret map[string]map[string]string - return ret - } - return *o.MapMapString -} - -// GetMapMapStringOk returns a tuple with the MapMapString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapMapStringOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapMapString == nil { - return nil, false - } - return o.MapMapString, true -} - -// HasMapMapString returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapMapString() bool { - if o != nil && o.MapMapString != nil { - return true - } - - return false -} - -// SetMapMapString gets a reference to the given map[string]map[string]string and assigns it to the MapMapString field. -func (o *AdditionalPropertiesClass) SetMapMapString(v map[string]map[string]string) { - o.MapMapString = &v -} - -// GetMapMapAnytype returns the MapMapAnytype field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapMapAnytype() map[string]map[string]map[string]interface{} { - if o == nil || o.MapMapAnytype == nil { - var ret map[string]map[string]map[string]interface{} - return ret - } - return *o.MapMapAnytype -} - -// GetMapMapAnytypeOk returns a tuple with the MapMapAnytype field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapMapAnytypeOk() (*map[string]map[string]map[string]interface{}, bool) { - if o == nil || o.MapMapAnytype == nil { - return nil, false - } - return o.MapMapAnytype, true -} - -// HasMapMapAnytype returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapMapAnytype() bool { - if o != nil && o.MapMapAnytype != nil { - return true - } - - return false -} - -// SetMapMapAnytype gets a reference to the given map[string]map[string]map[string]interface{} and assigns it to the MapMapAnytype field. -func (o *AdditionalPropertiesClass) SetMapMapAnytype(v map[string]map[string]map[string]interface{}) { - o.MapMapAnytype = &v -} - -// GetAnytype1 returns the Anytype1 field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{} { - if o == nil || o.Anytype1 == nil { - var ret map[string]interface{} - return ret - } - return *o.Anytype1 -} - -// GetAnytype1Ok returns a tuple with the Anytype1 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetAnytype1Ok() (*map[string]interface{}, bool) { - if o == nil || o.Anytype1 == nil { - return nil, false - } - return o.Anytype1, true -} - -// HasAnytype1 returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasAnytype1() bool { - if o != nil && o.Anytype1 != nil { - return true - } - - return false -} - -// SetAnytype1 gets a reference to the given map[string]interface{} and assigns it to the Anytype1 field. -func (o *AdditionalPropertiesClass) SetAnytype1(v map[string]interface{}) { - o.Anytype1 = &v -} - -// GetAnytype2 returns the Anytype2 field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{} { - if o == nil || o.Anytype2 == nil { - var ret map[string]interface{} - return ret - } - return *o.Anytype2 -} - -// GetAnytype2Ok returns a tuple with the Anytype2 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetAnytype2Ok() (*map[string]interface{}, bool) { - if o == nil || o.Anytype2 == nil { - return nil, false - } - return o.Anytype2, true -} - -// HasAnytype2 returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasAnytype2() bool { - if o != nil && o.Anytype2 != nil { - return true - } - - return false -} - -// SetAnytype2 gets a reference to the given map[string]interface{} and assigns it to the Anytype2 field. -func (o *AdditionalPropertiesClass) SetAnytype2(v map[string]interface{}) { - o.Anytype2 = &v -} - -// GetAnytype3 returns the Anytype3 field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{} { - if o == nil || o.Anytype3 == nil { - var ret map[string]interface{} - return ret - } - return *o.Anytype3 -} - -// GetAnytype3Ok returns a tuple with the Anytype3 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetAnytype3Ok() (*map[string]interface{}, bool) { - if o == nil || o.Anytype3 == nil { - return nil, false - } - return o.Anytype3, true -} - -// HasAnytype3 returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasAnytype3() bool { - if o != nil && o.Anytype3 != nil { - return true - } - - return false -} - -// SetAnytype3 gets a reference to the given map[string]interface{} and assigns it to the Anytype3 field. -func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{}) { - o.Anytype3 = &v -} - -func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MapString != nil { - toSerialize["map_string"] = o.MapString - } - if o.MapNumber != nil { - toSerialize["map_number"] = o.MapNumber - } - if o.MapInteger != nil { - toSerialize["map_integer"] = o.MapInteger - } - if o.MapBoolean != nil { - toSerialize["map_boolean"] = o.MapBoolean - } - if o.MapArrayInteger != nil { - toSerialize["map_array_integer"] = o.MapArrayInteger - } - if o.MapArrayAnytype != nil { - toSerialize["map_array_anytype"] = o.MapArrayAnytype - } - if o.MapMapString != nil { - toSerialize["map_map_string"] = o.MapMapString - } - if o.MapMapAnytype != nil { - toSerialize["map_map_anytype"] = o.MapMapAnytype - } - if o.Anytype1 != nil { - toSerialize["anytype_1"] = o.Anytype1 - } - if o.Anytype2 != nil { - toSerialize["anytype_2"] = o.Anytype2 - } - if o.Anytype3 != nil { - toSerialize["anytype_3"] = o.Anytype3 - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesClass struct { - value *AdditionalPropertiesClass - isSet bool -} - -func (v NullableAdditionalPropertiesClass) Get() *AdditionalPropertiesClass { - return v.value -} - -func (v *NullableAdditionalPropertiesClass) Set(val *AdditionalPropertiesClass) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesClass) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesClass(val *AdditionalPropertiesClass) *NullableAdditionalPropertiesClass { - return &NullableAdditionalPropertiesClass{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go deleted file mode 100644 index eeb60fc08db..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_integer.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger -type AdditionalPropertiesInteger struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesInteger() *AdditionalPropertiesInteger { - this := AdditionalPropertiesInteger{} - return &this -} - -// NewAdditionalPropertiesIntegerWithDefaults instantiates a new AdditionalPropertiesInteger object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesIntegerWithDefaults() *AdditionalPropertiesInteger { - this := AdditionalPropertiesInteger{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesInteger) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesInteger) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesInteger) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesInteger) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesInteger) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesInteger struct { - value *AdditionalPropertiesInteger - isSet bool -} - -func (v NullableAdditionalPropertiesInteger) Get() *AdditionalPropertiesInteger { - return v.value -} - -func (v *NullableAdditionalPropertiesInteger) Set(val *AdditionalPropertiesInteger) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesInteger) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesInteger) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesInteger(val *AdditionalPropertiesInteger) *NullableAdditionalPropertiesInteger { - return &NullableAdditionalPropertiesInteger{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesInteger) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesInteger) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go deleted file mode 100644 index bd385cbe088..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_number.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber -type AdditionalPropertiesNumber struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesNumber() *AdditionalPropertiesNumber { - this := AdditionalPropertiesNumber{} - return &this -} - -// NewAdditionalPropertiesNumberWithDefaults instantiates a new AdditionalPropertiesNumber object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesNumberWithDefaults() *AdditionalPropertiesNumber { - this := AdditionalPropertiesNumber{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesNumber) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesNumber) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesNumber) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesNumber) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesNumber) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesNumber struct { - value *AdditionalPropertiesNumber - isSet bool -} - -func (v NullableAdditionalPropertiesNumber) Get() *AdditionalPropertiesNumber { - return v.value -} - -func (v *NullableAdditionalPropertiesNumber) Set(val *AdditionalPropertiesNumber) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesNumber) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesNumber) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesNumber(val *AdditionalPropertiesNumber) *NullableAdditionalPropertiesNumber { - return &NullableAdditionalPropertiesNumber{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesNumber) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesNumber) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go deleted file mode 100644 index 69fb5e31044..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_object.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesObject struct for AdditionalPropertiesObject -type AdditionalPropertiesObject struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesObject() *AdditionalPropertiesObject { - this := AdditionalPropertiesObject{} - return &this -} - -// NewAdditionalPropertiesObjectWithDefaults instantiates a new AdditionalPropertiesObject object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesObjectWithDefaults() *AdditionalPropertiesObject { - this := AdditionalPropertiesObject{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesObject) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesObject) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesObject) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesObject) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesObject) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesObject struct { - value *AdditionalPropertiesObject - isSet bool -} - -func (v NullableAdditionalPropertiesObject) Get() *AdditionalPropertiesObject { - return v.value -} - -func (v *NullableAdditionalPropertiesObject) Set(val *AdditionalPropertiesObject) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesObject) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesObject) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesObject(val *AdditionalPropertiesObject) *NullableAdditionalPropertiesObject { - return &NullableAdditionalPropertiesObject{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesObject) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesObject) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go deleted file mode 100644 index 54928c3a1c9..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_additional_properties_string.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesString struct for AdditionalPropertiesString -type AdditionalPropertiesString struct { - Name *string `json:"name,omitempty"` -} - -// NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesString() *AdditionalPropertiesString { - this := AdditionalPropertiesString{} - return &this -} - -// NewAdditionalPropertiesStringWithDefaults instantiates a new AdditionalPropertiesString object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesStringWithDefaults() *AdditionalPropertiesString { - this := AdditionalPropertiesString{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *AdditionalPropertiesString) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesString) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *AdditionalPropertiesString) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *AdditionalPropertiesString) SetName(v string) { - o.Name = &v -} - -func (o AdditionalPropertiesString) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableAdditionalPropertiesString struct { - value *AdditionalPropertiesString - isSet bool -} - -func (v NullableAdditionalPropertiesString) Get() *AdditionalPropertiesString { - return v.value -} - -func (v *NullableAdditionalPropertiesString) Set(val *AdditionalPropertiesString) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesString) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesString(val *AdditionalPropertiesString) *NullableAdditionalPropertiesString { - return &NullableAdditionalPropertiesString{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/client/petstore/go-experimental/go-petstore/model_animal.go deleted file mode 100644 index 5aa1f60f02f..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_animal.go +++ /dev/null @@ -1,147 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Animal struct for Animal -type Animal struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` -} - -// NewAnimal instantiates a new Animal object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAnimal(className string, ) *Animal { - this := Animal{} - this.ClassName = className - var color string = "red" - this.Color = &color - return &this -} - -// NewAnimalWithDefaults instantiates a new Animal object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAnimalWithDefaults() *Animal { - this := Animal{} - var color string = "red" - this.Color = &color - return &this -} - -// GetClassName returns the ClassName field value -func (o *Animal) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// GetClassNameOk returns a tuple with the ClassName field value -// and a boolean to check if the value has been set. -func (o *Animal) GetClassNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ClassName, true -} - -// SetClassName sets field value -func (o *Animal) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *Animal) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Animal) GetColorOk() (*string, bool) { - if o == nil || o.Color == nil { - return nil, false - } - return o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *Animal) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *Animal) SetColor(v string) { - o.Color = &v -} - -func (o Animal) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["className"] = o.ClassName - } - if o.Color != nil { - toSerialize["color"] = o.Color - } - return json.Marshal(toSerialize) -} - -type NullableAnimal struct { - value *Animal - isSet bool -} - -func (v NullableAnimal) Get() *Animal { - return v.value -} - -func (v *NullableAnimal) Set(val *Animal) { - v.value = val - v.isSet = true -} - -func (v NullableAnimal) IsSet() bool { - return v.isSet -} - -func (v *NullableAnimal) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAnimal(val *Animal) *NullableAnimal { - return &NullableAnimal{value: val, isSet: true} -} - -func (v NullableAnimal) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAnimal) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/client/petstore/go-experimental/go-petstore/model_api_response.go deleted file mode 100644 index 17bf558d1c9..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_api_response.go +++ /dev/null @@ -1,186 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ApiResponse struct for ApiResponse -type ApiResponse struct { - Code *int32 `json:"code,omitempty"` - Type *string `json:"type,omitempty"` - Message *string `json:"message,omitempty"` -} - -// NewApiResponse instantiates a new ApiResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewApiResponse() *ApiResponse { - this := ApiResponse{} - return &this -} - -// NewApiResponseWithDefaults instantiates a new ApiResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewApiResponseWithDefaults() *ApiResponse { - this := ApiResponse{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *ApiResponse) GetCode() int32 { - if o == nil || o.Code == nil { - var ret int32 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetCodeOk() (*int32, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *ApiResponse) HasCode() bool { - if o != nil && o.Code != nil { - return true - } - - return false -} - -// SetCode gets a reference to the given int32 and assigns it to the Code field. -func (o *ApiResponse) SetCode(v int32) { - o.Code = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *ApiResponse) GetType() string { - if o == nil || o.Type == nil { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *ApiResponse) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *ApiResponse) SetType(v string) { - o.Type = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ApiResponse) GetMessage() string { - if o == nil || o.Message == nil { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ApiResponse) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ApiResponse) SetMessage(v string) { - o.Message = &v -} - -func (o ApiResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - if o.Message != nil { - toSerialize["message"] = o.Message - } - return json.Marshal(toSerialize) -} - -type NullableApiResponse struct { - value *ApiResponse - isSet bool -} - -func (v NullableApiResponse) Get() *ApiResponse { - return v.value -} - -func (v *NullableApiResponse) Set(val *ApiResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiResponse(val *ApiResponse) *NullableApiResponse { - return &NullableApiResponse{value: val, isSet: true} -} - -func (v NullableApiResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go deleted file mode 100644 index 6b81323ac4d..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly -type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` -} - -// NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly { - this := ArrayOfArrayOfNumberOnly{} - return &this -} - -// NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly { - this := ArrayOfArrayOfNumberOnly{} - return &this -} - -// GetArrayArrayNumber returns the ArrayArrayNumber field value if set, zero value otherwise. -func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { - if o == nil || o.ArrayArrayNumber == nil { - var ret [][]float32 - return ret - } - return *o.ArrayArrayNumber -} - -// GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool) { - if o == nil || o.ArrayArrayNumber == nil { - return nil, false - } - return o.ArrayArrayNumber, true -} - -// HasArrayArrayNumber returns a boolean if a field has been set. -func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { - if o != nil && o.ArrayArrayNumber != nil { - return true - } - - return false -} - -// SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. -func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { - o.ArrayArrayNumber = &v -} - -func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ArrayArrayNumber != nil { - toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber - } - return json.Marshal(toSerialize) -} - -type NullableArrayOfArrayOfNumberOnly struct { - value *ArrayOfArrayOfNumberOnly - isSet bool -} - -func (v NullableArrayOfArrayOfNumberOnly) Get() *ArrayOfArrayOfNumberOnly { - return v.value -} - -func (v *NullableArrayOfArrayOfNumberOnly) Set(val *ArrayOfArrayOfNumberOnly) { - v.value = val - v.isSet = true -} - -func (v NullableArrayOfArrayOfNumberOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableArrayOfArrayOfNumberOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArrayOfArrayOfNumberOnly(val *ArrayOfArrayOfNumberOnly) *NullableArrayOfArrayOfNumberOnly { - return &NullableArrayOfArrayOfNumberOnly{value: val, isSet: true} -} - -func (v NullableArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArrayOfArrayOfNumberOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go deleted file mode 100644 index f43bffc1c87..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ArrayOfNumberOnly struct for ArrayOfNumberOnly -type ArrayOfNumberOnly struct { - ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` -} - -// NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArrayOfNumberOnly() *ArrayOfNumberOnly { - this := ArrayOfNumberOnly{} - return &this -} - -// NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly { - this := ArrayOfNumberOnly{} - return &this -} - -// GetArrayNumber returns the ArrayNumber field value if set, zero value otherwise. -func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { - if o == nil || o.ArrayNumber == nil { - var ret []float32 - return ret - } - return *o.ArrayNumber -} - -// GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool) { - if o == nil || o.ArrayNumber == nil { - return nil, false - } - return o.ArrayNumber, true -} - -// HasArrayNumber returns a boolean if a field has been set. -func (o *ArrayOfNumberOnly) HasArrayNumber() bool { - if o != nil && o.ArrayNumber != nil { - return true - } - - return false -} - -// SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. -func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { - o.ArrayNumber = &v -} - -func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ArrayNumber != nil { - toSerialize["ArrayNumber"] = o.ArrayNumber - } - return json.Marshal(toSerialize) -} - -type NullableArrayOfNumberOnly struct { - value *ArrayOfNumberOnly - isSet bool -} - -func (v NullableArrayOfNumberOnly) Get() *ArrayOfNumberOnly { - return v.value -} - -func (v *NullableArrayOfNumberOnly) Set(val *ArrayOfNumberOnly) { - v.value = val - v.isSet = true -} - -func (v NullableArrayOfNumberOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableArrayOfNumberOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArrayOfNumberOnly(val *ArrayOfNumberOnly) *NullableArrayOfNumberOnly { - return &NullableArrayOfNumberOnly{value: val, isSet: true} -} - -func (v NullableArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArrayOfNumberOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go deleted file mode 100644 index 42e2be66d62..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ /dev/null @@ -1,186 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ArrayTest struct for ArrayTest -type ArrayTest struct { - ArrayOfString *[]string `json:"array_of_string,omitempty"` - ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` - ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` -} - -// NewArrayTest instantiates a new ArrayTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArrayTest() *ArrayTest { - this := ArrayTest{} - return &this -} - -// NewArrayTestWithDefaults instantiates a new ArrayTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArrayTestWithDefaults() *ArrayTest { - this := ArrayTest{} - return &this -} - -// GetArrayOfString returns the ArrayOfString field value if set, zero value otherwise. -func (o *ArrayTest) GetArrayOfString() []string { - if o == nil || o.ArrayOfString == nil { - var ret []string - return ret - } - return *o.ArrayOfString -} - -// GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool) { - if o == nil || o.ArrayOfString == nil { - return nil, false - } - return o.ArrayOfString, true -} - -// HasArrayOfString returns a boolean if a field has been set. -func (o *ArrayTest) HasArrayOfString() bool { - if o != nil && o.ArrayOfString != nil { - return true - } - - return false -} - -// SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. -func (o *ArrayTest) SetArrayOfString(v []string) { - o.ArrayOfString = &v -} - -// GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. -func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { - if o == nil || o.ArrayArrayOfInteger == nil { - var ret [][]int64 - return ret - } - return *o.ArrayArrayOfInteger -} - -// GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool) { - if o == nil || o.ArrayArrayOfInteger == nil { - return nil, false - } - return o.ArrayArrayOfInteger, true -} - -// HasArrayArrayOfInteger returns a boolean if a field has been set. -func (o *ArrayTest) HasArrayArrayOfInteger() bool { - if o != nil && o.ArrayArrayOfInteger != nil { - return true - } - - return false -} - -// SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. -func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { - o.ArrayArrayOfInteger = &v -} - -// GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. -func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { - if o == nil || o.ArrayArrayOfModel == nil { - var ret [][]ReadOnlyFirst - return ret - } - return *o.ArrayArrayOfModel -} - -// GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool) { - if o == nil || o.ArrayArrayOfModel == nil { - return nil, false - } - return o.ArrayArrayOfModel, true -} - -// HasArrayArrayOfModel returns a boolean if a field has been set. -func (o *ArrayTest) HasArrayArrayOfModel() bool { - if o != nil && o.ArrayArrayOfModel != nil { - return true - } - - return false -} - -// SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. -func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { - o.ArrayArrayOfModel = &v -} - -func (o ArrayTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ArrayOfString != nil { - toSerialize["array_of_string"] = o.ArrayOfString - } - if o.ArrayArrayOfInteger != nil { - toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger - } - if o.ArrayArrayOfModel != nil { - toSerialize["array_array_of_model"] = o.ArrayArrayOfModel - } - return json.Marshal(toSerialize) -} - -type NullableArrayTest struct { - value *ArrayTest - isSet bool -} - -func (v NullableArrayTest) Get() *ArrayTest { - return v.value -} - -func (v *NullableArrayTest) Set(val *ArrayTest) { - v.value = val - v.isSet = true -} - -func (v NullableArrayTest) IsSet() bool { - return v.isSet -} - -func (v *NullableArrayTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArrayTest(val *ArrayTest) *NullableArrayTest { - return &NullableArrayTest{value: val, isSet: true} -} - -func (v NullableArrayTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArrayTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go deleted file mode 100644 index 27b8085b241..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go +++ /dev/null @@ -1,123 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// BigCat struct for BigCat -type BigCat struct { - Cat - Kind *string `json:"kind,omitempty"` -} - -// NewBigCat instantiates a new BigCat object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBigCat() *BigCat { - this := BigCat{} - return &this -} - -// NewBigCatWithDefaults instantiates a new BigCat object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBigCatWithDefaults() *BigCat { - this := BigCat{} - return &this -} - -// GetKind returns the Kind field value if set, zero value otherwise. -func (o *BigCat) GetKind() string { - if o == nil || o.Kind == nil { - var ret string - return ret - } - return *o.Kind -} - -// GetKindOk returns a tuple with the Kind field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BigCat) GetKindOk() (*string, bool) { - if o == nil || o.Kind == nil { - return nil, false - } - return o.Kind, true -} - -// HasKind returns a boolean if a field has been set. -func (o *BigCat) HasKind() bool { - if o != nil && o.Kind != nil { - return true - } - - return false -} - -// SetKind gets a reference to the given string and assigns it to the Kind field. -func (o *BigCat) SetKind(v string) { - o.Kind = &v -} - -func (o BigCat) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - serializedCat, errCat := json.Marshal(o.Cat) - if errCat != nil { - return []byte{}, errCat - } - errCat = json.Unmarshal([]byte(serializedCat), &toSerialize) - if errCat != nil { - return []byte{}, errCat - } - if o.Kind != nil { - toSerialize["kind"] = o.Kind - } - return json.Marshal(toSerialize) -} - -type NullableBigCat struct { - value *BigCat - isSet bool -} - -func (v NullableBigCat) Get() *BigCat { - return v.value -} - -func (v *NullableBigCat) Set(val *BigCat) { - v.value = val - v.isSet = true -} - -func (v NullableBigCat) IsSet() bool { - return v.isSet -} - -func (v *NullableBigCat) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBigCat(val *BigCat) *NullableBigCat { - return &NullableBigCat{value: val, isSet: true} -} - -func (v NullableBigCat) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBigCat) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go deleted file mode 100644 index 6434cd11d7c..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat_all_of.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// BigCatAllOf struct for BigCatAllOf -type BigCatAllOf struct { - Kind *string `json:"kind,omitempty"` -} - -// NewBigCatAllOf instantiates a new BigCatAllOf object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBigCatAllOf() *BigCatAllOf { - this := BigCatAllOf{} - return &this -} - -// NewBigCatAllOfWithDefaults instantiates a new BigCatAllOf object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBigCatAllOfWithDefaults() *BigCatAllOf { - this := BigCatAllOf{} - return &this -} - -// GetKind returns the Kind field value if set, zero value otherwise. -func (o *BigCatAllOf) GetKind() string { - if o == nil || o.Kind == nil { - var ret string - return ret - } - return *o.Kind -} - -// GetKindOk returns a tuple with the Kind field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BigCatAllOf) GetKindOk() (*string, bool) { - if o == nil || o.Kind == nil { - return nil, false - } - return o.Kind, true -} - -// HasKind returns a boolean if a field has been set. -func (o *BigCatAllOf) HasKind() bool { - if o != nil && o.Kind != nil { - return true - } - - return false -} - -// SetKind gets a reference to the given string and assigns it to the Kind field. -func (o *BigCatAllOf) SetKind(v string) { - o.Kind = &v -} - -func (o BigCatAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Kind != nil { - toSerialize["kind"] = o.Kind - } - return json.Marshal(toSerialize) -} - -type NullableBigCatAllOf struct { - value *BigCatAllOf - isSet bool -} - -func (v NullableBigCatAllOf) Get() *BigCatAllOf { - return v.value -} - -func (v *NullableBigCatAllOf) Set(val *BigCatAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableBigCatAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableBigCatAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBigCatAllOf(val *BigCatAllOf) *NullableBigCatAllOf { - return &NullableBigCatAllOf{value: val, isSet: true} -} - -func (v NullableBigCatAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBigCatAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go deleted file mode 100644 index 7f2c90863e0..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ /dev/null @@ -1,295 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Capitalization struct for Capitalization -type Capitalization struct { - SmallCamel *string `json:"smallCamel,omitempty"` - CapitalCamel *string `json:"CapitalCamel,omitempty"` - SmallSnake *string `json:"small_Snake,omitempty"` - CapitalSnake *string `json:"Capital_Snake,omitempty"` - SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` - // Name of the pet - ATT_NAME *string `json:"ATT_NAME,omitempty"` -} - -// NewCapitalization instantiates a new Capitalization object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCapitalization() *Capitalization { - this := Capitalization{} - return &this -} - -// NewCapitalizationWithDefaults instantiates a new Capitalization object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCapitalizationWithDefaults() *Capitalization { - this := Capitalization{} - return &this -} - -// GetSmallCamel returns the SmallCamel field value if set, zero value otherwise. -func (o *Capitalization) GetSmallCamel() string { - if o == nil || o.SmallCamel == nil { - var ret string - return ret - } - return *o.SmallCamel -} - -// GetSmallCamelOk returns a tuple with the SmallCamel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetSmallCamelOk() (*string, bool) { - if o == nil || o.SmallCamel == nil { - return nil, false - } - return o.SmallCamel, true -} - -// HasSmallCamel returns a boolean if a field has been set. -func (o *Capitalization) HasSmallCamel() bool { - if o != nil && o.SmallCamel != nil { - return true - } - - return false -} - -// SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. -func (o *Capitalization) SetSmallCamel(v string) { - o.SmallCamel = &v -} - -// GetCapitalCamel returns the CapitalCamel field value if set, zero value otherwise. -func (o *Capitalization) GetCapitalCamel() string { - if o == nil || o.CapitalCamel == nil { - var ret string - return ret - } - return *o.CapitalCamel -} - -// GetCapitalCamelOk returns a tuple with the CapitalCamel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetCapitalCamelOk() (*string, bool) { - if o == nil || o.CapitalCamel == nil { - return nil, false - } - return o.CapitalCamel, true -} - -// HasCapitalCamel returns a boolean if a field has been set. -func (o *Capitalization) HasCapitalCamel() bool { - if o != nil && o.CapitalCamel != nil { - return true - } - - return false -} - -// SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. -func (o *Capitalization) SetCapitalCamel(v string) { - o.CapitalCamel = &v -} - -// GetSmallSnake returns the SmallSnake field value if set, zero value otherwise. -func (o *Capitalization) GetSmallSnake() string { - if o == nil || o.SmallSnake == nil { - var ret string - return ret - } - return *o.SmallSnake -} - -// GetSmallSnakeOk returns a tuple with the SmallSnake field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetSmallSnakeOk() (*string, bool) { - if o == nil || o.SmallSnake == nil { - return nil, false - } - return o.SmallSnake, true -} - -// HasSmallSnake returns a boolean if a field has been set. -func (o *Capitalization) HasSmallSnake() bool { - if o != nil && o.SmallSnake != nil { - return true - } - - return false -} - -// SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. -func (o *Capitalization) SetSmallSnake(v string) { - o.SmallSnake = &v -} - -// GetCapitalSnake returns the CapitalSnake field value if set, zero value otherwise. -func (o *Capitalization) GetCapitalSnake() string { - if o == nil || o.CapitalSnake == nil { - var ret string - return ret - } - return *o.CapitalSnake -} - -// GetCapitalSnakeOk returns a tuple with the CapitalSnake field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetCapitalSnakeOk() (*string, bool) { - if o == nil || o.CapitalSnake == nil { - return nil, false - } - return o.CapitalSnake, true -} - -// HasCapitalSnake returns a boolean if a field has been set. -func (o *Capitalization) HasCapitalSnake() bool { - if o != nil && o.CapitalSnake != nil { - return true - } - - return false -} - -// SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. -func (o *Capitalization) SetCapitalSnake(v string) { - o.CapitalSnake = &v -} - -// GetSCAETHFlowPoints returns the SCAETHFlowPoints field value if set, zero value otherwise. -func (o *Capitalization) GetSCAETHFlowPoints() string { - if o == nil || o.SCAETHFlowPoints == nil { - var ret string - return ret - } - return *o.SCAETHFlowPoints -} - -// GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool) { - if o == nil || o.SCAETHFlowPoints == nil { - return nil, false - } - return o.SCAETHFlowPoints, true -} - -// HasSCAETHFlowPoints returns a boolean if a field has been set. -func (o *Capitalization) HasSCAETHFlowPoints() bool { - if o != nil && o.SCAETHFlowPoints != nil { - return true - } - - return false -} - -// SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. -func (o *Capitalization) SetSCAETHFlowPoints(v string) { - o.SCAETHFlowPoints = &v -} - -// GetATT_NAME returns the ATT_NAME field value if set, zero value otherwise. -func (o *Capitalization) GetATT_NAME() string { - if o == nil || o.ATT_NAME == nil { - var ret string - return ret - } - return *o.ATT_NAME -} - -// GetATT_NAMEOk returns a tuple with the ATT_NAME field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetATT_NAMEOk() (*string, bool) { - if o == nil || o.ATT_NAME == nil { - return nil, false - } - return o.ATT_NAME, true -} - -// HasATT_NAME returns a boolean if a field has been set. -func (o *Capitalization) HasATT_NAME() bool { - if o != nil && o.ATT_NAME != nil { - return true - } - - return false -} - -// SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. -func (o *Capitalization) SetATT_NAME(v string) { - o.ATT_NAME = &v -} - -func (o Capitalization) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.SmallCamel != nil { - toSerialize["smallCamel"] = o.SmallCamel - } - if o.CapitalCamel != nil { - toSerialize["CapitalCamel"] = o.CapitalCamel - } - if o.SmallSnake != nil { - toSerialize["small_Snake"] = o.SmallSnake - } - if o.CapitalSnake != nil { - toSerialize["Capital_Snake"] = o.CapitalSnake - } - if o.SCAETHFlowPoints != nil { - toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints - } - if o.ATT_NAME != nil { - toSerialize["ATT_NAME"] = o.ATT_NAME - } - return json.Marshal(toSerialize) -} - -type NullableCapitalization struct { - value *Capitalization - isSet bool -} - -func (v NullableCapitalization) Get() *Capitalization { - return v.value -} - -func (v *NullableCapitalization) Set(val *Capitalization) { - v.value = val - v.isSet = true -} - -func (v NullableCapitalization) IsSet() bool { - return v.isSet -} - -func (v *NullableCapitalization) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCapitalization(val *Capitalization) *NullableCapitalization { - return &NullableCapitalization{value: val, isSet: true} -} - -func (v NullableCapitalization) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCapitalization) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_cat.go deleted file mode 100644 index d6573c99bac..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat.go +++ /dev/null @@ -1,123 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Cat struct for Cat -type Cat struct { - Animal - Declawed *bool `json:"declawed,omitempty"` -} - -// NewCat instantiates a new Cat object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCat() *Cat { - this := Cat{} - return &this -} - -// NewCatWithDefaults instantiates a new Cat object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCatWithDefaults() *Cat { - this := Cat{} - return &this -} - -// GetDeclawed returns the Declawed field value if set, zero value otherwise. -func (o *Cat) GetDeclawed() bool { - if o == nil || o.Declawed == nil { - var ret bool - return ret - } - return *o.Declawed -} - -// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Cat) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false - } - return o.Declawed, true -} - -// HasDeclawed returns a boolean if a field has been set. -func (o *Cat) HasDeclawed() bool { - if o != nil && o.Declawed != nil { - return true - } - - return false -} - -// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. -func (o *Cat) SetDeclawed(v bool) { - o.Declawed = &v -} - -func (o Cat) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - serializedAnimal, errAnimal := json.Marshal(o.Animal) - if errAnimal != nil { - return []byte{}, errAnimal - } - errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) - if errAnimal != nil { - return []byte{}, errAnimal - } - if o.Declawed != nil { - toSerialize["declawed"] = o.Declawed - } - return json.Marshal(toSerialize) -} - -type NullableCat struct { - value *Cat - isSet bool -} - -func (v NullableCat) Get() *Cat { - return v.value -} - -func (v *NullableCat) Set(val *Cat) { - v.value = val - v.isSet = true -} - -func (v NullableCat) IsSet() bool { - return v.isSet -} - -func (v *NullableCat) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCat(val *Cat) *NullableCat { - return &NullableCat{value: val, isSet: true} -} - -func (v NullableCat) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCat) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go deleted file mode 100644 index 643ba03973f..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// CatAllOf struct for CatAllOf -type CatAllOf struct { - Declawed *bool `json:"declawed,omitempty"` -} - -// NewCatAllOf instantiates a new CatAllOf object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCatAllOf() *CatAllOf { - this := CatAllOf{} - return &this -} - -// NewCatAllOfWithDefaults instantiates a new CatAllOf object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCatAllOfWithDefaults() *CatAllOf { - this := CatAllOf{} - return &this -} - -// GetDeclawed returns the Declawed field value if set, zero value otherwise. -func (o *CatAllOf) GetDeclawed() bool { - if o == nil || o.Declawed == nil { - var ret bool - return ret - } - return *o.Declawed -} - -// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CatAllOf) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false - } - return o.Declawed, true -} - -// HasDeclawed returns a boolean if a field has been set. -func (o *CatAllOf) HasDeclawed() bool { - if o != nil && o.Declawed != nil { - return true - } - - return false -} - -// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. -func (o *CatAllOf) SetDeclawed(v bool) { - o.Declawed = &v -} - -func (o CatAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Declawed != nil { - toSerialize["declawed"] = o.Declawed - } - return json.Marshal(toSerialize) -} - -type NullableCatAllOf struct { - value *CatAllOf - isSet bool -} - -func (v NullableCatAllOf) Get() *CatAllOf { - return v.value -} - -func (v *NullableCatAllOf) Set(val *CatAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableCatAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableCatAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCatAllOf(val *CatAllOf) *NullableCatAllOf { - return &NullableCatAllOf{value: val, isSet: true} -} - -func (v NullableCatAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCatAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_category.go b/samples/client/petstore/go-experimental/go-petstore/model_category.go deleted file mode 100644 index 0c462889533..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_category.go +++ /dev/null @@ -1,145 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Category struct for Category -type Category struct { - Id *int64 `json:"id,omitempty"` - Name string `json:"name"` -} - -// NewCategory instantiates a new Category object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCategory(name string, ) *Category { - this := Category{} - this.Name = name - return &this -} - -// NewCategoryWithDefaults instantiates a new Category object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCategoryWithDefaults() *Category { - this := Category{} - var name string = "default-name" - this.Name = name - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Category) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Category) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Category) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Category) SetId(v int64) { - o.Id = &v -} - -// GetName returns the Name field value -func (o *Category) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Category) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Category) SetName(v string) { - o.Name = v -} - -func (o Category) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if true { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableCategory struct { - value *Category - isSet bool -} - -func (v NullableCategory) Get() *Category { - return v.value -} - -func (v *NullableCategory) Set(val *Category) { - v.value = val - v.isSet = true -} - -func (v NullableCategory) IsSet() bool { - return v.isSet -} - -func (v *NullableCategory) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCategory(val *Category) *NullableCategory { - return &NullableCategory{value: val, isSet: true} -} - -func (v NullableCategory) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCategory) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/client/petstore/go-experimental/go-petstore/model_class_model.go deleted file mode 100644 index 7236de0ee07..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_class_model.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ClassModel Model for testing model with \"_class\" property -type ClassModel struct { - Class *string `json:"_class,omitempty"` -} - -// NewClassModel instantiates a new ClassModel object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewClassModel() *ClassModel { - this := ClassModel{} - return &this -} - -// NewClassModelWithDefaults instantiates a new ClassModel object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewClassModelWithDefaults() *ClassModel { - this := ClassModel{} - return &this -} - -// GetClass returns the Class field value if set, zero value otherwise. -func (o *ClassModel) GetClass() string { - if o == nil || o.Class == nil { - var ret string - return ret - } - return *o.Class -} - -// GetClassOk returns a tuple with the Class field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ClassModel) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false - } - return o.Class, true -} - -// HasClass returns a boolean if a field has been set. -func (o *ClassModel) HasClass() bool { - if o != nil && o.Class != nil { - return true - } - - return false -} - -// SetClass gets a reference to the given string and assigns it to the Class field. -func (o *ClassModel) SetClass(v string) { - o.Class = &v -} - -func (o ClassModel) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Class != nil { - toSerialize["_class"] = o.Class - } - return json.Marshal(toSerialize) -} - -type NullableClassModel struct { - value *ClassModel - isSet bool -} - -func (v NullableClassModel) Get() *ClassModel { - return v.value -} - -func (v *NullableClassModel) Set(val *ClassModel) { - v.value = val - v.isSet = true -} - -func (v NullableClassModel) IsSet() bool { - return v.isSet -} - -func (v *NullableClassModel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClassModel(val *ClassModel) *NullableClassModel { - return &NullableClassModel{value: val, isSet: true} -} - -func (v NullableClassModel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClassModel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_client.go b/samples/client/petstore/go-experimental/go-petstore/model_client.go deleted file mode 100644 index edfdde067ef..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_client.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Client struct for Client -type Client struct { - Client *string `json:"client,omitempty"` -} - -// NewClient instantiates a new Client object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewClient() *Client { - this := Client{} - return &this -} - -// NewClientWithDefaults instantiates a new Client object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewClientWithDefaults() *Client { - this := Client{} - return &this -} - -// GetClient returns the Client field value if set, zero value otherwise. -func (o *Client) GetClient() string { - if o == nil || o.Client == nil { - var ret string - return ret - } - return *o.Client -} - -// GetClientOk returns a tuple with the Client field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetClientOk() (*string, bool) { - if o == nil || o.Client == nil { - return nil, false - } - return o.Client, true -} - -// HasClient returns a boolean if a field has been set. -func (o *Client) HasClient() bool { - if o != nil && o.Client != nil { - return true - } - - return false -} - -// SetClient gets a reference to the given string and assigns it to the Client field. -func (o *Client) SetClient(v string) { - o.Client = &v -} - -func (o Client) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Client != nil { - toSerialize["client"] = o.Client - } - return json.Marshal(toSerialize) -} - -type NullableClient struct { - value *Client - isSet bool -} - -func (v NullableClient) Get() *Client { - return v.value -} - -func (v *NullableClient) Set(val *Client) { - v.value = val - v.isSet = true -} - -func (v NullableClient) IsSet() bool { - return v.isSet -} - -func (v *NullableClient) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClient(val *Client) *NullableClient { - return &NullableClient{value: val, isSet: true} -} - -func (v NullableClient) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClient) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/client/petstore/go-experimental/go-petstore/model_dog.go deleted file mode 100644 index ebbedeec53e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog.go +++ /dev/null @@ -1,123 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Dog struct for Dog -type Dog struct { - Animal - Breed *string `json:"breed,omitempty"` -} - -// NewDog instantiates a new Dog object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDog() *Dog { - this := Dog{} - return &this -} - -// NewDogWithDefaults instantiates a new Dog object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDogWithDefaults() *Dog { - this := Dog{} - return &this -} - -// GetBreed returns the Breed field value if set, zero value otherwise. -func (o *Dog) GetBreed() string { - if o == nil || o.Breed == nil { - var ret string - return ret - } - return *o.Breed -} - -// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Dog) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false - } - return o.Breed, true -} - -// HasBreed returns a boolean if a field has been set. -func (o *Dog) HasBreed() bool { - if o != nil && o.Breed != nil { - return true - } - - return false -} - -// SetBreed gets a reference to the given string and assigns it to the Breed field. -func (o *Dog) SetBreed(v string) { - o.Breed = &v -} - -func (o Dog) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - serializedAnimal, errAnimal := json.Marshal(o.Animal) - if errAnimal != nil { - return []byte{}, errAnimal - } - errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) - if errAnimal != nil { - return []byte{}, errAnimal - } - if o.Breed != nil { - toSerialize["breed"] = o.Breed - } - return json.Marshal(toSerialize) -} - -type NullableDog struct { - value *Dog - isSet bool -} - -func (v NullableDog) Get() *Dog { - return v.value -} - -func (v *NullableDog) Set(val *Dog) { - v.value = val - v.isSet = true -} - -func (v NullableDog) IsSet() bool { - return v.isSet -} - -func (v *NullableDog) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDog(val *Dog) *NullableDog { - return &NullableDog{value: val, isSet: true} -} - -func (v NullableDog) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDog) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go deleted file mode 100644 index c13aa2b2cd5..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// DogAllOf struct for DogAllOf -type DogAllOf struct { - Breed *string `json:"breed,omitempty"` -} - -// NewDogAllOf instantiates a new DogAllOf object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDogAllOf() *DogAllOf { - this := DogAllOf{} - return &this -} - -// NewDogAllOfWithDefaults instantiates a new DogAllOf object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDogAllOfWithDefaults() *DogAllOf { - this := DogAllOf{} - return &this -} - -// GetBreed returns the Breed field value if set, zero value otherwise. -func (o *DogAllOf) GetBreed() string { - if o == nil || o.Breed == nil { - var ret string - return ret - } - return *o.Breed -} - -// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DogAllOf) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false - } - return o.Breed, true -} - -// HasBreed returns a boolean if a field has been set. -func (o *DogAllOf) HasBreed() bool { - if o != nil && o.Breed != nil { - return true - } - - return false -} - -// SetBreed gets a reference to the given string and assigns it to the Breed field. -func (o *DogAllOf) SetBreed(v string) { - o.Breed = &v -} - -func (o DogAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Breed != nil { - toSerialize["breed"] = o.Breed - } - return json.Marshal(toSerialize) -} - -type NullableDogAllOf struct { - value *DogAllOf - isSet bool -} - -func (v NullableDogAllOf) Get() *DogAllOf { - return v.value -} - -func (v *NullableDogAllOf) Set(val *DogAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableDogAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableDogAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDogAllOf(val *DogAllOf) *NullableDogAllOf { - return &NullableDogAllOf{value: val, isSet: true} -} - -func (v NullableDogAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDogAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go deleted file mode 100644 index b18984ce730..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// EnumArrays struct for EnumArrays -type EnumArrays struct { - JustSymbol *string `json:"just_symbol,omitempty"` - ArrayEnum *[]string `json:"array_enum,omitempty"` -} - -// NewEnumArrays instantiates a new EnumArrays object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnumArrays() *EnumArrays { - this := EnumArrays{} - return &this -} - -// NewEnumArraysWithDefaults instantiates a new EnumArrays object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnumArraysWithDefaults() *EnumArrays { - this := EnumArrays{} - return &this -} - -// GetJustSymbol returns the JustSymbol field value if set, zero value otherwise. -func (o *EnumArrays) GetJustSymbol() string { - if o == nil || o.JustSymbol == nil { - var ret string - return ret - } - return *o.JustSymbol -} - -// GetJustSymbolOk returns a tuple with the JustSymbol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumArrays) GetJustSymbolOk() (*string, bool) { - if o == nil || o.JustSymbol == nil { - return nil, false - } - return o.JustSymbol, true -} - -// HasJustSymbol returns a boolean if a field has been set. -func (o *EnumArrays) HasJustSymbol() bool { - if o != nil && o.JustSymbol != nil { - return true - } - - return false -} - -// SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. -func (o *EnumArrays) SetJustSymbol(v string) { - o.JustSymbol = &v -} - -// GetArrayEnum returns the ArrayEnum field value if set, zero value otherwise. -func (o *EnumArrays) GetArrayEnum() []string { - if o == nil || o.ArrayEnum == nil { - var ret []string - return ret - } - return *o.ArrayEnum -} - -// GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool) { - if o == nil || o.ArrayEnum == nil { - return nil, false - } - return o.ArrayEnum, true -} - -// HasArrayEnum returns a boolean if a field has been set. -func (o *EnumArrays) HasArrayEnum() bool { - if o != nil && o.ArrayEnum != nil { - return true - } - - return false -} - -// SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. -func (o *EnumArrays) SetArrayEnum(v []string) { - o.ArrayEnum = &v -} - -func (o EnumArrays) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.JustSymbol != nil { - toSerialize["just_symbol"] = o.JustSymbol - } - if o.ArrayEnum != nil { - toSerialize["array_enum"] = o.ArrayEnum - } - return json.Marshal(toSerialize) -} - -type NullableEnumArrays struct { - value *EnumArrays - isSet bool -} - -func (v NullableEnumArrays) Get() *EnumArrays { - return v.value -} - -func (v *NullableEnumArrays) Set(val *EnumArrays) { - v.value = val - v.isSet = true -} - -func (v NullableEnumArrays) IsSet() bool { - return v.isSet -} - -func (v *NullableEnumArrays) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnumArrays(val *EnumArrays) *NullableEnumArrays { - return &NullableEnumArrays{value: val, isSet: true} -} - -func (v NullableEnumArrays) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnumArrays) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go deleted file mode 100644 index d64ca138f85..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// EnumClass the model 'EnumClass' -type EnumClass string - -// List of EnumClass -const ( - ABC EnumClass = "_abc" - EFG EnumClass = "-efg" - XYZ EnumClass = "(xyz)" -) - -func (v *EnumClass) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := EnumClass(value) - for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid EnumClass", value) -} - -// Ptr returns reference to EnumClass value -func (v EnumClass) Ptr() *EnumClass { - return &v -} - -type NullableEnumClass struct { - value *EnumClass - isSet bool -} - -func (v NullableEnumClass) Get() *EnumClass { - return v.value -} - -func (v *NullableEnumClass) Set(val *EnumClass) { - v.value = val - v.isSet = true -} - -func (v NullableEnumClass) IsSet() bool { - return v.isSet -} - -func (v *NullableEnumClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnumClass(val *EnumClass) *NullableEnumClass { - return &NullableEnumClass{value: val, isSet: true} -} - -func (v NullableEnumClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnumClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go deleted file mode 100644 index c39d045e5a6..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ /dev/null @@ -1,251 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// EnumTest struct for EnumTest -type EnumTest struct { - EnumString *string `json:"enum_string,omitempty"` - EnumStringRequired string `json:"enum_string_required"` - EnumInteger *int32 `json:"enum_integer,omitempty"` - EnumNumber *float64 `json:"enum_number,omitempty"` - OuterEnum *OuterEnum `json:"outerEnum,omitempty"` -} - -// NewEnumTest instantiates a new EnumTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnumTest(enumStringRequired string, ) *EnumTest { - this := EnumTest{} - this.EnumStringRequired = enumStringRequired - return &this -} - -// NewEnumTestWithDefaults instantiates a new EnumTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnumTestWithDefaults() *EnumTest { - this := EnumTest{} - return &this -} - -// GetEnumString returns the EnumString field value if set, zero value otherwise. -func (o *EnumTest) GetEnumString() string { - if o == nil || o.EnumString == nil { - var ret string - return ret - } - return *o.EnumString -} - -// GetEnumStringOk returns a tuple with the EnumString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumStringOk() (*string, bool) { - if o == nil || o.EnumString == nil { - return nil, false - } - return o.EnumString, true -} - -// HasEnumString returns a boolean if a field has been set. -func (o *EnumTest) HasEnumString() bool { - if o != nil && o.EnumString != nil { - return true - } - - return false -} - -// SetEnumString gets a reference to the given string and assigns it to the EnumString field. -func (o *EnumTest) SetEnumString(v string) { - o.EnumString = &v -} - -// GetEnumStringRequired returns the EnumStringRequired field value -func (o *EnumTest) GetEnumStringRequired() string { - if o == nil { - var ret string - return ret - } - - return o.EnumStringRequired -} - -// GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field value -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EnumStringRequired, true -} - -// SetEnumStringRequired sets field value -func (o *EnumTest) SetEnumStringRequired(v string) { - o.EnumStringRequired = v -} - -// GetEnumInteger returns the EnumInteger field value if set, zero value otherwise. -func (o *EnumTest) GetEnumInteger() int32 { - if o == nil || o.EnumInteger == nil { - var ret int32 - return ret - } - return *o.EnumInteger -} - -// GetEnumIntegerOk returns a tuple with the EnumInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumIntegerOk() (*int32, bool) { - if o == nil || o.EnumInteger == nil { - return nil, false - } - return o.EnumInteger, true -} - -// HasEnumInteger returns a boolean if a field has been set. -func (o *EnumTest) HasEnumInteger() bool { - if o != nil && o.EnumInteger != nil { - return true - } - - return false -} - -// SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. -func (o *EnumTest) SetEnumInteger(v int32) { - o.EnumInteger = &v -} - -// GetEnumNumber returns the EnumNumber field value if set, zero value otherwise. -func (o *EnumTest) GetEnumNumber() float64 { - if o == nil || o.EnumNumber == nil { - var ret float64 - return ret - } - return *o.EnumNumber -} - -// GetEnumNumberOk returns a tuple with the EnumNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumNumberOk() (*float64, bool) { - if o == nil || o.EnumNumber == nil { - return nil, false - } - return o.EnumNumber, true -} - -// HasEnumNumber returns a boolean if a field has been set. -func (o *EnumTest) HasEnumNumber() bool { - if o != nil && o.EnumNumber != nil { - return true - } - - return false -} - -// SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. -func (o *EnumTest) SetEnumNumber(v float64) { - o.EnumNumber = &v -} - -// GetOuterEnum returns the OuterEnum field value if set, zero value otherwise. -func (o *EnumTest) GetOuterEnum() OuterEnum { - if o == nil || o.OuterEnum == nil { - var ret OuterEnum - return ret - } - return *o.OuterEnum -} - -// GetOuterEnumOk returns a tuple with the OuterEnum field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { - if o == nil || o.OuterEnum == nil { - return nil, false - } - return o.OuterEnum, true -} - -// HasOuterEnum returns a boolean if a field has been set. -func (o *EnumTest) HasOuterEnum() bool { - if o != nil && o.OuterEnum != nil { - return true - } - - return false -} - -// SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field. -func (o *EnumTest) SetOuterEnum(v OuterEnum) { - o.OuterEnum = &v -} - -func (o EnumTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.EnumString != nil { - toSerialize["enum_string"] = o.EnumString - } - if true { - toSerialize["enum_string_required"] = o.EnumStringRequired - } - if o.EnumInteger != nil { - toSerialize["enum_integer"] = o.EnumInteger - } - if o.EnumNumber != nil { - toSerialize["enum_number"] = o.EnumNumber - } - if o.OuterEnum != nil { - toSerialize["outerEnum"] = o.OuterEnum - } - return json.Marshal(toSerialize) -} - -type NullableEnumTest struct { - value *EnumTest - isSet bool -} - -func (v NullableEnumTest) Get() *EnumTest { - return v.value -} - -func (v *NullableEnumTest) Set(val *EnumTest) { - v.value = val - v.isSet = true -} - -func (v NullableEnumTest) IsSet() bool { - return v.isSet -} - -func (v *NullableEnumTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnumTest(val *EnumTest) *NullableEnumTest { - return &NullableEnumTest{value: val, isSet: true} -} - -func (v NullableEnumTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnumTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file.go b/samples/client/petstore/go-experimental/go-petstore/model_file.go deleted file mode 100644 index 43ec19f8638..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_file.go +++ /dev/null @@ -1,115 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// File Must be named `File` for test. -type File struct { - // Test capitalization - SourceURI *string `json:"sourceURI,omitempty"` -} - -// NewFile instantiates a new File object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFile() *File { - this := File{} - return &this -} - -// NewFileWithDefaults instantiates a new File object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFileWithDefaults() *File { - this := File{} - return &this -} - -// GetSourceURI returns the SourceURI field value if set, zero value otherwise. -func (o *File) GetSourceURI() string { - if o == nil || o.SourceURI == nil { - var ret string - return ret - } - return *o.SourceURI -} - -// GetSourceURIOk returns a tuple with the SourceURI field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *File) GetSourceURIOk() (*string, bool) { - if o == nil || o.SourceURI == nil { - return nil, false - } - return o.SourceURI, true -} - -// HasSourceURI returns a boolean if a field has been set. -func (o *File) HasSourceURI() bool { - if o != nil && o.SourceURI != nil { - return true - } - - return false -} - -// SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. -func (o *File) SetSourceURI(v string) { - o.SourceURI = &v -} - -func (o File) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.SourceURI != nil { - toSerialize["sourceURI"] = o.SourceURI - } - return json.Marshal(toSerialize) -} - -type NullableFile struct { - value *File - isSet bool -} - -func (v NullableFile) Get() *File { - return v.value -} - -func (v *NullableFile) Set(val *File) { - v.value = val - v.isSet = true -} - -func (v NullableFile) IsSet() bool { - return v.isSet -} - -func (v *NullableFile) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFile(val *File) *NullableFile { - return &NullableFile{value: val, isSet: true} -} - -func (v NullableFile) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFile) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go deleted file mode 100644 index 626a3765173..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// FileSchemaTestClass struct for FileSchemaTestClass -type FileSchemaTestClass struct { - File *File `json:"file,omitempty"` - Files *[]File `json:"files,omitempty"` -} - -// NewFileSchemaTestClass instantiates a new FileSchemaTestClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFileSchemaTestClass() *FileSchemaTestClass { - this := FileSchemaTestClass{} - return &this -} - -// NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass { - this := FileSchemaTestClass{} - return &this -} - -// GetFile returns the File field value if set, zero value otherwise. -func (o *FileSchemaTestClass) GetFile() File { - if o == nil || o.File == nil { - var ret File - return ret - } - return *o.File -} - -// GetFileOk returns a tuple with the File field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FileSchemaTestClass) GetFileOk() (*File, bool) { - if o == nil || o.File == nil { - return nil, false - } - return o.File, true -} - -// HasFile returns a boolean if a field has been set. -func (o *FileSchemaTestClass) HasFile() bool { - if o != nil && o.File != nil { - return true - } - - return false -} - -// SetFile gets a reference to the given File and assigns it to the File field. -func (o *FileSchemaTestClass) SetFile(v File) { - o.File = &v -} - -// GetFiles returns the Files field value if set, zero value otherwise. -func (o *FileSchemaTestClass) GetFiles() []File { - if o == nil || o.Files == nil { - var ret []File - return ret - } - return *o.Files -} - -// GetFilesOk returns a tuple with the Files field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool) { - if o == nil || o.Files == nil { - return nil, false - } - return o.Files, true -} - -// HasFiles returns a boolean if a field has been set. -func (o *FileSchemaTestClass) HasFiles() bool { - if o != nil && o.Files != nil { - return true - } - - return false -} - -// SetFiles gets a reference to the given []File and assigns it to the Files field. -func (o *FileSchemaTestClass) SetFiles(v []File) { - o.Files = &v -} - -func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.File != nil { - toSerialize["file"] = o.File - } - if o.Files != nil { - toSerialize["files"] = o.Files - } - return json.Marshal(toSerialize) -} - -type NullableFileSchemaTestClass struct { - value *FileSchemaTestClass - isSet bool -} - -func (v NullableFileSchemaTestClass) Get() *FileSchemaTestClass { - return v.value -} - -func (v *NullableFileSchemaTestClass) Set(val *FileSchemaTestClass) { - v.value = val - v.isSet = true -} - -func (v NullableFileSchemaTestClass) IsSet() bool { - return v.isSet -} - -func (v *NullableFileSchemaTestClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFileSchemaTestClass(val *FileSchemaTestClass) *NullableFileSchemaTestClass { - return &NullableFileSchemaTestClass{value: val, isSet: true} -} - -func (v NullableFileSchemaTestClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFileSchemaTestClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go deleted file mode 100644 index aa1889aedda..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ /dev/null @@ -1,556 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "os" - "time" -) - -// FormatTest struct for FormatTest -type FormatTest struct { - Integer *int32 `json:"integer,omitempty"` - Int32 *int32 `json:"int32,omitempty"` - Int64 *int64 `json:"int64,omitempty"` - Number float32 `json:"number"` - Float *float32 `json:"float,omitempty"` - Double *float64 `json:"double,omitempty"` - String *string `json:"string,omitempty"` - Byte string `json:"byte"` - Binary **os.File `json:"binary,omitempty"` - Date string `json:"date"` - DateTime *time.Time `json:"dateTime,omitempty"` - Uuid *string `json:"uuid,omitempty"` - Password string `json:"password"` - BigDecimal *float64 `json:"BigDecimal,omitempty"` -} - -// NewFormatTest instantiates a new FormatTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest { - this := FormatTest{} - this.Number = number - this.Byte = byte_ - this.Date = date - this.Password = password - return &this -} - -// NewFormatTestWithDefaults instantiates a new FormatTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFormatTestWithDefaults() *FormatTest { - this := FormatTest{} - return &this -} - -// GetInteger returns the Integer field value if set, zero value otherwise. -func (o *FormatTest) GetInteger() int32 { - if o == nil || o.Integer == nil { - var ret int32 - return ret - } - return *o.Integer -} - -// GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetIntegerOk() (*int32, bool) { - if o == nil || o.Integer == nil { - return nil, false - } - return o.Integer, true -} - -// HasInteger returns a boolean if a field has been set. -func (o *FormatTest) HasInteger() bool { - if o != nil && o.Integer != nil { - return true - } - - return false -} - -// SetInteger gets a reference to the given int32 and assigns it to the Integer field. -func (o *FormatTest) SetInteger(v int32) { - o.Integer = &v -} - -// GetInt32 returns the Int32 field value if set, zero value otherwise. -func (o *FormatTest) GetInt32() int32 { - if o == nil || o.Int32 == nil { - var ret int32 - return ret - } - return *o.Int32 -} - -// GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetInt32Ok() (*int32, bool) { - if o == nil || o.Int32 == nil { - return nil, false - } - return o.Int32, true -} - -// HasInt32 returns a boolean if a field has been set. -func (o *FormatTest) HasInt32() bool { - if o != nil && o.Int32 != nil { - return true - } - - return false -} - -// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. -func (o *FormatTest) SetInt32(v int32) { - o.Int32 = &v -} - -// GetInt64 returns the Int64 field value if set, zero value otherwise. -func (o *FormatTest) GetInt64() int64 { - if o == nil || o.Int64 == nil { - var ret int64 - return ret - } - return *o.Int64 -} - -// GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetInt64Ok() (*int64, bool) { - if o == nil || o.Int64 == nil { - return nil, false - } - return o.Int64, true -} - -// HasInt64 returns a boolean if a field has been set. -func (o *FormatTest) HasInt64() bool { - if o != nil && o.Int64 != nil { - return true - } - - return false -} - -// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. -func (o *FormatTest) SetInt64(v int64) { - o.Int64 = &v -} - -// GetNumber returns the Number field value -func (o *FormatTest) GetNumber() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.Number -} - -// GetNumberOk returns a tuple with the Number field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetNumberOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.Number, true -} - -// SetNumber sets field value -func (o *FormatTest) SetNumber(v float32) { - o.Number = v -} - -// GetFloat returns the Float field value if set, zero value otherwise. -func (o *FormatTest) GetFloat() float32 { - if o == nil || o.Float == nil { - var ret float32 - return ret - } - return *o.Float -} - -// GetFloatOk returns a tuple with the Float field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetFloatOk() (*float32, bool) { - if o == nil || o.Float == nil { - return nil, false - } - return o.Float, true -} - -// HasFloat returns a boolean if a field has been set. -func (o *FormatTest) HasFloat() bool { - if o != nil && o.Float != nil { - return true - } - - return false -} - -// SetFloat gets a reference to the given float32 and assigns it to the Float field. -func (o *FormatTest) SetFloat(v float32) { - o.Float = &v -} - -// GetDouble returns the Double field value if set, zero value otherwise. -func (o *FormatTest) GetDouble() float64 { - if o == nil || o.Double == nil { - var ret float64 - return ret - } - return *o.Double -} - -// GetDoubleOk returns a tuple with the Double field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetDoubleOk() (*float64, bool) { - if o == nil || o.Double == nil { - return nil, false - } - return o.Double, true -} - -// HasDouble returns a boolean if a field has been set. -func (o *FormatTest) HasDouble() bool { - if o != nil && o.Double != nil { - return true - } - - return false -} - -// SetDouble gets a reference to the given float64 and assigns it to the Double field. -func (o *FormatTest) SetDouble(v float64) { - o.Double = &v -} - -// GetString returns the String field value if set, zero value otherwise. -func (o *FormatTest) GetString() string { - if o == nil || o.String == nil { - var ret string - return ret - } - return *o.String -} - -// GetStringOk returns a tuple with the String field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetStringOk() (*string, bool) { - if o == nil || o.String == nil { - return nil, false - } - return o.String, true -} - -// HasString returns a boolean if a field has been set. -func (o *FormatTest) HasString() bool { - if o != nil && o.String != nil { - return true - } - - return false -} - -// SetString gets a reference to the given string and assigns it to the String field. -func (o *FormatTest) SetString(v string) { - o.String = &v -} - -// GetByte returns the Byte field value -func (o *FormatTest) GetByte() string { - if o == nil { - var ret string - return ret - } - - return o.Byte -} - -// GetByteOk returns a tuple with the Byte field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetByteOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Byte, true -} - -// SetByte sets field value -func (o *FormatTest) SetByte(v string) { - o.Byte = v -} - -// GetBinary returns the Binary field value if set, zero value otherwise. -func (o *FormatTest) GetBinary() *os.File { - if o == nil || o.Binary == nil { - var ret *os.File - return ret - } - return *o.Binary -} - -// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetBinaryOk() (**os.File, bool) { - if o == nil || o.Binary == nil { - return nil, false - } - return o.Binary, true -} - -// HasBinary returns a boolean if a field has been set. -func (o *FormatTest) HasBinary() bool { - if o != nil && o.Binary != nil { - return true - } - - return false -} - -// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. -func (o *FormatTest) SetBinary(v *os.File) { - o.Binary = &v -} - -// GetDate returns the Date field value -func (o *FormatTest) GetDate() string { - if o == nil { - var ret string - return ret - } - - return o.Date -} - -// GetDateOk returns a tuple with the Date field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetDateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Date, true -} - -// SetDate sets field value -func (o *FormatTest) SetDate(v string) { - o.Date = v -} - -// GetDateTime returns the DateTime field value if set, zero value otherwise. -func (o *FormatTest) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { - var ret time.Time - return ret - } - return *o.DateTime -} - -// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false - } - return o.DateTime, true -} - -// HasDateTime returns a boolean if a field has been set. -func (o *FormatTest) HasDateTime() bool { - if o != nil && o.DateTime != nil { - return true - } - - return false -} - -// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. -func (o *FormatTest) SetDateTime(v time.Time) { - o.DateTime = &v -} - -// GetUuid returns the Uuid field value if set, zero value otherwise. -func (o *FormatTest) GetUuid() string { - if o == nil || o.Uuid == nil { - var ret string - return ret - } - return *o.Uuid -} - -// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false - } - return o.Uuid, true -} - -// HasUuid returns a boolean if a field has been set. -func (o *FormatTest) HasUuid() bool { - if o != nil && o.Uuid != nil { - return true - } - - return false -} - -// SetUuid gets a reference to the given string and assigns it to the Uuid field. -func (o *FormatTest) SetUuid(v string) { - o.Uuid = &v -} - -// GetPassword returns the Password field value -func (o *FormatTest) GetPassword() string { - if o == nil { - var ret string - return ret - } - - return o.Password -} - -// GetPasswordOk returns a tuple with the Password field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetPasswordOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Password, true -} - -// SetPassword sets field value -func (o *FormatTest) SetPassword(v string) { - o.Password = v -} - -// GetBigDecimal returns the BigDecimal field value if set, zero value otherwise. -func (o *FormatTest) GetBigDecimal() float64 { - if o == nil || o.BigDecimal == nil { - var ret float64 - return ret - } - return *o.BigDecimal -} - -// GetBigDecimalOk returns a tuple with the BigDecimal field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetBigDecimalOk() (*float64, bool) { - if o == nil || o.BigDecimal == nil { - return nil, false - } - return o.BigDecimal, true -} - -// HasBigDecimal returns a boolean if a field has been set. -func (o *FormatTest) HasBigDecimal() bool { - if o != nil && o.BigDecimal != nil { - return true - } - - return false -} - -// SetBigDecimal gets a reference to the given float64 and assigns it to the BigDecimal field. -func (o *FormatTest) SetBigDecimal(v float64) { - o.BigDecimal = &v -} - -func (o FormatTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Integer != nil { - toSerialize["integer"] = o.Integer - } - if o.Int32 != nil { - toSerialize["int32"] = o.Int32 - } - if o.Int64 != nil { - toSerialize["int64"] = o.Int64 - } - if true { - toSerialize["number"] = o.Number - } - if o.Float != nil { - toSerialize["float"] = o.Float - } - if o.Double != nil { - toSerialize["double"] = o.Double - } - if o.String != nil { - toSerialize["string"] = o.String - } - if true { - toSerialize["byte"] = o.Byte - } - if o.Binary != nil { - toSerialize["binary"] = o.Binary - } - if true { - toSerialize["date"] = o.Date - } - if o.DateTime != nil { - toSerialize["dateTime"] = o.DateTime - } - if o.Uuid != nil { - toSerialize["uuid"] = o.Uuid - } - if true { - toSerialize["password"] = o.Password - } - if o.BigDecimal != nil { - toSerialize["BigDecimal"] = o.BigDecimal - } - return json.Marshal(toSerialize) -} - -type NullableFormatTest struct { - value *FormatTest - isSet bool -} - -func (v NullableFormatTest) Get() *FormatTest { - return v.value -} - -func (v *NullableFormatTest) Set(val *FormatTest) { - v.value = val - v.isSet = true -} - -func (v NullableFormatTest) IsSet() bool { - return v.isSet -} - -func (v *NullableFormatTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFormatTest(val *FormatTest) *NullableFormatTest { - return &NullableFormatTest{value: val, isSet: true} -} - -func (v NullableFormatTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFormatTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go deleted file mode 100644 index 3400c73dca6..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// HasOnlyReadOnly struct for HasOnlyReadOnly -type HasOnlyReadOnly struct { - Bar *string `json:"bar,omitempty"` - Foo *string `json:"foo,omitempty"` -} - -// NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHasOnlyReadOnly() *HasOnlyReadOnly { - this := HasOnlyReadOnly{} - return &this -} - -// NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly { - this := HasOnlyReadOnly{} - return &this -} - -// GetBar returns the Bar field value if set, zero value otherwise. -func (o *HasOnlyReadOnly) GetBar() string { - if o == nil || o.Bar == nil { - var ret string - return ret - } - return *o.Bar -} - -// GetBarOk returns a tuple with the Bar field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HasOnlyReadOnly) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false - } - return o.Bar, true -} - -// HasBar returns a boolean if a field has been set. -func (o *HasOnlyReadOnly) HasBar() bool { - if o != nil && o.Bar != nil { - return true - } - - return false -} - -// SetBar gets a reference to the given string and assigns it to the Bar field. -func (o *HasOnlyReadOnly) SetBar(v string) { - o.Bar = &v -} - -// GetFoo returns the Foo field value if set, zero value otherwise. -func (o *HasOnlyReadOnly) GetFoo() string { - if o == nil || o.Foo == nil { - var ret string - return ret - } - return *o.Foo -} - -// GetFooOk returns a tuple with the Foo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HasOnlyReadOnly) GetFooOk() (*string, bool) { - if o == nil || o.Foo == nil { - return nil, false - } - return o.Foo, true -} - -// HasFoo returns a boolean if a field has been set. -func (o *HasOnlyReadOnly) HasFoo() bool { - if o != nil && o.Foo != nil { - return true - } - - return false -} - -// SetFoo gets a reference to the given string and assigns it to the Foo field. -func (o *HasOnlyReadOnly) SetFoo(v string) { - o.Foo = &v -} - -func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Bar != nil { - toSerialize["bar"] = o.Bar - } - if o.Foo != nil { - toSerialize["foo"] = o.Foo - } - return json.Marshal(toSerialize) -} - -type NullableHasOnlyReadOnly struct { - value *HasOnlyReadOnly - isSet bool -} - -func (v NullableHasOnlyReadOnly) Get() *HasOnlyReadOnly { - return v.value -} - -func (v *NullableHasOnlyReadOnly) Set(val *HasOnlyReadOnly) { - v.value = val - v.isSet = true -} - -func (v NullableHasOnlyReadOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableHasOnlyReadOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHasOnlyReadOnly(val *HasOnlyReadOnly) *NullableHasOnlyReadOnly { - return &NullableHasOnlyReadOnly{value: val, isSet: true} -} - -func (v NullableHasOnlyReadOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHasOnlyReadOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_list.go b/samples/client/petstore/go-experimental/go-petstore/model_list.go deleted file mode 100644 index f49afaa71f3..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_list.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// List struct for List -type List struct { - Var123List *string `json:"123-list,omitempty"` -} - -// NewList instantiates a new List object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewList() *List { - this := List{} - return &this -} - -// NewListWithDefaults instantiates a new List object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListWithDefaults() *List { - this := List{} - return &this -} - -// GetVar123List returns the Var123List field value if set, zero value otherwise. -func (o *List) GetVar123List() string { - if o == nil || o.Var123List == nil { - var ret string - return ret - } - return *o.Var123List -} - -// GetVar123ListOk returns a tuple with the Var123List field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *List) GetVar123ListOk() (*string, bool) { - if o == nil || o.Var123List == nil { - return nil, false - } - return o.Var123List, true -} - -// HasVar123List returns a boolean if a field has been set. -func (o *List) HasVar123List() bool { - if o != nil && o.Var123List != nil { - return true - } - - return false -} - -// SetVar123List gets a reference to the given string and assigns it to the Var123List field. -func (o *List) SetVar123List(v string) { - o.Var123List = &v -} - -func (o List) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Var123List != nil { - toSerialize["123-list"] = o.Var123List - } - return json.Marshal(toSerialize) -} - -type NullableList struct { - value *List - isSet bool -} - -func (v NullableList) Get() *List { - return v.value -} - -func (v *NullableList) Set(val *List) { - v.value = val - v.isSet = true -} - -func (v NullableList) IsSet() bool { - return v.isSet -} - -func (v *NullableList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableList(val *List) *NullableList { - return &NullableList{value: val, isSet: true} -} - -func (v NullableList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go deleted file mode 100644 index 4fc2c0b4799..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ /dev/null @@ -1,222 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// MapTest struct for MapTest -type MapTest struct { - MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` - MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` - DirectMap *map[string]bool `json:"direct_map,omitempty"` - IndirectMap *map[string]bool `json:"indirect_map,omitempty"` -} - -// NewMapTest instantiates a new MapTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMapTest() *MapTest { - this := MapTest{} - return &this -} - -// NewMapTestWithDefaults instantiates a new MapTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMapTestWithDefaults() *MapTest { - this := MapTest{} - return &this -} - -// GetMapMapOfString returns the MapMapOfString field value if set, zero value otherwise. -func (o *MapTest) GetMapMapOfString() map[string]map[string]string { - if o == nil || o.MapMapOfString == nil { - var ret map[string]map[string]string - return ret - } - return *o.MapMapOfString -} - -// GetMapMapOfStringOk returns a tuple with the MapMapOfString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapMapOfString == nil { - return nil, false - } - return o.MapMapOfString, true -} - -// HasMapMapOfString returns a boolean if a field has been set. -func (o *MapTest) HasMapMapOfString() bool { - if o != nil && o.MapMapOfString != nil { - return true - } - - return false -} - -// SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. -func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { - o.MapMapOfString = &v -} - -// GetMapOfEnumString returns the MapOfEnumString field value if set, zero value otherwise. -func (o *MapTest) GetMapOfEnumString() map[string]string { - if o == nil || o.MapOfEnumString == nil { - var ret map[string]string - return ret - } - return *o.MapOfEnumString -} - -// GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool) { - if o == nil || o.MapOfEnumString == nil { - return nil, false - } - return o.MapOfEnumString, true -} - -// HasMapOfEnumString returns a boolean if a field has been set. -func (o *MapTest) HasMapOfEnumString() bool { - if o != nil && o.MapOfEnumString != nil { - return true - } - - return false -} - -// SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. -func (o *MapTest) SetMapOfEnumString(v map[string]string) { - o.MapOfEnumString = &v -} - -// GetDirectMap returns the DirectMap field value if set, zero value otherwise. -func (o *MapTest) GetDirectMap() map[string]bool { - if o == nil || o.DirectMap == nil { - var ret map[string]bool - return ret - } - return *o.DirectMap -} - -// GetDirectMapOk returns a tuple with the DirectMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool) { - if o == nil || o.DirectMap == nil { - return nil, false - } - return o.DirectMap, true -} - -// HasDirectMap returns a boolean if a field has been set. -func (o *MapTest) HasDirectMap() bool { - if o != nil && o.DirectMap != nil { - return true - } - - return false -} - -// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. -func (o *MapTest) SetDirectMap(v map[string]bool) { - o.DirectMap = &v -} - -// GetIndirectMap returns the IndirectMap field value if set, zero value otherwise. -func (o *MapTest) GetIndirectMap() map[string]bool { - if o == nil || o.IndirectMap == nil { - var ret map[string]bool - return ret - } - return *o.IndirectMap -} - -// GetIndirectMapOk returns a tuple with the IndirectMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool) { - if o == nil || o.IndirectMap == nil { - return nil, false - } - return o.IndirectMap, true -} - -// HasIndirectMap returns a boolean if a field has been set. -func (o *MapTest) HasIndirectMap() bool { - if o != nil && o.IndirectMap != nil { - return true - } - - return false -} - -// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. -func (o *MapTest) SetIndirectMap(v map[string]bool) { - o.IndirectMap = &v -} - -func (o MapTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MapMapOfString != nil { - toSerialize["map_map_of_string"] = o.MapMapOfString - } - if o.MapOfEnumString != nil { - toSerialize["map_of_enum_string"] = o.MapOfEnumString - } - if o.DirectMap != nil { - toSerialize["direct_map"] = o.DirectMap - } - if o.IndirectMap != nil { - toSerialize["indirect_map"] = o.IndirectMap - } - return json.Marshal(toSerialize) -} - -type NullableMapTest struct { - value *MapTest - isSet bool -} - -func (v NullableMapTest) Get() *MapTest { - return v.value -} - -func (v *NullableMapTest) Set(val *MapTest) { - v.value = val - v.isSet = true -} - -func (v NullableMapTest) IsSet() bool { - return v.isSet -} - -func (v *NullableMapTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMapTest(val *MapTest) *NullableMapTest { - return &NullableMapTest{value: val, isSet: true} -} - -func (v NullableMapTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMapTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go deleted file mode 100644 index 69cc134169e..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ /dev/null @@ -1,187 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "time" -) - -// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass -type MixedPropertiesAndAdditionalPropertiesClass struct { - Uuid *string `json:"uuid,omitempty"` - DateTime *time.Time `json:"dateTime,omitempty"` - Map *map[string]Animal `json:"map,omitempty"` -} - -// NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass { - this := MixedPropertiesAndAdditionalPropertiesClass{} - return &this -} - -// NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass { - this := MixedPropertiesAndAdditionalPropertiesClass{} - return &this -} - -// GetUuid returns the Uuid field value if set, zero value otherwise. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { - if o == nil || o.Uuid == nil { - var ret string - return ret - } - return *o.Uuid -} - -// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false - } - return o.Uuid, true -} - -// HasUuid returns a boolean if a field has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { - if o != nil && o.Uuid != nil { - return true - } - - return false -} - -// SetUuid gets a reference to the given string and assigns it to the Uuid field. -func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { - o.Uuid = &v -} - -// GetDateTime returns the DateTime field value if set, zero value otherwise. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { - var ret time.Time - return ret - } - return *o.DateTime -} - -// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false - } - return o.DateTime, true -} - -// HasDateTime returns a boolean if a field has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { - if o != nil && o.DateTime != nil { - return true - } - - return false -} - -// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. -func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { - o.DateTime = &v -} - -// GetMap returns the Map field value if set, zero value otherwise. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { - if o == nil || o.Map == nil { - var ret map[string]Animal - return ret - } - return *o.Map -} - -// GetMapOk returns a tuple with the Map field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool) { - if o == nil || o.Map == nil { - return nil, false - } - return o.Map, true -} - -// HasMap returns a boolean if a field has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { - if o != nil && o.Map != nil { - return true - } - - return false -} - -// SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. -func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal) { - o.Map = &v -} - -func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Uuid != nil { - toSerialize["uuid"] = o.Uuid - } - if o.DateTime != nil { - toSerialize["dateTime"] = o.DateTime - } - if o.Map != nil { - toSerialize["map"] = o.Map - } - return json.Marshal(toSerialize) -} - -type NullableMixedPropertiesAndAdditionalPropertiesClass struct { - value *MixedPropertiesAndAdditionalPropertiesClass - isSet bool -} - -func (v NullableMixedPropertiesAndAdditionalPropertiesClass) Get() *MixedPropertiesAndAdditionalPropertiesClass { - return v.value -} - -func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Set(val *MixedPropertiesAndAdditionalPropertiesClass) { - v.value = val - v.isSet = true -} - -func (v NullableMixedPropertiesAndAdditionalPropertiesClass) IsSet() bool { - return v.isSet -} - -func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMixedPropertiesAndAdditionalPropertiesClass(val *MixedPropertiesAndAdditionalPropertiesClass) *NullableMixedPropertiesAndAdditionalPropertiesClass { - return &NullableMixedPropertiesAndAdditionalPropertiesClass{value: val, isSet: true} -} - -func (v NullableMixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_name.go deleted file mode 100644 index 82e49591874..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_name.go +++ /dev/null @@ -1,215 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Name Model for testing model name same as property name -type Name struct { - Name int32 `json:"name"` - SnakeCase *int32 `json:"snake_case,omitempty"` - Property *string `json:"property,omitempty"` - Var123Number *int32 `json:"123Number,omitempty"` -} - -// NewName instantiates a new Name object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewName(name int32, ) *Name { - this := Name{} - this.Name = name - return &this -} - -// NewNameWithDefaults instantiates a new Name object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNameWithDefaults() *Name { - this := Name{} - return &this -} - -// GetName returns the Name field value -func (o *Name) GetName() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Name) GetNameOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Name) SetName(v int32) { - o.Name = v -} - -// GetSnakeCase returns the SnakeCase field value if set, zero value otherwise. -func (o *Name) GetSnakeCase() int32 { - if o == nil || o.SnakeCase == nil { - var ret int32 - return ret - } - return *o.SnakeCase -} - -// GetSnakeCaseOk returns a tuple with the SnakeCase field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Name) GetSnakeCaseOk() (*int32, bool) { - if o == nil || o.SnakeCase == nil { - return nil, false - } - return o.SnakeCase, true -} - -// HasSnakeCase returns a boolean if a field has been set. -func (o *Name) HasSnakeCase() bool { - if o != nil && o.SnakeCase != nil { - return true - } - - return false -} - -// SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. -func (o *Name) SetSnakeCase(v int32) { - o.SnakeCase = &v -} - -// GetProperty returns the Property field value if set, zero value otherwise. -func (o *Name) GetProperty() string { - if o == nil || o.Property == nil { - var ret string - return ret - } - return *o.Property -} - -// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Name) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false - } - return o.Property, true -} - -// HasProperty returns a boolean if a field has been set. -func (o *Name) HasProperty() bool { - if o != nil && o.Property != nil { - return true - } - - return false -} - -// SetProperty gets a reference to the given string and assigns it to the Property field. -func (o *Name) SetProperty(v string) { - o.Property = &v -} - -// GetVar123Number returns the Var123Number field value if set, zero value otherwise. -func (o *Name) GetVar123Number() int32 { - if o == nil || o.Var123Number == nil { - var ret int32 - return ret - } - return *o.Var123Number -} - -// GetVar123NumberOk returns a tuple with the Var123Number field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Name) GetVar123NumberOk() (*int32, bool) { - if o == nil || o.Var123Number == nil { - return nil, false - } - return o.Var123Number, true -} - -// HasVar123Number returns a boolean if a field has been set. -func (o *Name) HasVar123Number() bool { - if o != nil && o.Var123Number != nil { - return true - } - - return false -} - -// SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. -func (o *Name) SetVar123Number(v int32) { - o.Var123Number = &v -} - -func (o Name) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["name"] = o.Name - } - if o.SnakeCase != nil { - toSerialize["snake_case"] = o.SnakeCase - } - if o.Property != nil { - toSerialize["property"] = o.Property - } - if o.Var123Number != nil { - toSerialize["123Number"] = o.Var123Number - } - return json.Marshal(toSerialize) -} - -type NullableName struct { - value *Name - isSet bool -} - -func (v NullableName) Get() *Name { - return v.value -} - -func (v *NullableName) Set(val *Name) { - v.value = val - v.isSet = true -} - -func (v NullableName) IsSet() bool { - return v.isSet -} - -func (v *NullableName) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableName(val *Name) *NullableName { - return &NullableName{value: val, isSet: true} -} - -func (v NullableName) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableName) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/client/petstore/go-experimental/go-petstore/model_number_only.go deleted file mode 100644 index efa8b66a5bc..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_number_only.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// NumberOnly struct for NumberOnly -type NumberOnly struct { - JustNumber *float32 `json:"JustNumber,omitempty"` -} - -// NewNumberOnly instantiates a new NumberOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNumberOnly() *NumberOnly { - this := NumberOnly{} - return &this -} - -// NewNumberOnlyWithDefaults instantiates a new NumberOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNumberOnlyWithDefaults() *NumberOnly { - this := NumberOnly{} - return &this -} - -// GetJustNumber returns the JustNumber field value if set, zero value otherwise. -func (o *NumberOnly) GetJustNumber() float32 { - if o == nil || o.JustNumber == nil { - var ret float32 - return ret - } - return *o.JustNumber -} - -// GetJustNumberOk returns a tuple with the JustNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NumberOnly) GetJustNumberOk() (*float32, bool) { - if o == nil || o.JustNumber == nil { - return nil, false - } - return o.JustNumber, true -} - -// HasJustNumber returns a boolean if a field has been set. -func (o *NumberOnly) HasJustNumber() bool { - if o != nil && o.JustNumber != nil { - return true - } - - return false -} - -// SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. -func (o *NumberOnly) SetJustNumber(v float32) { - o.JustNumber = &v -} - -func (o NumberOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.JustNumber != nil { - toSerialize["JustNumber"] = o.JustNumber - } - return json.Marshal(toSerialize) -} - -type NullableNumberOnly struct { - value *NumberOnly - isSet bool -} - -func (v NullableNumberOnly) Get() *NumberOnly { - return v.value -} - -func (v *NullableNumberOnly) Set(val *NumberOnly) { - v.value = val - v.isSet = true -} - -func (v NullableNumberOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableNumberOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNumberOnly(val *NumberOnly) *NullableNumberOnly { - return &NullableNumberOnly{value: val, isSet: true} -} - -func (v NullableNumberOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNumberOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_order.go b/samples/client/petstore/go-experimental/go-petstore/model_order.go deleted file mode 100644 index b20a1429848..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_order.go +++ /dev/null @@ -1,300 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "time" -) - -// Order struct for Order -type Order struct { - Id *int64 `json:"id,omitempty"` - PetId *int64 `json:"petId,omitempty"` - Quantity *int32 `json:"quantity,omitempty"` - ShipDate *time.Time `json:"shipDate,omitempty"` - // Order Status - Status *string `json:"status,omitempty"` - Complete *bool `json:"complete,omitempty"` -} - -// NewOrder instantiates a new Order object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOrder() *Order { - this := Order{} - var complete bool = false - this.Complete = &complete - return &this -} - -// NewOrderWithDefaults instantiates a new Order object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOrderWithDefaults() *Order { - this := Order{} - var complete bool = false - this.Complete = &complete - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Order) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Order) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Order) SetId(v int64) { - o.Id = &v -} - -// GetPetId returns the PetId field value if set, zero value otherwise. -func (o *Order) GetPetId() int64 { - if o == nil || o.PetId == nil { - var ret int64 - return ret - } - return *o.PetId -} - -// GetPetIdOk returns a tuple with the PetId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetPetIdOk() (*int64, bool) { - if o == nil || o.PetId == nil { - return nil, false - } - return o.PetId, true -} - -// HasPetId returns a boolean if a field has been set. -func (o *Order) HasPetId() bool { - if o != nil && o.PetId != nil { - return true - } - - return false -} - -// SetPetId gets a reference to the given int64 and assigns it to the PetId field. -func (o *Order) SetPetId(v int64) { - o.PetId = &v -} - -// GetQuantity returns the Quantity field value if set, zero value otherwise. -func (o *Order) GetQuantity() int32 { - if o == nil || o.Quantity == nil { - var ret int32 - return ret - } - return *o.Quantity -} - -// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetQuantityOk() (*int32, bool) { - if o == nil || o.Quantity == nil { - return nil, false - } - return o.Quantity, true -} - -// HasQuantity returns a boolean if a field has been set. -func (o *Order) HasQuantity() bool { - if o != nil && o.Quantity != nil { - return true - } - - return false -} - -// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. -func (o *Order) SetQuantity(v int32) { - o.Quantity = &v -} - -// GetShipDate returns the ShipDate field value if set, zero value otherwise. -func (o *Order) GetShipDate() time.Time { - if o == nil || o.ShipDate == nil { - var ret time.Time - return ret - } - return *o.ShipDate -} - -// GetShipDateOk returns a tuple with the ShipDate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetShipDateOk() (*time.Time, bool) { - if o == nil || o.ShipDate == nil { - return nil, false - } - return o.ShipDate, true -} - -// HasShipDate returns a boolean if a field has been set. -func (o *Order) HasShipDate() bool { - if o != nil && o.ShipDate != nil { - return true - } - - return false -} - -// SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. -func (o *Order) SetShipDate(v time.Time) { - o.ShipDate = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Order) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *Order) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Order) SetStatus(v string) { - o.Status = &v -} - -// GetComplete returns the Complete field value if set, zero value otherwise. -func (o *Order) GetComplete() bool { - if o == nil || o.Complete == nil { - var ret bool - return ret - } - return *o.Complete -} - -// GetCompleteOk returns a tuple with the Complete field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetCompleteOk() (*bool, bool) { - if o == nil || o.Complete == nil { - return nil, false - } - return o.Complete, true -} - -// HasComplete returns a boolean if a field has been set. -func (o *Order) HasComplete() bool { - if o != nil && o.Complete != nil { - return true - } - - return false -} - -// SetComplete gets a reference to the given bool and assigns it to the Complete field. -func (o *Order) SetComplete(v bool) { - o.Complete = &v -} - -func (o Order) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.PetId != nil { - toSerialize["petId"] = o.PetId - } - if o.Quantity != nil { - toSerialize["quantity"] = o.Quantity - } - if o.ShipDate != nil { - toSerialize["shipDate"] = o.ShipDate - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - if o.Complete != nil { - toSerialize["complete"] = o.Complete - } - return json.Marshal(toSerialize) -} - -type NullableOrder struct { - value *Order - isSet bool -} - -func (v NullableOrder) Get() *Order { - return v.value -} - -func (v *NullableOrder) Set(val *Order) { - v.value = val - v.isSet = true -} - -func (v NullableOrder) IsSet() bool { - return v.isSet -} - -func (v *NullableOrder) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOrder(val *Order) *NullableOrder { - return &NullableOrder{value: val, isSet: true} -} - -func (v NullableOrder) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOrder) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go deleted file mode 100644 index 9a76c753b64..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ /dev/null @@ -1,186 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// OuterComposite struct for OuterComposite -type OuterComposite struct { - MyNumber *float32 `json:"my_number,omitempty"` - MyString *string `json:"my_string,omitempty"` - MyBoolean *bool `json:"my_boolean,omitempty"` -} - -// NewOuterComposite instantiates a new OuterComposite object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOuterComposite() *OuterComposite { - this := OuterComposite{} - return &this -} - -// NewOuterCompositeWithDefaults instantiates a new OuterComposite object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOuterCompositeWithDefaults() *OuterComposite { - this := OuterComposite{} - return &this -} - -// GetMyNumber returns the MyNumber field value if set, zero value otherwise. -func (o *OuterComposite) GetMyNumber() float32 { - if o == nil || o.MyNumber == nil { - var ret float32 - return ret - } - return *o.MyNumber -} - -// GetMyNumberOk returns a tuple with the MyNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OuterComposite) GetMyNumberOk() (*float32, bool) { - if o == nil || o.MyNumber == nil { - return nil, false - } - return o.MyNumber, true -} - -// HasMyNumber returns a boolean if a field has been set. -func (o *OuterComposite) HasMyNumber() bool { - if o != nil && o.MyNumber != nil { - return true - } - - return false -} - -// SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. -func (o *OuterComposite) SetMyNumber(v float32) { - o.MyNumber = &v -} - -// GetMyString returns the MyString field value if set, zero value otherwise. -func (o *OuterComposite) GetMyString() string { - if o == nil || o.MyString == nil { - var ret string - return ret - } - return *o.MyString -} - -// GetMyStringOk returns a tuple with the MyString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OuterComposite) GetMyStringOk() (*string, bool) { - if o == nil || o.MyString == nil { - return nil, false - } - return o.MyString, true -} - -// HasMyString returns a boolean if a field has been set. -func (o *OuterComposite) HasMyString() bool { - if o != nil && o.MyString != nil { - return true - } - - return false -} - -// SetMyString gets a reference to the given string and assigns it to the MyString field. -func (o *OuterComposite) SetMyString(v string) { - o.MyString = &v -} - -// GetMyBoolean returns the MyBoolean field value if set, zero value otherwise. -func (o *OuterComposite) GetMyBoolean() bool { - if o == nil || o.MyBoolean == nil { - var ret bool - return ret - } - return *o.MyBoolean -} - -// GetMyBooleanOk returns a tuple with the MyBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OuterComposite) GetMyBooleanOk() (*bool, bool) { - if o == nil || o.MyBoolean == nil { - return nil, false - } - return o.MyBoolean, true -} - -// HasMyBoolean returns a boolean if a field has been set. -func (o *OuterComposite) HasMyBoolean() bool { - if o != nil && o.MyBoolean != nil { - return true - } - - return false -} - -// SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. -func (o *OuterComposite) SetMyBoolean(v bool) { - o.MyBoolean = &v -} - -func (o OuterComposite) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MyNumber != nil { - toSerialize["my_number"] = o.MyNumber - } - if o.MyString != nil { - toSerialize["my_string"] = o.MyString - } - if o.MyBoolean != nil { - toSerialize["my_boolean"] = o.MyBoolean - } - return json.Marshal(toSerialize) -} - -type NullableOuterComposite struct { - value *OuterComposite - isSet bool -} - -func (v NullableOuterComposite) Get() *OuterComposite { - return v.value -} - -func (v *NullableOuterComposite) Set(val *OuterComposite) { - v.value = val - v.isSet = true -} - -func (v NullableOuterComposite) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterComposite) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterComposite(val *OuterComposite) *NullableOuterComposite { - return &NullableOuterComposite{value: val, isSet: true} -} - -func (v NullableOuterComposite) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterComposite) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go deleted file mode 100644 index 8160a2d09fc..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// OuterEnum the model 'OuterEnum' -type OuterEnum string - -// List of OuterEnum -const ( - PLACED OuterEnum = "placed" - APPROVED OuterEnum = "approved" - DELIVERED OuterEnum = "delivered" -) - -func (v *OuterEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnum(value) - for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnum", value) -} - -// Ptr returns reference to OuterEnum value -func (v OuterEnum) Ptr() *OuterEnum { - return &v -} - -type NullableOuterEnum struct { - value *OuterEnum - isSet bool -} - -func (v NullableOuterEnum) Get() *OuterEnum { - return v.value -} - -func (v *NullableOuterEnum) Set(val *OuterEnum) { - v.value = val - v.isSet = true -} - -func (v NullableOuterEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterEnum(val *OuterEnum) *NullableOuterEnum { - return &NullableOuterEnum{value: val, isSet: true} -} - -func (v NullableOuterEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterEnum) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/client/petstore/go-experimental/go-petstore/model_pet.go deleted file mode 100644 index 8bc4457fc37..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_pet.go +++ /dev/null @@ -1,281 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Pet struct for Pet -type Pet struct { - Id *int64 `json:"id,omitempty"` - Category *Category `json:"category,omitempty"` - Name string `json:"name"` - PhotoUrls []string `json:"photoUrls"` - Tags *[]Tag `json:"tags,omitempty"` - // pet status in the store - Status *string `json:"status,omitempty"` -} - -// NewPet instantiates a new Pet object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPet(name string, photoUrls []string, ) *Pet { - this := Pet{} - this.Name = name - this.PhotoUrls = photoUrls - return &this -} - -// NewPetWithDefaults instantiates a new Pet object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPetWithDefaults() *Pet { - this := Pet{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Pet) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Pet) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Pet) SetId(v int64) { - o.Id = &v -} - -// GetCategory returns the Category field value if set, zero value otherwise. -func (o *Pet) GetCategory() Category { - if o == nil || o.Category == nil { - var ret Category - return ret - } - return *o.Category -} - -// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetCategoryOk() (*Category, bool) { - if o == nil || o.Category == nil { - return nil, false - } - return o.Category, true -} - -// HasCategory returns a boolean if a field has been set. -func (o *Pet) HasCategory() bool { - if o != nil && o.Category != nil { - return true - } - - return false -} - -// SetCategory gets a reference to the given Category and assigns it to the Category field. -func (o *Pet) SetCategory(v Category) { - o.Category = &v -} - -// GetName returns the Name field value -func (o *Pet) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Pet) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Pet) SetName(v string) { - o.Name = v -} - -// GetPhotoUrls returns the PhotoUrls field value -func (o *Pet) GetPhotoUrls() []string { - if o == nil { - var ret []string - return ret - } - - return o.PhotoUrls -} - -// GetPhotoUrlsOk returns a tuple with the PhotoUrls field value -// and a boolean to check if the value has been set. -func (o *Pet) GetPhotoUrlsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return &o.PhotoUrls, true -} - -// SetPhotoUrls sets field value -func (o *Pet) SetPhotoUrls(v []string) { - o.PhotoUrls = v -} - -// GetTags returns the Tags field value if set, zero value otherwise. -func (o *Pet) GetTags() []Tag { - if o == nil || o.Tags == nil { - var ret []Tag - return ret - } - return *o.Tags -} - -// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetTagsOk() (*[]Tag, bool) { - if o == nil || o.Tags == nil { - return nil, false - } - return o.Tags, true -} - -// HasTags returns a boolean if a field has been set. -func (o *Pet) HasTags() bool { - if o != nil && o.Tags != nil { - return true - } - - return false -} - -// SetTags gets a reference to the given []Tag and assigns it to the Tags field. -func (o *Pet) SetTags(v []Tag) { - o.Tags = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Pet) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *Pet) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Pet) SetStatus(v string) { - o.Status = &v -} - -func (o Pet) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Category != nil { - toSerialize["category"] = o.Category - } - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["photoUrls"] = o.PhotoUrls - } - if o.Tags != nil { - toSerialize["tags"] = o.Tags - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - return json.Marshal(toSerialize) -} - -type NullablePet struct { - value *Pet - isSet bool -} - -func (v NullablePet) Get() *Pet { - return v.value -} - -func (v *NullablePet) Set(val *Pet) { - v.value = val - v.isSet = true -} - -func (v NullablePet) IsSet() bool { - return v.isSet -} - -func (v *NullablePet) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePet(val *Pet) *NullablePet { - return &NullablePet{value: val, isSet: true} -} - -func (v NullablePet) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePet) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go deleted file mode 100644 index dd00212c1d0..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ReadOnlyFirst struct for ReadOnlyFirst -type ReadOnlyFirst struct { - Bar *string `json:"bar,omitempty"` - Baz *string `json:"baz,omitempty"` -} - -// NewReadOnlyFirst instantiates a new ReadOnlyFirst object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewReadOnlyFirst() *ReadOnlyFirst { - this := ReadOnlyFirst{} - return &this -} - -// NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst { - this := ReadOnlyFirst{} - return &this -} - -// GetBar returns the Bar field value if set, zero value otherwise. -func (o *ReadOnlyFirst) GetBar() string { - if o == nil || o.Bar == nil { - var ret string - return ret - } - return *o.Bar -} - -// GetBarOk returns a tuple with the Bar field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReadOnlyFirst) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false - } - return o.Bar, true -} - -// HasBar returns a boolean if a field has been set. -func (o *ReadOnlyFirst) HasBar() bool { - if o != nil && o.Bar != nil { - return true - } - - return false -} - -// SetBar gets a reference to the given string and assigns it to the Bar field. -func (o *ReadOnlyFirst) SetBar(v string) { - o.Bar = &v -} - -// GetBaz returns the Baz field value if set, zero value otherwise. -func (o *ReadOnlyFirst) GetBaz() string { - if o == nil || o.Baz == nil { - var ret string - return ret - } - return *o.Baz -} - -// GetBazOk returns a tuple with the Baz field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReadOnlyFirst) GetBazOk() (*string, bool) { - if o == nil || o.Baz == nil { - return nil, false - } - return o.Baz, true -} - -// HasBaz returns a boolean if a field has been set. -func (o *ReadOnlyFirst) HasBaz() bool { - if o != nil && o.Baz != nil { - return true - } - - return false -} - -// SetBaz gets a reference to the given string and assigns it to the Baz field. -func (o *ReadOnlyFirst) SetBaz(v string) { - o.Baz = &v -} - -func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Bar != nil { - toSerialize["bar"] = o.Bar - } - if o.Baz != nil { - toSerialize["baz"] = o.Baz - } - return json.Marshal(toSerialize) -} - -type NullableReadOnlyFirst struct { - value *ReadOnlyFirst - isSet bool -} - -func (v NullableReadOnlyFirst) Get() *ReadOnlyFirst { - return v.value -} - -func (v *NullableReadOnlyFirst) Set(val *ReadOnlyFirst) { - v.value = val - v.isSet = true -} - -func (v NullableReadOnlyFirst) IsSet() bool { - return v.isSet -} - -func (v *NullableReadOnlyFirst) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableReadOnlyFirst(val *ReadOnlyFirst) *NullableReadOnlyFirst { - return &NullableReadOnlyFirst{value: val, isSet: true} -} - -func (v NullableReadOnlyFirst) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableReadOnlyFirst) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_return.go b/samples/client/petstore/go-experimental/go-petstore/model_return.go deleted file mode 100644 index 2ed729e12ec..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_return.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Return Model for testing reserved words -type Return struct { - Return *int32 `json:"return,omitempty"` -} - -// NewReturn instantiates a new Return object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewReturn() *Return { - this := Return{} - return &this -} - -// NewReturnWithDefaults instantiates a new Return object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewReturnWithDefaults() *Return { - this := Return{} - return &this -} - -// GetReturn returns the Return field value if set, zero value otherwise. -func (o *Return) GetReturn() int32 { - if o == nil || o.Return == nil { - var ret int32 - return ret - } - return *o.Return -} - -// GetReturnOk returns a tuple with the Return field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Return) GetReturnOk() (*int32, bool) { - if o == nil || o.Return == nil { - return nil, false - } - return o.Return, true -} - -// HasReturn returns a boolean if a field has been set. -func (o *Return) HasReturn() bool { - if o != nil && o.Return != nil { - return true - } - - return false -} - -// SetReturn gets a reference to the given int32 and assigns it to the Return field. -func (o *Return) SetReturn(v int32) { - o.Return = &v -} - -func (o Return) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Return != nil { - toSerialize["return"] = o.Return - } - return json.Marshal(toSerialize) -} - -type NullableReturn struct { - value *Return - isSet bool -} - -func (v NullableReturn) Get() *Return { - return v.value -} - -func (v *NullableReturn) Set(val *Return) { - v.value = val - v.isSet = true -} - -func (v NullableReturn) IsSet() bool { - return v.isSet -} - -func (v *NullableReturn) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableReturn(val *Return) *NullableReturn { - return &NullableReturn{value: val, isSet: true} -} - -func (v NullableReturn) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableReturn) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go b/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go deleted file mode 100644 index bbef383b796..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_special_model_name.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// SpecialModelName struct for SpecialModelName -type SpecialModelName struct { - SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` -} - -// NewSpecialModelName instantiates a new SpecialModelName object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSpecialModelName() *SpecialModelName { - this := SpecialModelName{} - return &this -} - -// NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSpecialModelNameWithDefaults() *SpecialModelName { - this := SpecialModelName{} - return &this -} - -// GetSpecialPropertyName returns the SpecialPropertyName field value if set, zero value otherwise. -func (o *SpecialModelName) GetSpecialPropertyName() int64 { - if o == nil || o.SpecialPropertyName == nil { - var ret int64 - return ret - } - return *o.SpecialPropertyName -} - -// GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool) { - if o == nil || o.SpecialPropertyName == nil { - return nil, false - } - return o.SpecialPropertyName, true -} - -// HasSpecialPropertyName returns a boolean if a field has been set. -func (o *SpecialModelName) HasSpecialPropertyName() bool { - if o != nil && o.SpecialPropertyName != nil { - return true - } - - return false -} - -// SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. -func (o *SpecialModelName) SetSpecialPropertyName(v int64) { - o.SpecialPropertyName = &v -} - -func (o SpecialModelName) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.SpecialPropertyName != nil { - toSerialize["$special[property.name]"] = o.SpecialPropertyName - } - return json.Marshal(toSerialize) -} - -type NullableSpecialModelName struct { - value *SpecialModelName - isSet bool -} - -func (v NullableSpecialModelName) Get() *SpecialModelName { - return v.value -} - -func (v *NullableSpecialModelName) Set(val *SpecialModelName) { - v.value = val - v.isSet = true -} - -func (v NullableSpecialModelName) IsSet() bool { - return v.isSet -} - -func (v *NullableSpecialModelName) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSpecialModelName(val *SpecialModelName) *NullableSpecialModelName { - return &NullableSpecialModelName{value: val, isSet: true} -} - -func (v NullableSpecialModelName) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSpecialModelName) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/client/petstore/go-experimental/go-petstore/model_tag.go deleted file mode 100644 index 99135ba946b..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_tag.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Tag struct for Tag -type Tag struct { - Id *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` -} - -// NewTag instantiates a new Tag object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTag() *Tag { - this := Tag{} - return &this -} - -// NewTagWithDefaults instantiates a new Tag object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTagWithDefaults() *Tag { - this := Tag{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Tag) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Tag) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Tag) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Tag) SetId(v int64) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Tag) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Tag) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *Tag) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Tag) SetName(v string) { - o.Name = &v -} - -func (o Tag) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - return json.Marshal(toSerialize) -} - -type NullableTag struct { - value *Tag - isSet bool -} - -func (v NullableTag) Get() *Tag { - return v.value -} - -func (v *NullableTag) Set(val *Tag) { - v.value = val - v.isSet = true -} - -func (v NullableTag) IsSet() bool { - return v.isSet -} - -func (v *NullableTag) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTag(val *Tag) *NullableTag { - return &NullableTag{value: val, isSet: true} -} - -func (v NullableTag) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTag) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go deleted file mode 100644 index d45748bf769..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_default.go +++ /dev/null @@ -1,227 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// TypeHolderDefault struct for TypeHolderDefault -type TypeHolderDefault struct { - StringItem string `json:"string_item"` - NumberItem float32 `json:"number_item"` - IntegerItem int32 `json:"integer_item"` - BoolItem bool `json:"bool_item"` - ArrayItem []int32 `json:"array_item"` -} - -// NewTypeHolderDefault instantiates a new TypeHolderDefault object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTypeHolderDefault(stringItem string, numberItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderDefault { - this := TypeHolderDefault{} - this.StringItem = stringItem - this.NumberItem = numberItem - this.IntegerItem = integerItem - this.BoolItem = boolItem - this.ArrayItem = arrayItem - return &this -} - -// NewTypeHolderDefaultWithDefaults instantiates a new TypeHolderDefault object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTypeHolderDefaultWithDefaults() *TypeHolderDefault { - this := TypeHolderDefault{} - var stringItem string = "what" - this.StringItem = stringItem - var boolItem bool = true - this.BoolItem = boolItem - return &this -} - -// GetStringItem returns the StringItem field value -func (o *TypeHolderDefault) GetStringItem() string { - if o == nil { - var ret string - return ret - } - - return o.StringItem -} - -// GetStringItemOk returns a tuple with the StringItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderDefault) GetStringItemOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.StringItem, true -} - -// SetStringItem sets field value -func (o *TypeHolderDefault) SetStringItem(v string) { - o.StringItem = v -} - -// GetNumberItem returns the NumberItem field value -func (o *TypeHolderDefault) GetNumberItem() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.NumberItem -} - -// GetNumberItemOk returns a tuple with the NumberItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderDefault) GetNumberItemOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.NumberItem, true -} - -// SetNumberItem sets field value -func (o *TypeHolderDefault) SetNumberItem(v float32) { - o.NumberItem = v -} - -// GetIntegerItem returns the IntegerItem field value -func (o *TypeHolderDefault) GetIntegerItem() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.IntegerItem -} - -// GetIntegerItemOk returns a tuple with the IntegerItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderDefault) GetIntegerItemOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.IntegerItem, true -} - -// SetIntegerItem sets field value -func (o *TypeHolderDefault) SetIntegerItem(v int32) { - o.IntegerItem = v -} - -// GetBoolItem returns the BoolItem field value -func (o *TypeHolderDefault) GetBoolItem() bool { - if o == nil { - var ret bool - return ret - } - - return o.BoolItem -} - -// GetBoolItemOk returns a tuple with the BoolItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderDefault) GetBoolItemOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.BoolItem, true -} - -// SetBoolItem sets field value -func (o *TypeHolderDefault) SetBoolItem(v bool) { - o.BoolItem = v -} - -// GetArrayItem returns the ArrayItem field value -func (o *TypeHolderDefault) GetArrayItem() []int32 { - if o == nil { - var ret []int32 - return ret - } - - return o.ArrayItem -} - -// GetArrayItemOk returns a tuple with the ArrayItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderDefault) GetArrayItemOk() (*[]int32, bool) { - if o == nil { - return nil, false - } - return &o.ArrayItem, true -} - -// SetArrayItem sets field value -func (o *TypeHolderDefault) SetArrayItem(v []int32) { - o.ArrayItem = v -} - -func (o TypeHolderDefault) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["string_item"] = o.StringItem - } - if true { - toSerialize["number_item"] = o.NumberItem - } - if true { - toSerialize["integer_item"] = o.IntegerItem - } - if true { - toSerialize["bool_item"] = o.BoolItem - } - if true { - toSerialize["array_item"] = o.ArrayItem - } - return json.Marshal(toSerialize) -} - -type NullableTypeHolderDefault struct { - value *TypeHolderDefault - isSet bool -} - -func (v NullableTypeHolderDefault) Get() *TypeHolderDefault { - return v.value -} - -func (v *NullableTypeHolderDefault) Set(val *TypeHolderDefault) { - v.value = val - v.isSet = true -} - -func (v NullableTypeHolderDefault) IsSet() bool { - return v.isSet -} - -func (v *NullableTypeHolderDefault) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTypeHolderDefault(val *TypeHolderDefault) *NullableTypeHolderDefault { - return &NullableTypeHolderDefault{value: val, isSet: true} -} - -func (v NullableTypeHolderDefault) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTypeHolderDefault) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go b/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go deleted file mode 100644 index 3f74c433f71..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_type_holder_example.go +++ /dev/null @@ -1,252 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// TypeHolderExample struct for TypeHolderExample -type TypeHolderExample struct { - StringItem string `json:"string_item"` - NumberItem float32 `json:"number_item"` - FloatItem float32 `json:"float_item"` - IntegerItem int32 `json:"integer_item"` - BoolItem bool `json:"bool_item"` - ArrayItem []int32 `json:"array_item"` -} - -// NewTypeHolderExample instantiates a new TypeHolderExample object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTypeHolderExample(stringItem string, numberItem float32, floatItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderExample { - this := TypeHolderExample{} - this.StringItem = stringItem - this.NumberItem = numberItem - this.FloatItem = floatItem - this.IntegerItem = integerItem - this.BoolItem = boolItem - this.ArrayItem = arrayItem - return &this -} - -// NewTypeHolderExampleWithDefaults instantiates a new TypeHolderExample object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTypeHolderExampleWithDefaults() *TypeHolderExample { - this := TypeHolderExample{} - return &this -} - -// GetStringItem returns the StringItem field value -func (o *TypeHolderExample) GetStringItem() string { - if o == nil { - var ret string - return ret - } - - return o.StringItem -} - -// GetStringItemOk returns a tuple with the StringItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetStringItemOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.StringItem, true -} - -// SetStringItem sets field value -func (o *TypeHolderExample) SetStringItem(v string) { - o.StringItem = v -} - -// GetNumberItem returns the NumberItem field value -func (o *TypeHolderExample) GetNumberItem() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.NumberItem -} - -// GetNumberItemOk returns a tuple with the NumberItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetNumberItemOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.NumberItem, true -} - -// SetNumberItem sets field value -func (o *TypeHolderExample) SetNumberItem(v float32) { - o.NumberItem = v -} - -// GetFloatItem returns the FloatItem field value -func (o *TypeHolderExample) GetFloatItem() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.FloatItem -} - -// GetFloatItemOk returns a tuple with the FloatItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetFloatItemOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.FloatItem, true -} - -// SetFloatItem sets field value -func (o *TypeHolderExample) SetFloatItem(v float32) { - o.FloatItem = v -} - -// GetIntegerItem returns the IntegerItem field value -func (o *TypeHolderExample) GetIntegerItem() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.IntegerItem -} - -// GetIntegerItemOk returns a tuple with the IntegerItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetIntegerItemOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.IntegerItem, true -} - -// SetIntegerItem sets field value -func (o *TypeHolderExample) SetIntegerItem(v int32) { - o.IntegerItem = v -} - -// GetBoolItem returns the BoolItem field value -func (o *TypeHolderExample) GetBoolItem() bool { - if o == nil { - var ret bool - return ret - } - - return o.BoolItem -} - -// GetBoolItemOk returns a tuple with the BoolItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetBoolItemOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.BoolItem, true -} - -// SetBoolItem sets field value -func (o *TypeHolderExample) SetBoolItem(v bool) { - o.BoolItem = v -} - -// GetArrayItem returns the ArrayItem field value -func (o *TypeHolderExample) GetArrayItem() []int32 { - if o == nil { - var ret []int32 - return ret - } - - return o.ArrayItem -} - -// GetArrayItemOk returns a tuple with the ArrayItem field value -// and a boolean to check if the value has been set. -func (o *TypeHolderExample) GetArrayItemOk() (*[]int32, bool) { - if o == nil { - return nil, false - } - return &o.ArrayItem, true -} - -// SetArrayItem sets field value -func (o *TypeHolderExample) SetArrayItem(v []int32) { - o.ArrayItem = v -} - -func (o TypeHolderExample) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["string_item"] = o.StringItem - } - if true { - toSerialize["number_item"] = o.NumberItem - } - if true { - toSerialize["float_item"] = o.FloatItem - } - if true { - toSerialize["integer_item"] = o.IntegerItem - } - if true { - toSerialize["bool_item"] = o.BoolItem - } - if true { - toSerialize["array_item"] = o.ArrayItem - } - return json.Marshal(toSerialize) -} - -type NullableTypeHolderExample struct { - value *TypeHolderExample - isSet bool -} - -func (v NullableTypeHolderExample) Get() *TypeHolderExample { - return v.value -} - -func (v *NullableTypeHolderExample) Set(val *TypeHolderExample) { - v.value = val - v.isSet = true -} - -func (v NullableTypeHolderExample) IsSet() bool { - return v.isSet -} - -func (v *NullableTypeHolderExample) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTypeHolderExample(val *TypeHolderExample) *NullableTypeHolderExample { - return &NullableTypeHolderExample{value: val, isSet: true} -} - -func (v NullableTypeHolderExample) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTypeHolderExample) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_user.go b/samples/client/petstore/go-experimental/go-petstore/model_user.go deleted file mode 100644 index 7dff4e8b36b..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_user.go +++ /dev/null @@ -1,367 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// User struct for User -type User struct { - Id *int64 `json:"id,omitempty"` - Username *string `json:"username,omitempty"` - FirstName *string `json:"firstName,omitempty"` - LastName *string `json:"lastName,omitempty"` - Email *string `json:"email,omitempty"` - Password *string `json:"password,omitempty"` - Phone *string `json:"phone,omitempty"` - // User Status - UserStatus *int32 `json:"userStatus,omitempty"` -} - -// NewUser instantiates a new User object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUser() *User { - this := User{} - return &this -} - -// NewUserWithDefaults instantiates a new User object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUserWithDefaults() *User { - this := User{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *User) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *User) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *User) SetId(v int64) { - o.Id = &v -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *User) GetUsername() string { - if o == nil || o.Username == nil { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *User) HasUsername() bool { - if o != nil && o.Username != nil { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *User) SetUsername(v string) { - o.Username = &v -} - -// GetFirstName returns the FirstName field value if set, zero value otherwise. -func (o *User) GetFirstName() string { - if o == nil || o.FirstName == nil { - var ret string - return ret - } - return *o.FirstName -} - -// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetFirstNameOk() (*string, bool) { - if o == nil || o.FirstName == nil { - return nil, false - } - return o.FirstName, true -} - -// HasFirstName returns a boolean if a field has been set. -func (o *User) HasFirstName() bool { - if o != nil && o.FirstName != nil { - return true - } - - return false -} - -// SetFirstName gets a reference to the given string and assigns it to the FirstName field. -func (o *User) SetFirstName(v string) { - o.FirstName = &v -} - -// GetLastName returns the LastName field value if set, zero value otherwise. -func (o *User) GetLastName() string { - if o == nil || o.LastName == nil { - var ret string - return ret - } - return *o.LastName -} - -// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetLastNameOk() (*string, bool) { - if o == nil || o.LastName == nil { - return nil, false - } - return o.LastName, true -} - -// HasLastName returns a boolean if a field has been set. -func (o *User) HasLastName() bool { - if o != nil && o.LastName != nil { - return true - } - - return false -} - -// SetLastName gets a reference to the given string and assigns it to the LastName field. -func (o *User) SetLastName(v string) { - o.LastName = &v -} - -// GetEmail returns the Email field value if set, zero value otherwise. -func (o *User) GetEmail() string { - if o == nil || o.Email == nil { - var ret string - return ret - } - return *o.Email -} - -// GetEmailOk returns a tuple with the Email field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { - return nil, false - } - return o.Email, true -} - -// HasEmail returns a boolean if a field has been set. -func (o *User) HasEmail() bool { - if o != nil && o.Email != nil { - return true - } - - return false -} - -// SetEmail gets a reference to the given string and assigns it to the Email field. -func (o *User) SetEmail(v string) { - o.Email = &v -} - -// GetPassword returns the Password field value if set, zero value otherwise. -func (o *User) GetPassword() string { - if o == nil || o.Password == nil { - var ret string - return ret - } - return *o.Password -} - -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false - } - return o.Password, true -} - -// HasPassword returns a boolean if a field has been set. -func (o *User) HasPassword() bool { - if o != nil && o.Password != nil { - return true - } - - return false -} - -// SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *User) SetPassword(v string) { - o.Password = &v -} - -// GetPhone returns the Phone field value if set, zero value otherwise. -func (o *User) GetPhone() string { - if o == nil || o.Phone == nil { - var ret string - return ret - } - return *o.Phone -} - -// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetPhoneOk() (*string, bool) { - if o == nil || o.Phone == nil { - return nil, false - } - return o.Phone, true -} - -// HasPhone returns a boolean if a field has been set. -func (o *User) HasPhone() bool { - if o != nil && o.Phone != nil { - return true - } - - return false -} - -// SetPhone gets a reference to the given string and assigns it to the Phone field. -func (o *User) SetPhone(v string) { - o.Phone = &v -} - -// GetUserStatus returns the UserStatus field value if set, zero value otherwise. -func (o *User) GetUserStatus() int32 { - if o == nil || o.UserStatus == nil { - var ret int32 - return ret - } - return *o.UserStatus -} - -// GetUserStatusOk returns a tuple with the UserStatus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetUserStatusOk() (*int32, bool) { - if o == nil || o.UserStatus == nil { - return nil, false - } - return o.UserStatus, true -} - -// HasUserStatus returns a boolean if a field has been set. -func (o *User) HasUserStatus() bool { - if o != nil && o.UserStatus != nil { - return true - } - - return false -} - -// SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. -func (o *User) SetUserStatus(v int32) { - o.UserStatus = &v -} - -func (o User) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Username != nil { - toSerialize["username"] = o.Username - } - if o.FirstName != nil { - toSerialize["firstName"] = o.FirstName - } - if o.LastName != nil { - toSerialize["lastName"] = o.LastName - } - if o.Email != nil { - toSerialize["email"] = o.Email - } - if o.Password != nil { - toSerialize["password"] = o.Password - } - if o.Phone != nil { - toSerialize["phone"] = o.Phone - } - if o.UserStatus != nil { - toSerialize["userStatus"] = o.UserStatus - } - return json.Marshal(toSerialize) -} - -type NullableUser struct { - value *User - isSet bool -} - -func (v NullableUser) Get() *User { - return v.value -} - -func (v *NullableUser) Set(val *User) { - v.value = val - v.isSet = true -} - -func (v NullableUser) IsSet() bool { - return v.isSet -} - -func (v *NullableUser) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUser(val *User) *NullableUser { - return &NullableUser{value: val, isSet: true} -} - -func (v NullableUser) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUser) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go b/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go deleted file mode 100644 index 8bf7f3ef707..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/model_xml_item.go +++ /dev/null @@ -1,1122 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// XmlItem struct for XmlItem -type XmlItem struct { - AttributeString *string `json:"attribute_string,omitempty"` - AttributeNumber *float32 `json:"attribute_number,omitempty"` - AttributeInteger *int32 `json:"attribute_integer,omitempty"` - AttributeBoolean *bool `json:"attribute_boolean,omitempty"` - WrappedArray *[]int32 `json:"wrapped_array,omitempty"` - NameString *string `json:"name_string,omitempty"` - NameNumber *float32 `json:"name_number,omitempty"` - NameInteger *int32 `json:"name_integer,omitempty"` - NameBoolean *bool `json:"name_boolean,omitempty"` - NameArray *[]int32 `json:"name_array,omitempty"` - NameWrappedArray *[]int32 `json:"name_wrapped_array,omitempty"` - PrefixString *string `json:"prefix_string,omitempty"` - PrefixNumber *float32 `json:"prefix_number,omitempty"` - PrefixInteger *int32 `json:"prefix_integer,omitempty"` - PrefixBoolean *bool `json:"prefix_boolean,omitempty"` - PrefixArray *[]int32 `json:"prefix_array,omitempty"` - PrefixWrappedArray *[]int32 `json:"prefix_wrapped_array,omitempty"` - NamespaceString *string `json:"namespace_string,omitempty"` - NamespaceNumber *float32 `json:"namespace_number,omitempty"` - NamespaceInteger *int32 `json:"namespace_integer,omitempty"` - NamespaceBoolean *bool `json:"namespace_boolean,omitempty"` - NamespaceArray *[]int32 `json:"namespace_array,omitempty"` - NamespaceWrappedArray *[]int32 `json:"namespace_wrapped_array,omitempty"` - PrefixNsString *string `json:"prefix_ns_string,omitempty"` - PrefixNsNumber *float32 `json:"prefix_ns_number,omitempty"` - PrefixNsInteger *int32 `json:"prefix_ns_integer,omitempty"` - PrefixNsBoolean *bool `json:"prefix_ns_boolean,omitempty"` - PrefixNsArray *[]int32 `json:"prefix_ns_array,omitempty"` - PrefixNsWrappedArray *[]int32 `json:"prefix_ns_wrapped_array,omitempty"` -} - -// NewXmlItem instantiates a new XmlItem object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewXmlItem() *XmlItem { - this := XmlItem{} - return &this -} - -// NewXmlItemWithDefaults instantiates a new XmlItem object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewXmlItemWithDefaults() *XmlItem { - this := XmlItem{} - return &this -} - -// GetAttributeString returns the AttributeString field value if set, zero value otherwise. -func (o *XmlItem) GetAttributeString() string { - if o == nil || o.AttributeString == nil { - var ret string - return ret - } - return *o.AttributeString -} - -// GetAttributeStringOk returns a tuple with the AttributeString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetAttributeStringOk() (*string, bool) { - if o == nil || o.AttributeString == nil { - return nil, false - } - return o.AttributeString, true -} - -// HasAttributeString returns a boolean if a field has been set. -func (o *XmlItem) HasAttributeString() bool { - if o != nil && o.AttributeString != nil { - return true - } - - return false -} - -// SetAttributeString gets a reference to the given string and assigns it to the AttributeString field. -func (o *XmlItem) SetAttributeString(v string) { - o.AttributeString = &v -} - -// GetAttributeNumber returns the AttributeNumber field value if set, zero value otherwise. -func (o *XmlItem) GetAttributeNumber() float32 { - if o == nil || o.AttributeNumber == nil { - var ret float32 - return ret - } - return *o.AttributeNumber -} - -// GetAttributeNumberOk returns a tuple with the AttributeNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetAttributeNumberOk() (*float32, bool) { - if o == nil || o.AttributeNumber == nil { - return nil, false - } - return o.AttributeNumber, true -} - -// HasAttributeNumber returns a boolean if a field has been set. -func (o *XmlItem) HasAttributeNumber() bool { - if o != nil && o.AttributeNumber != nil { - return true - } - - return false -} - -// SetAttributeNumber gets a reference to the given float32 and assigns it to the AttributeNumber field. -func (o *XmlItem) SetAttributeNumber(v float32) { - o.AttributeNumber = &v -} - -// GetAttributeInteger returns the AttributeInteger field value if set, zero value otherwise. -func (o *XmlItem) GetAttributeInteger() int32 { - if o == nil || o.AttributeInteger == nil { - var ret int32 - return ret - } - return *o.AttributeInteger -} - -// GetAttributeIntegerOk returns a tuple with the AttributeInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetAttributeIntegerOk() (*int32, bool) { - if o == nil || o.AttributeInteger == nil { - return nil, false - } - return o.AttributeInteger, true -} - -// HasAttributeInteger returns a boolean if a field has been set. -func (o *XmlItem) HasAttributeInteger() bool { - if o != nil && o.AttributeInteger != nil { - return true - } - - return false -} - -// SetAttributeInteger gets a reference to the given int32 and assigns it to the AttributeInteger field. -func (o *XmlItem) SetAttributeInteger(v int32) { - o.AttributeInteger = &v -} - -// GetAttributeBoolean returns the AttributeBoolean field value if set, zero value otherwise. -func (o *XmlItem) GetAttributeBoolean() bool { - if o == nil || o.AttributeBoolean == nil { - var ret bool - return ret - } - return *o.AttributeBoolean -} - -// GetAttributeBooleanOk returns a tuple with the AttributeBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetAttributeBooleanOk() (*bool, bool) { - if o == nil || o.AttributeBoolean == nil { - return nil, false - } - return o.AttributeBoolean, true -} - -// HasAttributeBoolean returns a boolean if a field has been set. -func (o *XmlItem) HasAttributeBoolean() bool { - if o != nil && o.AttributeBoolean != nil { - return true - } - - return false -} - -// SetAttributeBoolean gets a reference to the given bool and assigns it to the AttributeBoolean field. -func (o *XmlItem) SetAttributeBoolean(v bool) { - o.AttributeBoolean = &v -} - -// GetWrappedArray returns the WrappedArray field value if set, zero value otherwise. -func (o *XmlItem) GetWrappedArray() []int32 { - if o == nil || o.WrappedArray == nil { - var ret []int32 - return ret - } - return *o.WrappedArray -} - -// GetWrappedArrayOk returns a tuple with the WrappedArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetWrappedArrayOk() (*[]int32, bool) { - if o == nil || o.WrappedArray == nil { - return nil, false - } - return o.WrappedArray, true -} - -// HasWrappedArray returns a boolean if a field has been set. -func (o *XmlItem) HasWrappedArray() bool { - if o != nil && o.WrappedArray != nil { - return true - } - - return false -} - -// SetWrappedArray gets a reference to the given []int32 and assigns it to the WrappedArray field. -func (o *XmlItem) SetWrappedArray(v []int32) { - o.WrappedArray = &v -} - -// GetNameString returns the NameString field value if set, zero value otherwise. -func (o *XmlItem) GetNameString() string { - if o == nil || o.NameString == nil { - var ret string - return ret - } - return *o.NameString -} - -// GetNameStringOk returns a tuple with the NameString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNameStringOk() (*string, bool) { - if o == nil || o.NameString == nil { - return nil, false - } - return o.NameString, true -} - -// HasNameString returns a boolean if a field has been set. -func (o *XmlItem) HasNameString() bool { - if o != nil && o.NameString != nil { - return true - } - - return false -} - -// SetNameString gets a reference to the given string and assigns it to the NameString field. -func (o *XmlItem) SetNameString(v string) { - o.NameString = &v -} - -// GetNameNumber returns the NameNumber field value if set, zero value otherwise. -func (o *XmlItem) GetNameNumber() float32 { - if o == nil || o.NameNumber == nil { - var ret float32 - return ret - } - return *o.NameNumber -} - -// GetNameNumberOk returns a tuple with the NameNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNameNumberOk() (*float32, bool) { - if o == nil || o.NameNumber == nil { - return nil, false - } - return o.NameNumber, true -} - -// HasNameNumber returns a boolean if a field has been set. -func (o *XmlItem) HasNameNumber() bool { - if o != nil && o.NameNumber != nil { - return true - } - - return false -} - -// SetNameNumber gets a reference to the given float32 and assigns it to the NameNumber field. -func (o *XmlItem) SetNameNumber(v float32) { - o.NameNumber = &v -} - -// GetNameInteger returns the NameInteger field value if set, zero value otherwise. -func (o *XmlItem) GetNameInteger() int32 { - if o == nil || o.NameInteger == nil { - var ret int32 - return ret - } - return *o.NameInteger -} - -// GetNameIntegerOk returns a tuple with the NameInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNameIntegerOk() (*int32, bool) { - if o == nil || o.NameInteger == nil { - return nil, false - } - return o.NameInteger, true -} - -// HasNameInteger returns a boolean if a field has been set. -func (o *XmlItem) HasNameInteger() bool { - if o != nil && o.NameInteger != nil { - return true - } - - return false -} - -// SetNameInteger gets a reference to the given int32 and assigns it to the NameInteger field. -func (o *XmlItem) SetNameInteger(v int32) { - o.NameInteger = &v -} - -// GetNameBoolean returns the NameBoolean field value if set, zero value otherwise. -func (o *XmlItem) GetNameBoolean() bool { - if o == nil || o.NameBoolean == nil { - var ret bool - return ret - } - return *o.NameBoolean -} - -// GetNameBooleanOk returns a tuple with the NameBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNameBooleanOk() (*bool, bool) { - if o == nil || o.NameBoolean == nil { - return nil, false - } - return o.NameBoolean, true -} - -// HasNameBoolean returns a boolean if a field has been set. -func (o *XmlItem) HasNameBoolean() bool { - if o != nil && o.NameBoolean != nil { - return true - } - - return false -} - -// SetNameBoolean gets a reference to the given bool and assigns it to the NameBoolean field. -func (o *XmlItem) SetNameBoolean(v bool) { - o.NameBoolean = &v -} - -// GetNameArray returns the NameArray field value if set, zero value otherwise. -func (o *XmlItem) GetNameArray() []int32 { - if o == nil || o.NameArray == nil { - var ret []int32 - return ret - } - return *o.NameArray -} - -// GetNameArrayOk returns a tuple with the NameArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNameArrayOk() (*[]int32, bool) { - if o == nil || o.NameArray == nil { - return nil, false - } - return o.NameArray, true -} - -// HasNameArray returns a boolean if a field has been set. -func (o *XmlItem) HasNameArray() bool { - if o != nil && o.NameArray != nil { - return true - } - - return false -} - -// SetNameArray gets a reference to the given []int32 and assigns it to the NameArray field. -func (o *XmlItem) SetNameArray(v []int32) { - o.NameArray = &v -} - -// GetNameWrappedArray returns the NameWrappedArray field value if set, zero value otherwise. -func (o *XmlItem) GetNameWrappedArray() []int32 { - if o == nil || o.NameWrappedArray == nil { - var ret []int32 - return ret - } - return *o.NameWrappedArray -} - -// GetNameWrappedArrayOk returns a tuple with the NameWrappedArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNameWrappedArrayOk() (*[]int32, bool) { - if o == nil || o.NameWrappedArray == nil { - return nil, false - } - return o.NameWrappedArray, true -} - -// HasNameWrappedArray returns a boolean if a field has been set. -func (o *XmlItem) HasNameWrappedArray() bool { - if o != nil && o.NameWrappedArray != nil { - return true - } - - return false -} - -// SetNameWrappedArray gets a reference to the given []int32 and assigns it to the NameWrappedArray field. -func (o *XmlItem) SetNameWrappedArray(v []int32) { - o.NameWrappedArray = &v -} - -// GetPrefixString returns the PrefixString field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixString() string { - if o == nil || o.PrefixString == nil { - var ret string - return ret - } - return *o.PrefixString -} - -// GetPrefixStringOk returns a tuple with the PrefixString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixStringOk() (*string, bool) { - if o == nil || o.PrefixString == nil { - return nil, false - } - return o.PrefixString, true -} - -// HasPrefixString returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixString() bool { - if o != nil && o.PrefixString != nil { - return true - } - - return false -} - -// SetPrefixString gets a reference to the given string and assigns it to the PrefixString field. -func (o *XmlItem) SetPrefixString(v string) { - o.PrefixString = &v -} - -// GetPrefixNumber returns the PrefixNumber field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNumber() float32 { - if o == nil || o.PrefixNumber == nil { - var ret float32 - return ret - } - return *o.PrefixNumber -} - -// GetPrefixNumberOk returns a tuple with the PrefixNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNumberOk() (*float32, bool) { - if o == nil || o.PrefixNumber == nil { - return nil, false - } - return o.PrefixNumber, true -} - -// HasPrefixNumber returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNumber() bool { - if o != nil && o.PrefixNumber != nil { - return true - } - - return false -} - -// SetPrefixNumber gets a reference to the given float32 and assigns it to the PrefixNumber field. -func (o *XmlItem) SetPrefixNumber(v float32) { - o.PrefixNumber = &v -} - -// GetPrefixInteger returns the PrefixInteger field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixInteger() int32 { - if o == nil || o.PrefixInteger == nil { - var ret int32 - return ret - } - return *o.PrefixInteger -} - -// GetPrefixIntegerOk returns a tuple with the PrefixInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixIntegerOk() (*int32, bool) { - if o == nil || o.PrefixInteger == nil { - return nil, false - } - return o.PrefixInteger, true -} - -// HasPrefixInteger returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixInteger() bool { - if o != nil && o.PrefixInteger != nil { - return true - } - - return false -} - -// SetPrefixInteger gets a reference to the given int32 and assigns it to the PrefixInteger field. -func (o *XmlItem) SetPrefixInteger(v int32) { - o.PrefixInteger = &v -} - -// GetPrefixBoolean returns the PrefixBoolean field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixBoolean() bool { - if o == nil || o.PrefixBoolean == nil { - var ret bool - return ret - } - return *o.PrefixBoolean -} - -// GetPrefixBooleanOk returns a tuple with the PrefixBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixBooleanOk() (*bool, bool) { - if o == nil || o.PrefixBoolean == nil { - return nil, false - } - return o.PrefixBoolean, true -} - -// HasPrefixBoolean returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixBoolean() bool { - if o != nil && o.PrefixBoolean != nil { - return true - } - - return false -} - -// SetPrefixBoolean gets a reference to the given bool and assigns it to the PrefixBoolean field. -func (o *XmlItem) SetPrefixBoolean(v bool) { - o.PrefixBoolean = &v -} - -// GetPrefixArray returns the PrefixArray field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixArray() []int32 { - if o == nil || o.PrefixArray == nil { - var ret []int32 - return ret - } - return *o.PrefixArray -} - -// GetPrefixArrayOk returns a tuple with the PrefixArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixArrayOk() (*[]int32, bool) { - if o == nil || o.PrefixArray == nil { - return nil, false - } - return o.PrefixArray, true -} - -// HasPrefixArray returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixArray() bool { - if o != nil && o.PrefixArray != nil { - return true - } - - return false -} - -// SetPrefixArray gets a reference to the given []int32 and assigns it to the PrefixArray field. -func (o *XmlItem) SetPrefixArray(v []int32) { - o.PrefixArray = &v -} - -// GetPrefixWrappedArray returns the PrefixWrappedArray field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixWrappedArray() []int32 { - if o == nil || o.PrefixWrappedArray == nil { - var ret []int32 - return ret - } - return *o.PrefixWrappedArray -} - -// GetPrefixWrappedArrayOk returns a tuple with the PrefixWrappedArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixWrappedArrayOk() (*[]int32, bool) { - if o == nil || o.PrefixWrappedArray == nil { - return nil, false - } - return o.PrefixWrappedArray, true -} - -// HasPrefixWrappedArray returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixWrappedArray() bool { - if o != nil && o.PrefixWrappedArray != nil { - return true - } - - return false -} - -// SetPrefixWrappedArray gets a reference to the given []int32 and assigns it to the PrefixWrappedArray field. -func (o *XmlItem) SetPrefixWrappedArray(v []int32) { - o.PrefixWrappedArray = &v -} - -// GetNamespaceString returns the NamespaceString field value if set, zero value otherwise. -func (o *XmlItem) GetNamespaceString() string { - if o == nil || o.NamespaceString == nil { - var ret string - return ret - } - return *o.NamespaceString -} - -// GetNamespaceStringOk returns a tuple with the NamespaceString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceStringOk() (*string, bool) { - if o == nil || o.NamespaceString == nil { - return nil, false - } - return o.NamespaceString, true -} - -// HasNamespaceString returns a boolean if a field has been set. -func (o *XmlItem) HasNamespaceString() bool { - if o != nil && o.NamespaceString != nil { - return true - } - - return false -} - -// SetNamespaceString gets a reference to the given string and assigns it to the NamespaceString field. -func (o *XmlItem) SetNamespaceString(v string) { - o.NamespaceString = &v -} - -// GetNamespaceNumber returns the NamespaceNumber field value if set, zero value otherwise. -func (o *XmlItem) GetNamespaceNumber() float32 { - if o == nil || o.NamespaceNumber == nil { - var ret float32 - return ret - } - return *o.NamespaceNumber -} - -// GetNamespaceNumberOk returns a tuple with the NamespaceNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceNumberOk() (*float32, bool) { - if o == nil || o.NamespaceNumber == nil { - return nil, false - } - return o.NamespaceNumber, true -} - -// HasNamespaceNumber returns a boolean if a field has been set. -func (o *XmlItem) HasNamespaceNumber() bool { - if o != nil && o.NamespaceNumber != nil { - return true - } - - return false -} - -// SetNamespaceNumber gets a reference to the given float32 and assigns it to the NamespaceNumber field. -func (o *XmlItem) SetNamespaceNumber(v float32) { - o.NamespaceNumber = &v -} - -// GetNamespaceInteger returns the NamespaceInteger field value if set, zero value otherwise. -func (o *XmlItem) GetNamespaceInteger() int32 { - if o == nil || o.NamespaceInteger == nil { - var ret int32 - return ret - } - return *o.NamespaceInteger -} - -// GetNamespaceIntegerOk returns a tuple with the NamespaceInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceIntegerOk() (*int32, bool) { - if o == nil || o.NamespaceInteger == nil { - return nil, false - } - return o.NamespaceInteger, true -} - -// HasNamespaceInteger returns a boolean if a field has been set. -func (o *XmlItem) HasNamespaceInteger() bool { - if o != nil && o.NamespaceInteger != nil { - return true - } - - return false -} - -// SetNamespaceInteger gets a reference to the given int32 and assigns it to the NamespaceInteger field. -func (o *XmlItem) SetNamespaceInteger(v int32) { - o.NamespaceInteger = &v -} - -// GetNamespaceBoolean returns the NamespaceBoolean field value if set, zero value otherwise. -func (o *XmlItem) GetNamespaceBoolean() bool { - if o == nil || o.NamespaceBoolean == nil { - var ret bool - return ret - } - return *o.NamespaceBoolean -} - -// GetNamespaceBooleanOk returns a tuple with the NamespaceBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceBooleanOk() (*bool, bool) { - if o == nil || o.NamespaceBoolean == nil { - return nil, false - } - return o.NamespaceBoolean, true -} - -// HasNamespaceBoolean returns a boolean if a field has been set. -func (o *XmlItem) HasNamespaceBoolean() bool { - if o != nil && o.NamespaceBoolean != nil { - return true - } - - return false -} - -// SetNamespaceBoolean gets a reference to the given bool and assigns it to the NamespaceBoolean field. -func (o *XmlItem) SetNamespaceBoolean(v bool) { - o.NamespaceBoolean = &v -} - -// GetNamespaceArray returns the NamespaceArray field value if set, zero value otherwise. -func (o *XmlItem) GetNamespaceArray() []int32 { - if o == nil || o.NamespaceArray == nil { - var ret []int32 - return ret - } - return *o.NamespaceArray -} - -// GetNamespaceArrayOk returns a tuple with the NamespaceArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceArrayOk() (*[]int32, bool) { - if o == nil || o.NamespaceArray == nil { - return nil, false - } - return o.NamespaceArray, true -} - -// HasNamespaceArray returns a boolean if a field has been set. -func (o *XmlItem) HasNamespaceArray() bool { - if o != nil && o.NamespaceArray != nil { - return true - } - - return false -} - -// SetNamespaceArray gets a reference to the given []int32 and assigns it to the NamespaceArray field. -func (o *XmlItem) SetNamespaceArray(v []int32) { - o.NamespaceArray = &v -} - -// GetNamespaceWrappedArray returns the NamespaceWrappedArray field value if set, zero value otherwise. -func (o *XmlItem) GetNamespaceWrappedArray() []int32 { - if o == nil || o.NamespaceWrappedArray == nil { - var ret []int32 - return ret - } - return *o.NamespaceWrappedArray -} - -// GetNamespaceWrappedArrayOk returns a tuple with the NamespaceWrappedArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetNamespaceWrappedArrayOk() (*[]int32, bool) { - if o == nil || o.NamespaceWrappedArray == nil { - return nil, false - } - return o.NamespaceWrappedArray, true -} - -// HasNamespaceWrappedArray returns a boolean if a field has been set. -func (o *XmlItem) HasNamespaceWrappedArray() bool { - if o != nil && o.NamespaceWrappedArray != nil { - return true - } - - return false -} - -// SetNamespaceWrappedArray gets a reference to the given []int32 and assigns it to the NamespaceWrappedArray field. -func (o *XmlItem) SetNamespaceWrappedArray(v []int32) { - o.NamespaceWrappedArray = &v -} - -// GetPrefixNsString returns the PrefixNsString field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNsString() string { - if o == nil || o.PrefixNsString == nil { - var ret string - return ret - } - return *o.PrefixNsString -} - -// GetPrefixNsStringOk returns a tuple with the PrefixNsString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsStringOk() (*string, bool) { - if o == nil || o.PrefixNsString == nil { - return nil, false - } - return o.PrefixNsString, true -} - -// HasPrefixNsString returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNsString() bool { - if o != nil && o.PrefixNsString != nil { - return true - } - - return false -} - -// SetPrefixNsString gets a reference to the given string and assigns it to the PrefixNsString field. -func (o *XmlItem) SetPrefixNsString(v string) { - o.PrefixNsString = &v -} - -// GetPrefixNsNumber returns the PrefixNsNumber field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNsNumber() float32 { - if o == nil || o.PrefixNsNumber == nil { - var ret float32 - return ret - } - return *o.PrefixNsNumber -} - -// GetPrefixNsNumberOk returns a tuple with the PrefixNsNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsNumberOk() (*float32, bool) { - if o == nil || o.PrefixNsNumber == nil { - return nil, false - } - return o.PrefixNsNumber, true -} - -// HasPrefixNsNumber returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNsNumber() bool { - if o != nil && o.PrefixNsNumber != nil { - return true - } - - return false -} - -// SetPrefixNsNumber gets a reference to the given float32 and assigns it to the PrefixNsNumber field. -func (o *XmlItem) SetPrefixNsNumber(v float32) { - o.PrefixNsNumber = &v -} - -// GetPrefixNsInteger returns the PrefixNsInteger field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNsInteger() int32 { - if o == nil || o.PrefixNsInteger == nil { - var ret int32 - return ret - } - return *o.PrefixNsInteger -} - -// GetPrefixNsIntegerOk returns a tuple with the PrefixNsInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsIntegerOk() (*int32, bool) { - if o == nil || o.PrefixNsInteger == nil { - return nil, false - } - return o.PrefixNsInteger, true -} - -// HasPrefixNsInteger returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNsInteger() bool { - if o != nil && o.PrefixNsInteger != nil { - return true - } - - return false -} - -// SetPrefixNsInteger gets a reference to the given int32 and assigns it to the PrefixNsInteger field. -func (o *XmlItem) SetPrefixNsInteger(v int32) { - o.PrefixNsInteger = &v -} - -// GetPrefixNsBoolean returns the PrefixNsBoolean field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNsBoolean() bool { - if o == nil || o.PrefixNsBoolean == nil { - var ret bool - return ret - } - return *o.PrefixNsBoolean -} - -// GetPrefixNsBooleanOk returns a tuple with the PrefixNsBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsBooleanOk() (*bool, bool) { - if o == nil || o.PrefixNsBoolean == nil { - return nil, false - } - return o.PrefixNsBoolean, true -} - -// HasPrefixNsBoolean returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNsBoolean() bool { - if o != nil && o.PrefixNsBoolean != nil { - return true - } - - return false -} - -// SetPrefixNsBoolean gets a reference to the given bool and assigns it to the PrefixNsBoolean field. -func (o *XmlItem) SetPrefixNsBoolean(v bool) { - o.PrefixNsBoolean = &v -} - -// GetPrefixNsArray returns the PrefixNsArray field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNsArray() []int32 { - if o == nil || o.PrefixNsArray == nil { - var ret []int32 - return ret - } - return *o.PrefixNsArray -} - -// GetPrefixNsArrayOk returns a tuple with the PrefixNsArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsArrayOk() (*[]int32, bool) { - if o == nil || o.PrefixNsArray == nil { - return nil, false - } - return o.PrefixNsArray, true -} - -// HasPrefixNsArray returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNsArray() bool { - if o != nil && o.PrefixNsArray != nil { - return true - } - - return false -} - -// SetPrefixNsArray gets a reference to the given []int32 and assigns it to the PrefixNsArray field. -func (o *XmlItem) SetPrefixNsArray(v []int32) { - o.PrefixNsArray = &v -} - -// GetPrefixNsWrappedArray returns the PrefixNsWrappedArray field value if set, zero value otherwise. -func (o *XmlItem) GetPrefixNsWrappedArray() []int32 { - if o == nil || o.PrefixNsWrappedArray == nil { - var ret []int32 - return ret - } - return *o.PrefixNsWrappedArray -} - -// GetPrefixNsWrappedArrayOk returns a tuple with the PrefixNsWrappedArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *XmlItem) GetPrefixNsWrappedArrayOk() (*[]int32, bool) { - if o == nil || o.PrefixNsWrappedArray == nil { - return nil, false - } - return o.PrefixNsWrappedArray, true -} - -// HasPrefixNsWrappedArray returns a boolean if a field has been set. -func (o *XmlItem) HasPrefixNsWrappedArray() bool { - if o != nil && o.PrefixNsWrappedArray != nil { - return true - } - - return false -} - -// SetPrefixNsWrappedArray gets a reference to the given []int32 and assigns it to the PrefixNsWrappedArray field. -func (o *XmlItem) SetPrefixNsWrappedArray(v []int32) { - o.PrefixNsWrappedArray = &v -} - -func (o XmlItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.AttributeString != nil { - toSerialize["attribute_string"] = o.AttributeString - } - if o.AttributeNumber != nil { - toSerialize["attribute_number"] = o.AttributeNumber - } - if o.AttributeInteger != nil { - toSerialize["attribute_integer"] = o.AttributeInteger - } - if o.AttributeBoolean != nil { - toSerialize["attribute_boolean"] = o.AttributeBoolean - } - if o.WrappedArray != nil { - toSerialize["wrapped_array"] = o.WrappedArray - } - if o.NameString != nil { - toSerialize["name_string"] = o.NameString - } - if o.NameNumber != nil { - toSerialize["name_number"] = o.NameNumber - } - if o.NameInteger != nil { - toSerialize["name_integer"] = o.NameInteger - } - if o.NameBoolean != nil { - toSerialize["name_boolean"] = o.NameBoolean - } - if o.NameArray != nil { - toSerialize["name_array"] = o.NameArray - } - if o.NameWrappedArray != nil { - toSerialize["name_wrapped_array"] = o.NameWrappedArray - } - if o.PrefixString != nil { - toSerialize["prefix_string"] = o.PrefixString - } - if o.PrefixNumber != nil { - toSerialize["prefix_number"] = o.PrefixNumber - } - if o.PrefixInteger != nil { - toSerialize["prefix_integer"] = o.PrefixInteger - } - if o.PrefixBoolean != nil { - toSerialize["prefix_boolean"] = o.PrefixBoolean - } - if o.PrefixArray != nil { - toSerialize["prefix_array"] = o.PrefixArray - } - if o.PrefixWrappedArray != nil { - toSerialize["prefix_wrapped_array"] = o.PrefixWrappedArray - } - if o.NamespaceString != nil { - toSerialize["namespace_string"] = o.NamespaceString - } - if o.NamespaceNumber != nil { - toSerialize["namespace_number"] = o.NamespaceNumber - } - if o.NamespaceInteger != nil { - toSerialize["namespace_integer"] = o.NamespaceInteger - } - if o.NamespaceBoolean != nil { - toSerialize["namespace_boolean"] = o.NamespaceBoolean - } - if o.NamespaceArray != nil { - toSerialize["namespace_array"] = o.NamespaceArray - } - if o.NamespaceWrappedArray != nil { - toSerialize["namespace_wrapped_array"] = o.NamespaceWrappedArray - } - if o.PrefixNsString != nil { - toSerialize["prefix_ns_string"] = o.PrefixNsString - } - if o.PrefixNsNumber != nil { - toSerialize["prefix_ns_number"] = o.PrefixNsNumber - } - if o.PrefixNsInteger != nil { - toSerialize["prefix_ns_integer"] = o.PrefixNsInteger - } - if o.PrefixNsBoolean != nil { - toSerialize["prefix_ns_boolean"] = o.PrefixNsBoolean - } - if o.PrefixNsArray != nil { - toSerialize["prefix_ns_array"] = o.PrefixNsArray - } - if o.PrefixNsWrappedArray != nil { - toSerialize["prefix_ns_wrapped_array"] = o.PrefixNsWrappedArray - } - return json.Marshal(toSerialize) -} - -type NullableXmlItem struct { - value *XmlItem - isSet bool -} - -func (v NullableXmlItem) Get() *XmlItem { - return v.value -} - -func (v *NullableXmlItem) Set(val *XmlItem) { - v.value = val - v.isSet = true -} - -func (v NullableXmlItem) IsSet() bool { - return v.isSet -} - -func (v *NullableXmlItem) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableXmlItem(val *XmlItem) *NullableXmlItem { - return &NullableXmlItem{value: val, isSet: true} -} - -func (v NullableXmlItem) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableXmlItem) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/client/petstore/go-experimental/go-petstore/response.go b/samples/client/petstore/go-experimental/go-petstore/response.go deleted file mode 100644 index c16f181f4e9..00000000000 --- a/samples/client/petstore/go-experimental/go-petstore/response.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResonse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/samples/client/petstore/go-experimental/pet_api_test.go b/samples/client/petstore/go-experimental/pet_api_test.go deleted file mode 100644 index 0868c4b96cc..00000000000 --- a/samples/client/petstore/go-experimental/pet_api_test.go +++ /dev/null @@ -1,302 +0,0 @@ -package main - -import ( - "context" - "fmt" - "os" - "testing" - - "github.com/stretchr/testify/assert" - - sw "./go-petstore" - mock "./mock" -) - -var client *sw.APIClient - -const testHost = "petstore.swagger.io:80" -const testScheme = "http" - -func TestMain(m *testing.M) { - cfg := sw.NewConfiguration() - cfg.AddDefaultHeader("testheader", "testvalue") - cfg.Host = testHost - cfg.Scheme = testScheme - client = sw.NewAPIClient(cfg) - retCode := m.Run() - os.Exit(retCode) -} - -func TestAddPet(t *testing.T) { - newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestAddPetMock(t *testing.T) { - actualApi := client.PetApi - - mockApi := mock.NewMockPetApi() - client.PetApi = mockApi - TestAddPet(t) - client.PetApi = actualApi -} - -func TestFindPetsByStatusWithMissingParam(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - - if err != nil { - t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestGetPetById(t *testing.T) { - isPetCorrect(t, 12830, "gopher", "pending") -} - -func TestGetPetByIdWithInvalidID(t *testing.T) { - resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() - if r != nil && r.StatusCode == 404 { - assertedError, ok := err.(sw.GenericOpenAPIError) - a := assert.New(t) - a.True(ok) - a.Contains(string(assertedError.Body()), "type") - - a.Contains(assertedError.Error(), "Not Found") - } else if err != nil { - t.Fatalf("Error while getting pet by invalid id: %v", err) - t.Log(r) - } else { - t.Log(resp) - } -} - -func TestUpdatePetWithForm(t *testing.T) { - r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() - if err != nil { - t.Fatalf("Error while updating pet by id: %v", err) - t.Log(r) - } - if r.StatusCode != 200 { - t.Log(r) - } - - // get the pet with id 12830 from server to verify the update - isPetCorrect(t, 12830, "golang", "available") -} - -func TestFindPetsByTag(t *testing.T) { - var found = false - resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() - if err != nil { - t.Fatalf("Error while getting pet by tag: %v", err) - t.Log(r) - } else { - if len(resp) == 0 { - t.Errorf("Error no pets returned") - } else { - - assert := assert.New(t) - for i := 0; i < len(resp); i++ { - if *resp[i].Id == 12830 { - assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`") - found = true - } - } - } - - if found == false { - t.Errorf("Error while getting pet by tag could not find 12830") - } - - if r.StatusCode != 200 { - t.Log(r) - } - } -} - -func TestFindPetsByStatus(t *testing.T) { - resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() - if err != nil { - t.Fatalf("Error while getting pet by id: %v", err) - t.Log(r) - } else { - if len(resp) == 0 { - t.Errorf("Error no pets returned") - } else { - assert := assert.New(t) - for i := 0; i < len(resp); i++ { - assert.Equal(*resp[i].Status, "available", "Pet status should be `available`") - } - } - - if r.StatusCode != 200 { - t.Log(r) - } - } -} - -func TestUploadFile(t *testing.T) { - file, err1 := os.Open("testfiles/foo.png") - if err1 != nil { - t.Fatalf("Error opening file: %v", err1) - } - - _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() - - if err != nil { - t.Fatalf("Error while uploading file: %v", err) - } - - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestUploadFileRequired(t *testing.T) { - return // remove when server supports this endpoint - file, err1 := os.Open("testfiles/foo.png") - if err1 != nil { - t.Fatalf("Error opening file: %v", err1) - } - - _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() - - if err != nil { - t.Fatalf("Error while uploading file: %v", err) - } - - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestDeletePet(t *testing.T) { - r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -/* -// Test we can concurrently create, retrieve, update, and delete. -func TestConcurrency(t *testing.T) { - errc := make(chan error) - - newPets := []sw.Pet{ - sw.Pet{Id: 912345, Name: "gopherFred", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, - sw.Pet{Id: 912346, Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, - sw.Pet{Id: 912347, Name: "gopherRick", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "mia"}, - sw.Pet{Id: 912348, Name: "gopherJohn", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, - sw.Pet{Id: 912349, Name: "gopherAlf", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, - sw.Pet{Id: 912350, Name: "gopherRob", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, - sw.Pet{Id: 912351, Name: "gopherIan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, - } - - // Add the pets. - for _, pet := range newPets { - go func(newPet sw.Pet) { - r, err := client.PetApi.AddPet(nil, newPet) - if r.StatusCode != 200 { - t.Log(r) - } - errc <- err - }(pet) - } - waitOnFunctions(t, errc, len(newPets)) - - // Verify they are correct. - for _, pet := range newPets { - go func(pet sw.Pet) { - isPetCorrect(t, pet.Id, pet.Name, pet.Status) - errc <- nil - }(pet) - } - - waitOnFunctions(t, errc, len(newPets)) - - // Update all to active with the name gopherDan - for _, pet := range newPets { - go func(id int64) { - r, err := client.PetApi.UpdatePet(nil, sw.Pet{Id: (int64)(id), Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}) - if r.StatusCode != 200 { - t.Log(r) - } - errc <- err - }(pet.Id) - } - waitOnFunctions(t, errc, len(newPets)) - - // Verify they are correct. - for _, pet := range newPets { - go func(pet sw.Pet) { - isPetCorrect(t, pet.Id, "gopherDan", "active") - errc <- nil - }(pet) - } - - waitOnFunctions(t, errc, len(newPets)) - - // Delete them all. - for _, pet := range newPets { - go func(id int64) { - deletePet(t, (int64)(id)) - errc <- nil - }(pet.Id) - } - waitOnFunctions(t, errc, len(newPets)) -} -*/ - -func waitOnFunctions(t *testing.T, errc chan error, n int) { - for i := 0; i < n; i++ { - err := <-errc - if err != nil { - t.Fatalf("Error performing concurrent test: %v", err) - } - } -} - -func deletePet(t *testing.T, id int64) { - r, err := client.PetApi.DeletePet(context.Background(), id).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func isPetCorrect(t *testing.T, id int64, name string, status string) { - assert := assert.New(t) - resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() - if err != nil { - t.Fatalf("Error while getting pet by id: %v", err) - } else { - assert.Equal(*resp.Id, int64(id), "Pet id should be equal") - assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) - assert.Equal(*resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) - - //t.Log(resp) - } - if r.StatusCode != 200 { - t.Log(r) - } -} diff --git a/samples/client/petstore/go-experimental/pom.xml b/samples/client/petstore/go-experimental/pom.xml deleted file mode 100644 index 9c62bbb9554..00000000000 --- a/samples/client/petstore/go-experimental/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - 4.0.0 - org.openapitools - GoExperimentalPetstore - pom - 1.0.0 - Go Experimental Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - go-get-testify - pre-integration-test - - exec - - - go - - get - github.com/stretchr/testify/assert - - - - - go-get-oauth2 - pre-integration-test - - exec - - - go - - get - golang.org/x/oauth2 - - - - - go-get-context - pre-integration-test - - exec - - - go - - get - golang.org/x/net/context - - - - - go-test - integration-test - - exec - - - go - - test - -v - - - - - - - - diff --git a/samples/client/petstore/go-experimental/store_api_test.go b/samples/client/petstore/go-experimental/store_api_test.go deleted file mode 100644 index f9f55273eb9..00000000000 --- a/samples/client/petstore/go-experimental/store_api_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "context" - "regexp" - "testing" - "time" - - sw "./go-petstore" -) - -func TestPlaceOrder(t *testing.T) { - newOrder := sw.Order{ - Id: sw.PtrInt64(0), - PetId: sw.PtrInt64(0), - Quantity: sw.PtrInt32(0), - ShipDate: sw.PtrTime(time.Now().UTC()), - Status: sw.PtrString("placed"), - Complete: sw.PtrBool(false)} - - _, r, err := client.StoreApi.PlaceOrder(context.Background()).Body(newOrder).Execute() - - if err != nil { - // Skip parsing time error due to error in Petstore Test Server - // https://github.com/OpenAPITools/openapi-generator/issues/1292 - if regexp. - MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`). - MatchString(err.Error()) { - t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime") - } else { - t.Fatalf("Error while placing order: %v", err) - } - } - if r.StatusCode != 200 { - t.Log(r) - } -} diff --git a/samples/client/petstore/go-experimental/test.go.bak b/samples/client/petstore/go-experimental/test.go.bak deleted file mode 100644 index 54e14b9c7a0..00000000000 --- a/samples/client/petstore/go-experimental/test.go.bak +++ /dev/null @@ -1,30 +0,0 @@ -package main - -import ( - sw "./go-petstore" - "encoding/json" - "fmt" -) - -func main() { - - s := sw.NewPetApi() - - // test POST(body) - newPet := (sw.Pet{Id: 12830, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}) - - jsonNewPet, _ := json.Marshal(newPet) - fmt.Println("newPet:", string(jsonNewPet)) - s.AddPet(newPet) - - // test POST(form) - s.UpdatePetWithForm(12830, "golang", "available") - - // test GET - resp, apiResponse, err := s.GetPetById(12830) - fmt.Println("GetPetById: ", resp, err, apiResponse) - - err2, apiResponse2 := s.DeletePet(12830, "") - fmt.Println("DeletePet: ", err2, apiResponse2) -} diff --git a/samples/client/petstore/go-experimental/testfiles/foo.png b/samples/client/petstore/go-experimental/testfiles/foo.png deleted file mode 100644 index a9b12cf5927..00000000000 Binary files a/samples/client/petstore/go-experimental/testfiles/foo.png and /dev/null differ diff --git a/samples/client/petstore/go-experimental/user_api_test.go b/samples/client/petstore/go-experimental/user_api_test.go deleted file mode 100644 index 361e77ac9aa..00000000000 --- a/samples/client/petstore/go-experimental/user_api_test.go +++ /dev/null @@ -1,156 +0,0 @@ -package main - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - - sw "./go-petstore" -) - -func TestCreateUser(t *testing.T) { - newUser := sw.User{ - Id: sw.PtrInt64(1000), - FirstName: sw.PtrString("gopher"), - LastName: sw.PtrString("lang"), - Username: sw.PtrString("gopher"), - Password: sw.PtrString("lang"), - Email: sw.PtrString("lang@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1)} - - apiResponse, err := client.UserApi.CreateUser(context.Background()).Body(newUser).Execute() - - if err != nil { - t.Fatalf("Error while adding user: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} - -//adding x to skip the test, currently it is failing -func TestCreateUsersWithArrayInput(t *testing.T) { - newUsers := []sw.User{ - sw.User{ - Id: sw.PtrInt64(1001), - FirstName: sw.PtrString("gopher1"), - LastName: sw.PtrString("lang1"), - Username: sw.PtrString("gopher1"), - Password: sw.PtrString("lang1"), - Email: sw.PtrString("lang1@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1), - }, - sw.User{ - Id: sw.PtrInt64(1002), - FirstName: sw.PtrString("gopher2"), - LastName: sw.PtrString("lang2"), - Username: sw.PtrString("gopher2"), - Password: sw.PtrString("lang2"), - Email: sw.PtrString("lang2@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1), - }, - } - - apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).Body(newUsers).Execute() - if err != nil { - t.Fatalf("Error while adding users: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -/* issue deleting users due to issue in the server side (500). commented out below for the time being - //tear down - _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() - if err1 != nil { - t.Errorf("Error while deleting user") - t.Log(err1) - } - - _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2").Execute() - if err2 != nil { - t.Errorf("Error while deleting user") - t.Log(err2) - } -*/ -} - -func TestGetUserByName(t *testing.T) { - assert := assert.New(t) - - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { - t.Fatalf("Error while getting user by id: %v", err) - } else { - assert.Equal(*resp.Id, int64(1000), "User id should be equal") - assert.Equal(*resp.Username, "gopher", "User name should be gopher") - assert.Equal(*resp.LastName, "lang", "Last name should be lang") - //t.Log(resp) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} - -func TestGetUserByNameWithInvalidID(t *testing.T) { - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() - if apiResponse != nil && apiResponse.StatusCode == 404 { - return // This is a pass condition. API will return with a 404 error. - } else if err != nil { - t.Fatalf("Error while getting user by invalid id: %v", err) - t.Log(apiResponse) - } else { - t.Log(resp) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} - -func TestUpdateUser(t *testing.T) { - assert := assert.New(t) - - newUser := sw.User{ - Id: sw.PtrInt64(1000), - FirstName: sw.PtrString("gopher20"), - LastName: sw.PtrString("lang20"), - Username: sw.PtrString("gopher"), - Password: sw.PtrString("lang"), - Email: sw.PtrString("lang@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1)} - - apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").Body(newUser).Execute() - if err != nil { - t.Fatalf("Error while deleting user by id: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } - - //verify changings are correct - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { - t.Fatalf("Error while getting user by id: %v", err) - } else { - assert.Equal(*resp.Id, int64(1000), "User id should be equal") - assert.Equal(*resp.FirstName, "gopher20", "User name should be gopher") - assert.Equal(*resp.Password, "lang", "User name should be the same") - } -} - -/* issue deleting users due to issue in the server side (500). commented out below for the time being -func TestDeleteUser(t *testing.T) { - apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() - - if err != nil { - t.Fatalf("Error while deleting user: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} -*/ diff --git a/samples/client/petstore/go/.gitignore b/samples/client/petstore/go/.gitignore deleted file mode 100644 index daf913b1b34..00000000000 --- a/samples/client/petstore/go/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/samples/client/petstore/go/auth_test.go b/samples/client/petstore/go/auth_test.go index 5f817703a88..0e532aeff3a 100644 --- a/samples/client/petstore/go/auth_test.go +++ b/samples/client/petstore/go/auth_test.go @@ -37,10 +37,11 @@ func TestOAuth2(t *testing.T) { tokenSource := cfg.TokenSource(createContext(nil), &tok) auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -49,7 +50,7 @@ func TestOAuth2(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -71,10 +72,11 @@ func TestBasicAuth(t *testing.T) { Password: "f4k3p455", }) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(auth, newPet) + r, err := client.PetApi.AddPet(auth).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -83,7 +85,7 @@ func TestBasicAuth(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -100,10 +102,11 @@ func TestBasicAuth(t *testing.T) { func TestAccessToken(t *testing.T) { auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(nil, newPet) + r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -112,7 +115,7 @@ func TestAccessToken(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -127,12 +130,13 @@ func TestAccessToken(t *testing.T) { } func TestAPIKeyNoPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123"}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -141,7 +145,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { t.Log(r) } - _, r, err = client.PetApi.GetPetById(auth, 12992) + _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -151,7 +155,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { t.Errorf("APIKey Authentication is missing") } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -161,12 +165,13 @@ func TestAPIKeyNoPrefix(t *testing.T) { } func TestAPIKeyWithPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123", Prefix: "Bearer"}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(nil, newPet) + r, err := client.PetApi.AddPet(nil).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -175,7 +180,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { t.Log(r) } - _, r, err = client.PetApi.GetPetById(auth, 12992) + _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -185,7 +190,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { t.Errorf("APIKey Authentication is missing") } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -195,11 +200,11 @@ func TestAPIKeyWithPrefix(t *testing.T) { } func TestDefaultHeader(t *testing.T) { + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) - - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -208,7 +213,7 @@ func TestDefaultHeader(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(context.Background(), 12992, nil) + r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -223,7 +228,7 @@ func TestDefaultHeader(t *testing.T) { } func TestHostOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() if err != nil { t.Fatalf("Error while finding pets by status: %v", err) @@ -235,7 +240,7 @@ func TestHostOverride(t *testing.T) { } func TestSchemeOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() if err != nil { t.Fatalf("Error while finding pets by status: %v", err) diff --git a/samples/client/petstore/go/fake_api_test.go b/samples/client/petstore/go/fake_api_test.go index f4242b5048c..d27137eeacf 100644 --- a/samples/client/petstore/go/fake_api_test.go +++ b/samples/client/petstore/go/fake_api_test.go @@ -1,10 +1,10 @@ package main import ( + "context" "testing" sw "./go-petstore" - "golang.org/x/net/context" ) // TestPutBodyWithFileSchema ensures a model with the name 'File' @@ -14,10 +14,10 @@ func TestPutBodyWithFileSchema(t *testing.T) { return // early return to test compilation schema := sw.FileSchemaTestClass{ - File: sw.File{SourceURI: "https://example.com/image.png"}, - Files: []sw.File{{SourceURI: "https://example.com/image.png"}}} + File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, + Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} - r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema) + r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).Body(schema).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) diff --git a/samples/client/petstore/go/git_push.sh b/samples/client/petstore/go/git_push.sh deleted file mode 100644 index 1a36388db02..00000000000 --- a/samples/client/petstore/go/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="YOUR_GIT_USR_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="YOUR_GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/go/go-petstore-withXml/.gitignore b/samples/client/petstore/go/go-petstore-withXml/.gitignore deleted file mode 100644 index daf913b1b34..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator-ignore b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES deleted file mode 100644 index 28a8ffd70f1..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES +++ /dev/null @@ -1,118 +0,0 @@ -.gitignore -.travis.yml -README.md -api/openapi.yaml -api_another_fake.go -api_fake.go -api_fake_classname_tags123.go -api_pet.go -api_store.go -api_user.go -client.go -configuration.go -docs/AdditionalPropertiesAnyType.md -docs/AdditionalPropertiesArray.md -docs/AdditionalPropertiesBoolean.md -docs/AdditionalPropertiesClass.md -docs/AdditionalPropertiesInteger.md -docs/AdditionalPropertiesNumber.md -docs/AdditionalPropertiesObject.md -docs/AdditionalPropertiesString.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/BigCat.md -docs/BigCatAllOf.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/FormatTest.md -docs/HasOnlyReadOnly.md -docs/List.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/Name.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/Return.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/TypeHolderDefault.md -docs/TypeHolderExample.md -docs/User.md -docs/UserApi.md -docs/XmlItem.md -git_push.sh -go.mod -go.sum -model_200_response.go -model_additional_properties_any_type.go -model_additional_properties_array.go -model_additional_properties_boolean.go -model_additional_properties_class.go -model_additional_properties_integer.go -model_additional_properties_number.go -model_additional_properties_object.go -model_additional_properties_string.go -model_animal.go -model_api_response.go -model_array_of_array_of_number_only.go -model_array_of_number_only.go -model_array_test_.go -model_big_cat.go -model_big_cat_all_of.go -model_capitalization.go -model_cat.go -model_cat_all_of.go -model_category.go -model_class_model.go -model_client.go -model_dog.go -model_dog_all_of.go -model_enum_arrays.go -model_enum_class.go -model_enum_test_.go -model_file.go -model_file_schema_test_class.go -model_format_test_.go -model_has_only_read_only.go -model_list.go -model_map_test_.go -model_mixed_properties_and_additional_properties_class.go -model_name.go -model_number_only.go -model_order.go -model_outer_composite.go -model_outer_enum.go -model_pet.go -model_read_only_first.go -model_return.go -model_special_model_name.go -model_tag.go -model_type_holder_default.go -model_type_holder_example.go -model_user.go -model_xml_item.go -response.go diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/.travis.yml b/samples/client/petstore/go/go-petstore-withXml/.travis.yml deleted file mode 100644 index f5cb2ce9a5a..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ - diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md deleted file mode 100644 index 611d9e5d5d4..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# Go API client for petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -go get github.com/antihax/optional -``` - -Put the package under your project folder and add the following in import: - -```golang -import "./petstore" -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags -*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **Post** /fake/create_xml_item | creates an XmlItem -*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | -*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | -*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | -*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string | -*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **Put** /fake/body-with-file-schema | -*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **Put** /fake/body-with-query-params | -*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters -*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | -*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case -*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet -*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID -*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user -*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name -*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [BigCat](docs/BigCat.md) - - [BigCatAllOf](docs/BigCatAllOf.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - [XmlItem](docs/XmlItem.md) - - -## Documentation For Authorization - - - -## api_key - -- **Type**: API key - -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAPIKey, petstore.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` - - -## api_key_query - -- **Type**: API key - -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAPIKey, petstore.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` - - -## http_basic_test - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - - -## petstore_auth - - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, petstore.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - - - -## Author - - - diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml deleted file mode 100644 index 2fe0565e0a5..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ /dev/null @@ -1,2128 +0,0 @@ -openapi: 3.0.1 -info: - description: 'This spec is mainly for testing Petstore server and contains fake - endpoints, models. Please do not use this for any other purpose. Special characters: - " \' - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - post: - operationId: addPet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - put: - operationId: updatePet - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - /pet/findByTags: - get: - deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Find purchase order by ID - tags: - - store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Get user by user name - tags: - - user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Someting wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: {} - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet -components: - schemas: - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - uniqueItems: true - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 1E+2 - minimum: 1E+1 - type: integer - int32: - format: int32 - maximum: 2E+2 - minimum: 2E+1 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - BigDecimal: - format: number - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - type: string - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go deleted file mode 100644 index fa9845ac61b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ /dev/null @@ -1,122 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - _bytes "bytes" -) - -// Linger please -var ( - _ _context.Context -) - -type AnotherFakeApi interface { - - /* - * Call123TestSpecialTags To test special tags - * - * To test special tags and operation ID starting with number - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model - * @return Client - */ - Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) -} - -// AnotherFakeApiService AnotherFakeApi service -type AnotherFakeApiService service - -/* - * Call123TestSpecialTags To test special tags - * - * To test special tags and operation ID starting with number - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model - * @return Client - */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go deleted file mode 100644 index afc6908431b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ /dev/null @@ -1,1448 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - _bytes "bytes" - "github.com/antihax/optional" - "os" - "reflect" -) - -// Linger please -var ( - _ _context.Context -) - -type FakeApi interface { - - /* - * CreateXmlItem creates an XmlItem - * - * this route creates an XmlItem - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param xmlItem XmlItem Body - */ - CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) - - /* - * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * - * Test serialization of outer boolean types - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: - * @param "Body" (optional.Bool) - Input boolean as post body - * @return bool - */ - FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) - - /* - * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * - * Test serialization of object with outer number type - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: - * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body - * @return OuterComposite - */ - FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) - - /* - * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * - * Test serialization of outer number types - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: - * @param "Body" (optional.Float32) - Input number as post body - * @return float32 - */ - FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) - - /* - * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * - * Test serialization of outer string types - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: - * @param "Body" (optional.String) - Input string as post body - * @return string - */ - FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) - - /* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * - * For this test, the body for this request much reference a schema named `File`. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body - */ - TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) - - /* - * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param query - * @param body - */ - TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) - - /* - * TestClientModel To test \"client\" model - * - * To test \"client\" model - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model - * @return Client - */ - TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) - - /* - * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param number None - * @param double None - * @param patternWithoutDelimiter None - * @param byte_ None - * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: - * @param "Integer" (optional.Int32) - None - * @param "Int32_" (optional.Int32) - None - * @param "Int64_" (optional.Int64) - None - * @param "Float" (optional.Float32) - None - * @param "String_" (optional.String) - None - * @param "Binary" (optional.Interface of *os.File) - None - * @param "Date" (optional.String) - None - * @param "DateTime" (optional.Time) - None - * @param "Password" (optional.String) - None - * @param "Callback" (optional.String) - None - */ - TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) - - /* - * TestEnumParameters To test enum parameters - * - * To test enum parameters - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *TestEnumParametersOpts - Optional Parameters: - * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) - * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) - * @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array) - * @param "EnumQueryString" (optional.String) - Query parameter enum test (string) - * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) - * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) - * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) - * @param "EnumFormString" (optional.String) - Form parameter enum test (string) - */ - TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) - - /* - * TestGroupParameters Fake endpoint to test group parameters (optional) - * - * Fake endpoint to test group parameters (optional) - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requiredStringGroup Required String in group parameters - * @param requiredBooleanGroup Required Boolean in group parameters - * @param requiredInt64Group Required Integer in group parameters - * @param optional nil or *TestGroupParametersOpts - Optional Parameters: - * @param "StringGroup" (optional.Int32) - String in group parameters - * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters - * @param "Int64Group" (optional.Int64) - Integer in group parameters - */ - TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) - - /* - * TestInlineAdditionalProperties test inline additionalProperties - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param request body - */ - TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) - - /* - * TestJsonFormData test json serialization of form data - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param field1 - * @param param2 field2 - */ - TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) - - /* - * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * - * To test the collection format in query parameters - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pipe - * @param ioutil - * @param http - * @param url - * @param context - */ - TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) -} - -// FakeApiService FakeApi service -type FakeApiService service - -/* - * CreateXmlItem creates an XmlItem - * - * this route creates an XmlItem - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param xmlItem XmlItem Body - */ -func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &xmlItem - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool -} - -/* - * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * - * Test serialization of outer boolean types - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: - * @param "Body" (optional.Bool) - Input boolean as post body - * @return bool - */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue bool - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' -type FakeOuterCompositeSerializeOpts struct { - Body optional.Interface -} - -/* - * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * - * Test serialization of object with outer number type - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: - * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body - * @return OuterComposite - */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OuterComposite - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(OuterComposite) - if !localVarOptionalBodyok { - return localVarReturnValue, nil, reportError("body should be OuterComposite") - } - localVarPostBody = &localVarOptionalBody - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 -} - -/* - * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * - * Test serialization of outer number types - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: - * @param "Body" (optional.Float32) - Input number as post body - * @return float32 - */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue float32 - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/number" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' -type FakeOuterStringSerializeOpts struct { - Body optional.String -} - -/* - * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * - * Test serialization of outer string types - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: - * @param "Body" (optional.String) - Input string as post body - * @return string - */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/string" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * - * For this test, the body for this request much reference a schema named `File`. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body - */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param query - * @param body - */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("query", parameterToString(query, "")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * TestClientModel To test \"client\" model - * - * To test \"client\" model - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model - * @return Client - */ -func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String -} - -/* - * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param number None - * @param double None - * @param patternWithoutDelimiter None - * @param byte_ None - * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: - * @param "Integer" (optional.Int32) - None - * @param "Int32_" (optional.Int32) - None - * @param "Int64_" (optional.Int64) - None - * @param "Float" (optional.Float32) - None - * @param "String_" (optional.String) - None - * @param "Binary" (optional.Interface of *os.File) - None - * @param "Date" (optional.String) - None - * @param "DateTime" (optional.Time) - None - * @param "Password" (optional.String) - None - * @param "Callback" (optional.String) - None - */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if number < 32.1 { - return nil, reportError("number must be greater than 32.1") - } - if number > 543.2 { - return nil, reportError("number must be less than 543.2") - } - if double < 67.8 { - return nil, reportError("double must be greater than 67.8") - } - if double > 123.4 { - return nil, reportError("double must be less than 123.4") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { - localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Int32_.IsSet() { - localVarFormParams.Add("int32", parameterToString(localVarOptionals.Int32_.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Int64_.IsSet() { - localVarFormParams.Add("int64", parameterToString(localVarOptionals.Int64_.Value(), "")) - } - localVarFormParams.Add("number", parameterToString(number, "")) - if localVarOptionals != nil && localVarOptionals.Float.IsSet() { - localVarFormParams.Add("float", parameterToString(localVarOptionals.Float.Value(), "")) - } - localVarFormParams.Add("double", parameterToString(double, "")) - if localVarOptionals != nil && localVarOptionals.String_.IsSet() { - localVarFormParams.Add("string", parameterToString(localVarOptionals.String_.Value(), "")) - } - localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, "")) - localVarFormParams.Add("byte", parameterToString(byte_, "")) - localVarFormFileName = "binary" - var localVarFile *os.File - if localVarOptionals != nil && localVarOptionals.Binary.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.Binary.Value().(*os.File) - if !localVarFileOk { - return nil, reportError("binary should be *os.File") - } - } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - if localVarOptionals != nil && localVarOptionals.Date.IsSet() { - localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { - localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Password.IsSet() { - localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { - localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String -} - -/* - * TestEnumParameters To test enum parameters - * - * To test enum parameters - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *TestEnumParametersOpts - Optional Parameters: - * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) - * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) - * @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array) - * @param "EnumQueryString" (optional.String) - Query parameter enum test (string) - * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) - * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) - * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) - * @param "EnumFormString" (optional.String) - Form parameter enum test (string) - */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { - localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv")) - } - if localVarOptionals != nil && localVarOptionals.EnumQueryString.IsSet() { - localVarQueryParams.Add("enum_query_string", parameterToString(localVarOptionals.EnumQueryString.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.EnumQueryInteger.IsSet() { - localVarQueryParams.Add("enum_query_integer", parameterToString(localVarOptionals.EnumQueryInteger.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.EnumQueryDouble.IsSet() { - localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { - localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") - } - if localVarOptionals != nil && localVarOptionals.EnumHeaderString.IsSet() { - localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "") - } - if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() { - localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "csv")) - } - if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { - localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 -} - -/* - * TestGroupParameters Fake endpoint to test group parameters (optional) - * - * Fake endpoint to test group parameters (optional) - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requiredStringGroup Required String in group parameters - * @param requiredBooleanGroup Required Boolean in group parameters - * @param requiredInt64Group Required Integer in group parameters - * @param optional nil or *TestGroupParametersOpts - Optional Parameters: - * @param "StringGroup" (optional.Int32) - String in group parameters - * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters - * @param "Int64Group" (optional.Int64) - Integer in group parameters - */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) - localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) - if localVarOptionals != nil && localVarOptionals.StringGroup.IsSet() { - localVarQueryParams.Add("string_group", parameterToString(localVarOptionals.StringGroup.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Int64Group.IsSet() { - localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") - if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { - localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * TestInlineAdditionalProperties test inline additionalProperties - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param request body - */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = ¶m - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * TestJsonFormData test json serialization of form data - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param field1 - * @param param2 field2 - */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - localVarFormParams.Add("param", parameterToString(param, "")) - localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * - * To test the collection format in query parameters - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pipe - * @param ioutil - * @param http - * @param url - * @param context - */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) - localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) - localVarQueryParams.Add("url", parameterToString(url, "csv")) - { - t:=context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) - } - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go deleted file mode 100644 index 2125090eeba..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ /dev/null @@ -1,134 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - _bytes "bytes" -) - -// Linger please -var ( - _ _context.Context -) - -type FakeClassnameTags123Api interface { - - /* - * TestClassname To test class name in snake case - * - * To test class name in snake case - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model - * @return Client - */ - TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) -} - -// FakeClassnameTags123ApiService FakeClassnameTags123Api service -type FakeClassnameTags123ApiService service - -/* - * TestClassname To test class name in snake case - * - * To test class name in snake case - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model - * @return Client - */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake_classname_test" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &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 - } - localVarQueryParams.Add("api_key_query", key) - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go deleted file mode 100644 index e10c2a4db46..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ /dev/null @@ -1,881 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - _bytes "bytes" - "strings" - "github.com/antihax/optional" - "os" -) - -// Linger please -var ( - _ _context.Context -) - -type PetApi interface { - - /* - * AddPet Add a new pet to the store - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Pet object that needs to be added to the store - */ - AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) - - /* - * DeletePet Deletes a pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId Pet id to delete - * @param optional nil or *DeletePetOpts - Optional Parameters: - * @param "ApiKey" (optional.String) - - */ - DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) - - /* - * FindPetsByStatus Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param status Status values that need to be considered for filter - * @return []Pet - */ - FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) - - /* - * FindPetsByTags Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tags Tags to filter by - * @return []Pet - */ - FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) - - /* - * GetPetById Find pet by ID - * - * Returns a single pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to return - * @return Pet - */ - GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) - - /* - * UpdatePet Update an existing pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Pet object that needs to be added to the store - */ - UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) - - /* - * UpdatePetWithForm Updates a pet in the store with form data - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet that needs to be updated - * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: - * @param "Name" (optional.String) - Updated name of the pet - * @param "Status" (optional.String) - Updated status of the pet - */ - UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) - - /* - * UploadFile uploads an image - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @param optional nil or *UploadFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server - * @param "File" (optional.Interface of *os.File) - file to upload - * @return ApiResponse - */ - UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) - - /* - * UploadFileWithRequiredFile uploads an image (required) - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @param requiredFile file to upload - * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server - * @return ApiResponse - */ - UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) -} - -// PetApiService PetApi service -type PetApiService service - -/* - * AddPet Add a new pet to the store - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Pet object that needs to be added to the store - */ -func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// DeletePetOpts Optional parameters for the method 'DeletePet' -type DeletePetOpts struct { - ApiKey optional.String -} - -/* - * DeletePet Deletes a pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId Pet id to delete - * @param optional nil or *DeletePetOpts - Optional Parameters: - * @param "ApiKey" (optional.String) - - */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { - localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * FindPetsByStatus Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param status Status values that need to be considered for filter - * @return []Pet - */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Pet - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("status", parameterToString(status, "csv")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * FindPetsByTags Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tags Tags to filter by - * @return []Pet - */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Pet - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/findByTags" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("tags", parameterToString(tags, "csv")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * GetPetById Find pet by ID - * - * Returns a single pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to return - * @return Pet - */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Pet - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // 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["api_key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * UpdatePet Update an existing pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Pet object that needs to be added to the store - */ -func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String -} - -/* - * UpdatePetWithForm Updates a pet in the store with form data - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet that needs to be updated - * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: - * @param "Name" (optional.String) - Updated name of the pet - * @param "Status" (optional.String) - Updated status of the pet - */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.Name.IsSet() { - localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.Status.IsSet() { - localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -// UploadFileOpts Optional parameters for the method 'UploadFile' -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface -} - -/* - * UploadFile uploads an image - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @param optional nil or *UploadFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server - * @param "File" (optional.Interface of *os.File) - file to upload - * @return ApiResponse - */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApiResponse - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { - localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) - } - localVarFormFileName = "file" - var localVarFile *os.File - if localVarOptionals != nil && localVarOptionals.File.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) - if !localVarFileOk { - return localVarReturnValue, nil, reportError("file should be *os.File") - } - } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String -} - -/* - * UploadFileWithRequiredFile uploads an image (required) - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @param requiredFile file to upload - * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server - * @return ApiResponse - */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApiResponse - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { - localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) - } - localVarFormFileName = "requiredFile" - localVarFile := requiredFile - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go deleted file mode 100644 index 9064808b3da..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ /dev/null @@ -1,397 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - _bytes "bytes" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -type StoreApi interface { - - /* - * DeleteOrder Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of the order that needs to be deleted - */ - DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) - - /* - * GetInventory Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return map[string]int32 - */ - GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) - - /* - * GetOrderById Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) - - /* - * PlaceOrder Place an order for a pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body order placed for purchasing the pet - * @return Order - */ - PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) -} - -// StoreApiService StoreApi service -type StoreApiService service - -/* - * DeleteOrder Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of the order that needs to be deleted - */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(orderId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * GetInventory Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return map[string]int32 - */ -func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue map[string]int32 - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/inventory" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - 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["api_key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * GetOrderById Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of pet that needs to be fetched - * @return Order - */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Order - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(orderId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if orderId < 1 { - return localVarReturnValue, nil, reportError("orderId must be greater than 1") - } - if orderId > 5 { - return localVarReturnValue, nil, reportError("orderId must be less than 5") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * PlaceOrder Place an order for a pet - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body order placed for purchasing the pet - * @return Order - */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Order - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go deleted file mode 100644 index d5589f3d0ea..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ /dev/null @@ -1,677 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - _bytes "bytes" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -type UserApi interface { - - /* - * CreateUser Create user - * - * This can only be done by the logged in user. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Created user object - */ - CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) - - /* - * CreateUsersWithArrayInput Creates list of users with given input array - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body List of user object - */ - CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) - - /* - * CreateUsersWithListInput Creates list of users with given input array - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body List of user object - */ - CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) - - /* - * DeleteUser Delete user - * - * This can only be done by the logged in user. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be deleted - */ - DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) - - /* - * GetUserByName Get user by user name - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) - - /* - * LoginUser Logs user into the system - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The user name for login - * @param password The password for login in clear text - * @return string - */ - LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) - - /* - * LogoutUser Logs out current logged in user session - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - */ - LogoutUser(ctx _context.Context) (*_nethttp.Response, error) - - /* - * UpdateUser Updated user - * - * This can only be done by the logged in user. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username name that need to be deleted - * @param body Updated user object - */ - UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) -} - -// UserApiService UserApi service -type UserApiService service - -/* - * CreateUser Create user - * - * This can only be done by the logged in user. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Created user object - */ -func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * CreateUsersWithArrayInput Creates list of users with given input array - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body List of user object - */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/createWithArray" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * CreateUsersWithListInput Creates list of users with given input array - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body List of user object - */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/createWithList" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * DeleteUser Delete user - * - * This can only be done by the logged in user. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be deleted - */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * GetUserByName Get user by user name - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * LoginUser Logs user into the system - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The user name for login - * @param password The password for login in clear text - * @return string - */ -func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/login" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("username", parameterToString(username, "")) - localVarQueryParams.Add("password", parameterToString(password, "")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, 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() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -/* - * LogoutUser Logs out current logged in user session - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - */ -func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/logout" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* - * UpdateUser Updated user - * - * This can only be done by the logged in user. - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username name that need to be deleted - * @param body Updated user object - */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go deleted file mode 100644 index 5742286abc0..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ /dev/null @@ -1,558 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "io/ioutil" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "golang.org/x/oauth2" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) -) - -// APIClient manages communication with the OpenAPI Petstore API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - AnotherFakeApi AnotherFakeApi - - FakeApi FakeApi - - FakeClassnameTags123Api FakeClassnameTags123Api - - PetApi PetApi - - StoreApi StoreApi - - UserApi UserApi -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) - c.FakeApi = (*FakeApiService)(&c.common) - c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) - c.PetApi = (*PetApiService)(&c.common) - c.StoreApi = (*StoreApiService)(&c.common) - c.UserApi = (*UserApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) - } - - return fmt.Sprintf("%v", obj) -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - - return resp, err -} - -// ChangeBasePath changes base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - _, err = (*f).Seek(0, io.SeekStart) - return - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if err = json.Unmarshal(b, v); err != nil { - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index eadec3142ce..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesAnyType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesArray.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesArray.md deleted file mode 100644 index 0c37598aeb2..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesArray - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index 7190fe8429b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesBoolean - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesClass.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 0dd3f328f41..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# AdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MapString** | **map[string]string** | | [optional] -**MapNumber** | **map[string]float32** | | [optional] -**MapInteger** | **map[string]int32** | | [optional] -**MapBoolean** | **map[string]bool** | | [optional] -**MapArrayInteger** | [**map[string][]int32**](array.md) | | [optional] -**MapArrayAnytype** | [**map[string][]map[string]interface{}**](array.md) | | [optional] -**MapMapString** | [**map[string]map[string]string**](map.md) | | [optional] -**MapMapAnytype** | [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] -**Anytype1** | **map[string]interface{}** | | [optional] -**Anytype2** | **map[string]interface{}** | | [optional] -**Anytype3** | **map[string]interface{}** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 34e6fca8fb0..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesInteger - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 6d41fd2315c..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesNumber - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesObject.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesObject.md deleted file mode 100644 index b856de693b1..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesString.md b/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesString.md deleted file mode 100644 index 69ad2065685..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesString - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Animal.md b/samples/client/petstore/go/go-petstore-withXml/docs/Animal.md deleted file mode 100644 index 02d23377da6..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Animal.md +++ /dev/null @@ -1,12 +0,0 @@ -# Animal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/AnotherFakeApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/AnotherFakeApi.md deleted file mode 100644 index 2c22f8f1b30..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/AnotherFakeApi.md +++ /dev/null @@ -1,43 +0,0 @@ -# \AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**Call123TestSpecialTags**](AnotherFakeApi.md#Call123TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags - - - -## Call123TestSpecialTags - -> Client Call123TestSpecialTags(ctx, body) - -To test special tags - -To test special tags and operation ID starting with number - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/ApiResponse.md b/samples/client/petstore/go/go-petstore-withXml/docs/ApiResponse.md deleted file mode 100644 index 41d28fb578c..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/ApiResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **int32** | | [optional] -**Type** | **string** | | [optional] -**Message** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/go/go-petstore-withXml/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 555213013b2..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayArrayNumber** | [**[][]float32**](array.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/ArrayOfNumberOnly.md b/samples/client/petstore/go/go-petstore-withXml/docs/ArrayOfNumberOnly.md deleted file mode 100644 index 56618756dd7..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# ArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayNumber** | **[]float32** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/ArrayTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/ArrayTest.md deleted file mode 100644 index 0da0bc52d2d..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/ArrayTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# ArrayTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayOfString** | **[]string** | | [optional] -**ArrayArrayOfInteger** | [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | [**[][]ReadOnlyFirst**](array.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md b/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md deleted file mode 100644 index a23cd724fb9..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/BigCat.md +++ /dev/null @@ -1,14 +0,0 @@ -# BigCat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Declawed** | **bool** | | [optional] -**Kind** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md b/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md deleted file mode 100644 index 03d37ee1031..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/BigCatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# BigCatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Kind** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Capitalization.md b/samples/client/petstore/go/go-petstore-withXml/docs/Capitalization.md deleted file mode 100644 index 426b8eabd9b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Capitalization.md +++ /dev/null @@ -1,16 +0,0 @@ -# Capitalization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SmallCamel** | **string** | | [optional] -**CapitalCamel** | **string** | | [optional] -**SmallSnake** | **string** | | [optional] -**CapitalSnake** | **string** | | [optional] -**SCAETHFlowPoints** | **string** | | [optional] -**ATT_NAME** | **string** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Cat.md b/samples/client/petstore/go/go-petstore-withXml/docs/Cat.md deleted file mode 100644 index 1ef1f095e94..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Cat.md +++ /dev/null @@ -1,13 +0,0 @@ -# Cat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/CatAllOf.md b/samples/client/petstore/go/go-petstore-withXml/docs/CatAllOf.md deleted file mode 100644 index c978cee0417..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/CatAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# CatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Category.md b/samples/client/petstore/go/go-petstore-withXml/docs/Category.md deleted file mode 100644 index 01e8344bd06..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Category.md +++ /dev/null @@ -1,12 +0,0 @@ -# Category - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Name** | **string** | | [default to default-name] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/ClassModel.md b/samples/client/petstore/go/go-petstore-withXml/docs/ClassModel.md deleted file mode 100644 index 0b925cebb1f..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/ClassModel.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClassModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Class** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Client.md b/samples/client/petstore/go/go-petstore-withXml/docs/Client.md deleted file mode 100644 index 551da852eec..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Client.md +++ /dev/null @@ -1,11 +0,0 @@ -# Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Client** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Dog.md b/samples/client/petstore/go/go-petstore-withXml/docs/Dog.md deleted file mode 100644 index ff35dd5cdca..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Dog.md +++ /dev/null @@ -1,13 +0,0 @@ -# Dog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Breed** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/DogAllOf.md b/samples/client/petstore/go/go-petstore-withXml/docs/DogAllOf.md deleted file mode 100644 index b87153e9265..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/DogAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# DogAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Breed** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/EnumArrays.md b/samples/client/petstore/go/go-petstore-withXml/docs/EnumArrays.md deleted file mode 100644 index 3021f881830..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/EnumArrays.md +++ /dev/null @@ -1,12 +0,0 @@ -# EnumArrays - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JustSymbol** | **string** | | [optional] -**ArrayEnum** | **[]string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/EnumClass.md b/samples/client/petstore/go/go-petstore-withXml/docs/EnumClass.md deleted file mode 100644 index c6932388c06..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnumClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md deleted file mode 100644 index eeec09b66b4..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/EnumTest.md +++ /dev/null @@ -1,15 +0,0 @@ -# EnumTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EnumString** | **string** | | [optional] -**EnumStringRequired** | **string** | | -**EnumInteger** | **int32** | | [optional] -**EnumNumber** | **float64** | | [optional] -**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md deleted file mode 100644 index 6ba47e807f3..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md +++ /dev/null @@ -1,593 +0,0 @@ -# \FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateXmlItem**](FakeApi.md#CreateXmlItem) | **Post** /fake/create_xml_item | creates an XmlItem -[**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | -[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | -[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | -[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string | -[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema | -[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params | -[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters -[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) -[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data -[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | - - - -## CreateXmlItem - -> CreateXmlItem(ctx, xmlItem) - -creates an XmlItem - -this route creates an XmlItem - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterBooleanSerialize - -> bool FakeOuterBooleanSerialize(ctx, optional) - - - -Test serialization of outer boolean types - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.Bool**| Input boolean as post body | - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterCompositeSerialize - -> OuterComposite FakeOuterCompositeSerialize(ctx, optional) - - - -Test serialization of object with outer number type - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body | - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterNumberSerialize - -> float32 FakeOuterNumberSerialize(ctx, optional) - - - -Test serialization of outer number types - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.Float32**| Input number as post body | - -### Return type - -**float32** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterStringSerialize - -> string FakeOuterStringSerialize(ctx, optional) - - - -Test serialization of outer string types - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.String**| Input string as post body | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestBodyWithFileSchema - -> TestBodyWithFileSchema(ctx, body) - - - -For this test, the body for this request much reference a schema named `File`. - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestBodyWithQueryParams - -> TestBodyWithQueryParams(ctx, query, body) - - - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**query** | **string**| | -**body** | [**User**](User.md)| | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestClientModel - -> Client TestClientModel(ctx, body) - -To test \"client\" model - -To test \"client\" model - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestEndpointParameters - -> TestEndpointParameters(ctx, number, double, patternWithoutDelimiter, byte_, optional) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**number** | **float32**| None | -**double** | **float64**| None | -**patternWithoutDelimiter** | **string**| None | -**byte_** | **string**| None | - **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - - **integer** | **optional.Int32**| None | - **int32_** | **optional.Int32**| None | - **int64_** | **optional.Int64**| None | - **float** | **optional.Float32**| None | - **string_** | **optional.String**| None | - **binary** | **optional.Interface of *os.File****optional.*os.File**| None | - **date** | **optional.String**| None | - **dateTime** | **optional.Time**| None | - **password** | **optional.String**| None | - **callback** | **optional.String**| None | - -### Return type - - (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestEnumParameters - -> TestEnumParameters(ctx, optional) - -To test enum parameters - -To test enum parameters - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestEnumParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**optional.Interface of []string**](string.md)| Header parameter enum test (string array) | - **enumHeaderString** | **optional.String**| Header parameter enum test (string) | [default to -efg] - **enumQueryStringArray** | [**optional.Interface of []string**](string.md)| Query parameter enum test (string array) | - **enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg] - **enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) | - **enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) | - **enumFormStringArray** | [**optional.Interface of []string**](string.md)| Form parameter enum test (string array) | [default to $] - **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestGroupParameters - -> TestGroupParameters(ctx, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, optional) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**requiredStringGroup** | **int32**| Required String in group parameters | -**requiredBooleanGroup** | **bool**| Required Boolean in group parameters | -**requiredInt64Group** | **int64**| Required Integer in group parameters | - **optional** | ***TestGroupParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestGroupParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **stringGroup** | **optional.Int32**| String in group parameters | - **booleanGroup** | **optional.Bool**| Boolean in group parameters | - **int64Group** | **optional.Int64**| Integer in group parameters | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestInlineAdditionalProperties - -> TestInlineAdditionalProperties(ctx, param) - -test inline additionalProperties - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**param** | [**map[string]string**](string.md)| request body | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestJsonFormData - -> TestJsonFormData(ctx, param, param2) - -test json serialization of form data - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**param** | **string**| field1 | -**param2** | **string**| field2 | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestQueryParameterCollectionFormat - -> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pipe** | [**[]string**](string.md)| | -**ioutil** | [**[]string**](string.md)| | -**http** | [**[]string**](string.md)| | -**url** | [**[]string**](string.md)| | -**context** | [**[]string**](string.md)| | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FakeClassnameTags123Api.md b/samples/client/petstore/go/go-petstore-withXml/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 224542b7051..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,43 +0,0 @@ -# \FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**TestClassname**](FakeClassnameTags123Api.md#TestClassname) | **Patch** /fake_classname_test | To test class name in snake case - - - -## TestClassname - -> Client TestClassname(ctx, body) - -To test class name in snake case - -To test class name in snake case - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/File.md b/samples/client/petstore/go/go-petstore-withXml/docs/File.md deleted file mode 100644 index a113b0312cd..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/File.md +++ /dev/null @@ -1,11 +0,0 @@ -# File - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SourceURI** | **string** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FileSchemaTestClass.md b/samples/client/petstore/go/go-petstore-withXml/docs/FileSchemaTestClass.md deleted file mode 100644 index ae51414dd6c..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# FileSchemaTestClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**File** | [**File**](File.md) | | [optional] -**Files** | [**[]File**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md deleted file mode 100644 index 4e8c3332b63..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# FormatTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Integer** | **int32** | | [optional] -**Int32** | **int32** | | [optional] -**Int64** | **int64** | | [optional] -**Number** | **float32** | | -**Float** | **float32** | | [optional] -**Double** | **float64** | | [optional] -**String** | **string** | | [optional] -**Byte** | **string** | | -**Binary** | [***os.File**](*os.File.md) | | [optional] -**Date** | **string** | | -**DateTime** | [**time.Time**](time.Time.md) | | [optional] -**Uuid** | **string** | | [optional] -**Password** | **string** | | -**BigDecimal** | **float64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/HasOnlyReadOnly.md b/samples/client/petstore/go/go-petstore-withXml/docs/HasOnlyReadOnly.md deleted file mode 100644 index 3b6ff48ab9f..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,12 +0,0 @@ -# HasOnlyReadOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [readonly] -**Foo** | **string** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/List.md b/samples/client/petstore/go/go-petstore-withXml/docs/List.md deleted file mode 100644 index bba2e529906..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/List.md +++ /dev/null @@ -1,11 +0,0 @@ -# List - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Var123List** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md b/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md deleted file mode 100644 index 6645e044658..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/MapTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# MapTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | **map[string]string** | | [optional] -**DirectMap** | **map[string]bool** | | [optional] -**IndirectMap** | **map[string]bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/go/go-petstore-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index a2ce1068b27..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Uuid** | **string** | | [optional] -**DateTime** | [**time.Time**](time.Time.md) | | [optional] -**Map** | [**map[string]Animal**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Model200Response.md b/samples/client/petstore/go/go-petstore-withXml/docs/Model200Response.md deleted file mode 100644 index 27b93bd1549..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Model200Response.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **int32** | | [optional] -**Class** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Name.md b/samples/client/petstore/go/go-petstore-withXml/docs/Name.md deleted file mode 100644 index 3e91109a16a..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Name.md +++ /dev/null @@ -1,14 +0,0 @@ -# Name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **int32** | | -**SnakeCase** | **int32** | | [optional] [readonly] -**Property** | **string** | | [optional] -**Var123Number** | **int32** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/NumberOnly.md b/samples/client/petstore/go/go-petstore-withXml/docs/NumberOnly.md deleted file mode 100644 index 604cf37eede..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/NumberOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# NumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JustNumber** | **float32** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Order.md b/samples/client/petstore/go/go-petstore-withXml/docs/Order.md deleted file mode 100644 index eeef0971005..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Order.md +++ /dev/null @@ -1,16 +0,0 @@ -# Order - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**PetId** | **int64** | | [optional] -**Quantity** | **int32** | | [optional] -**ShipDate** | [**time.Time**](time.Time.md) | | [optional] -**Status** | **string** | Order Status | [optional] -**Complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/OuterComposite.md b/samples/client/petstore/go/go-petstore-withXml/docs/OuterComposite.md deleted file mode 100644 index df9bce1bd90..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/OuterComposite.md +++ /dev/null @@ -1,13 +0,0 @@ -# OuterComposite - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MyNumber** | **float32** | | [optional] -**MyString** | **string** | | [optional] -**MyBoolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/OuterEnum.md b/samples/client/petstore/go/go-petstore-withXml/docs/OuterEnum.md deleted file mode 100644 index c97466159c5..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnum - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md b/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md deleted file mode 100644 index c48104c6397..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Pet.md +++ /dev/null @@ -1,16 +0,0 @@ -# Pet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] -**Name** | **string** | | -**PhotoUrls** | **[]string** | | -**Tags** | [**[]Tag**](Tag.md) | | [optional] -**Status** | **string** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md deleted file mode 100644 index 6ee9afef754..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md +++ /dev/null @@ -1,359 +0,0 @@ -# \PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AddPet**](PetApi.md#AddPet) | **Post** /pet | Add a new pet to the store -[**DeletePet**](PetApi.md#DeletePet) | **Delete** /pet/{petId} | Deletes a pet -[**FindPetsByStatus**](PetApi.md#FindPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status -[**FindPetsByTags**](PetApi.md#FindPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags -[**GetPetById**](PetApi.md#GetPetById) | **Get** /pet/{petId} | Find pet by ID -[**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet -[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data -[**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image -[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - - -## AddPet - -> AddPet(ctx, body) - -Add a new pet to the store - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeletePet - -> DeletePet(ctx, petId, optional) - -Deletes a pet - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| Pet id to delete | - **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a DeletePetOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **apiKey** | **optional.String**| | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FindPetsByStatus - -> []Pet FindPetsByStatus(ctx, status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**status** | [**[]string**](string.md)| Status values that need to be considered for filter | - -### Return type - -[**[]Pet**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FindPetsByTags - -> []Pet FindPetsByTags(ctx, tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**tags** | [**[]string**](string.md)| Tags to filter by | - -### Return type - -[**[]Pet**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetPetById - -> Pet GetPetById(ctx, petId) - -Find pet by ID - -Returns a single pet - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePet - -> UpdatePet(ctx, body) - -Update an existing pet - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePetWithForm - -> UpdatePetWithForm(ctx, petId, optional) - -Updates a pet in the store with form data - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet that needs to be updated | - **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **name** | **optional.String**| Updated name of the pet | - **status** | **optional.String**| Updated status of the pet | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UploadFile - -> ApiResponse UploadFile(ctx, petId, optional) - -uploads an image - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to update | - **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a UploadFileOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **additionalMetadata** | **optional.String**| Additional data to pass to server | - **file** | **optional.Interface of *os.File****optional.*os.File**| file to upload | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UploadFileWithRequiredFile - -> ApiResponse UploadFileWithRequiredFile(ctx, petId, requiredFile, optional) - -uploads an image (required) - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to update | -**requiredFile** | ***os.File*****os.File**| file to upload | - **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a UploadFileWithRequiredFileOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - **additionalMetadata** | **optional.String**| Additional data to pass to server | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/ReadOnlyFirst.md b/samples/client/petstore/go/go-petstore-withXml/docs/ReadOnlyFirst.md deleted file mode 100644 index a86828404ec..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,12 +0,0 @@ -# ReadOnlyFirst - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [readonly] -**Baz** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Return.md b/samples/client/petstore/go/go-petstore-withXml/docs/Return.md deleted file mode 100644 index 11be0b27c50..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Return.md +++ /dev/null @@ -1,11 +0,0 @@ -# Return - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Return** | **int32** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/SpecialModelName.md b/samples/client/petstore/go/go-petstore-withXml/docs/SpecialModelName.md deleted file mode 100644 index 96d7a28a409..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/SpecialModelName.md +++ /dev/null @@ -1,11 +0,0 @@ -# SpecialModelName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SpecialPropertyName** | **int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/StoreApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/StoreApi.md deleted file mode 100644 index 531ab09ff68..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/StoreApi.md +++ /dev/null @@ -1,142 +0,0 @@ -# \StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID -[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID -[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet - - - -## DeleteOrder - -> DeleteOrder(ctx, orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **string**| ID of the order that needs to be deleted | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetInventory - -> map[string]int32 GetInventory(ctx, ) - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Required Parameters - -This endpoint does not need any parameter. - -### Return type - -**map[string]int32** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetOrderById - -> Order GetOrderById(ctx, orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **int64**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PlaceOrder - -> Order PlaceOrder(ctx, body) - -Place an order for a pet - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/Tag.md b/samples/client/petstore/go/go-petstore-withXml/docs/Tag.md deleted file mode 100644 index d6b3cc117b5..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/Tag.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Name** | **string** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderDefault.md b/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderDefault.md deleted file mode 100644 index 1b9f077c303..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# TypeHolderDefault - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StringItem** | **string** | | [default to what] -**NumberItem** | **float32** | | -**IntegerItem** | **int32** | | -**BoolItem** | **bool** | | [default to true] -**ArrayItem** | **[]int32** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md b/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md deleted file mode 100644 index f4d62ea836b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/TypeHolderExample.md +++ /dev/null @@ -1,16 +0,0 @@ -# TypeHolderExample - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StringItem** | **string** | | -**NumberItem** | **float32** | | -**FloatItem** | **float32** | | -**IntegerItem** | **int32** | | -**BoolItem** | **bool** | | -**ArrayItem** | **[]int32** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/User.md b/samples/client/petstore/go/go-petstore-withXml/docs/User.md deleted file mode 100644 index 7675d7ff701..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/User.md +++ /dev/null @@ -1,18 +0,0 @@ -# User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int32** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/UserApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/UserApi.md deleted file mode 100644 index d9f16bb5fb0..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/UserApi.md +++ /dev/null @@ -1,276 +0,0 @@ -# \UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateUser**](UserApi.md#CreateUser) | **Post** /user | Create user -[**CreateUsersWithArrayInput**](UserApi.md#CreateUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array -[**CreateUsersWithListInput**](UserApi.md#CreateUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array -[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /user/{username} | Delete user -[**GetUserByName**](UserApi.md#GetUserByName) | **Get** /user/{username} | Get user by user name -[**LoginUser**](UserApi.md#LoginUser) | **Get** /user/login | Logs user into the system -[**LogoutUser**](UserApi.md#LogoutUser) | **Get** /user/logout | Logs out current logged in user session -[**UpdateUser**](UserApi.md#UpdateUser) | **Put** /user/{username} | Updated user - - - -## CreateUser - -> CreateUser(ctx, body) - -Create user - -This can only be done by the logged in user. - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**User**](User.md)| Created user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## CreateUsersWithArrayInput - -> CreateUsersWithArrayInput(ctx, body) - -Creates list of users with given input array - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**[]User**](User.md)| List of user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## CreateUsersWithListInput - -> CreateUsersWithListInput(ctx, body) - -Creates list of users with given input array - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**[]User**](User.md)| List of user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeleteUser - -> DeleteUser(ctx, username) - -Delete user - -This can only be done by the logged in user. - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The name that needs to be deleted | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetUserByName - -> User GetUserByName(ctx, username) - -Get user by user name - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## LoginUser - -> string LoginUser(ctx, username, password) - -Logs user into the system - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The user name for login | -**password** | **string**| The password for login in clear text | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## LogoutUser - -> LogoutUser(ctx, ) - -Logs out current logged in user session - -### Required Parameters - -This endpoint does not need any parameter. - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdateUser - -> UpdateUser(ctx, username, body) - -Updated user - -This can only be done by the logged in user. - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| name that need to be deleted | -**body** | [**User**](User.md)| Updated user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/XmlItem.md b/samples/client/petstore/go/go-petstore-withXml/docs/XmlItem.md deleted file mode 100644 index 8a9c2dc0b50..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/docs/XmlItem.md +++ /dev/null @@ -1,39 +0,0 @@ -# XmlItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AttributeString** | **string** | | [optional] -**AttributeNumber** | **float32** | | [optional] -**AttributeInteger** | **int32** | | [optional] -**AttributeBoolean** | **bool** | | [optional] -**WrappedArray** | **[]int32** | | [optional] -**NameString** | **string** | | [optional] -**NameNumber** | **float32** | | [optional] -**NameInteger** | **int32** | | [optional] -**NameBoolean** | **bool** | | [optional] -**NameArray** | **[]int32** | | [optional] -**NameWrappedArray** | **[]int32** | | [optional] -**PrefixString** | **string** | | [optional] -**PrefixNumber** | **float32** | | [optional] -**PrefixInteger** | **int32** | | [optional] -**PrefixBoolean** | **bool** | | [optional] -**PrefixArray** | **[]int32** | | [optional] -**PrefixWrappedArray** | **[]int32** | | [optional] -**NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **float32** | | [optional] -**NamespaceInteger** | **int32** | | [optional] -**NamespaceBoolean** | **bool** | | [optional] -**NamespaceArray** | **[]int32** | | [optional] -**NamespaceWrappedArray** | **[]int32** | | [optional] -**PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **float32** | | [optional] -**PrefixNsInteger** | **int32** | | [optional] -**PrefixNsBoolean** | **bool** | | [optional] -**PrefixNsArray** | **[]int32** | | [optional] -**PrefixNsWrappedArray** | **[]int32** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore-withXml/git_push.sh b/samples/client/petstore/go/go-petstore-withXml/git_push.sh deleted file mode 100644 index ced3be2b0c7..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/go/go-petstore-withXml/go.mod b/samples/client/petstore/go/go-petstore-withXml/go.mod deleted file mode 100644 index 1af1846f985..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/go.mod +++ /dev/null @@ -1,6 +0,0 @@ -module github.com/GIT_USER_ID/GIT_REPO_ID - -require ( - github.com/antihax/optional v1.0.0 - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 -) diff --git a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go deleted file mode 100644 index 4369b00ce9b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Model200Response Model for testing model name starting with number -type Model200Response struct { - Name int32 `json:"name,omitempty" xml:"name"` - Class string `json:"class,omitempty" xml:"class"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go deleted file mode 100644 index fcfddb38ca8..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_any_type.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType -type AdditionalPropertiesAnyType struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go deleted file mode 100644 index ac004da1869..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_array.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesArray struct for AdditionalPropertiesArray -type AdditionalPropertiesArray struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go deleted file mode 100644 index be33e75b25d..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_boolean.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean -type AdditionalPropertiesBoolean struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go deleted file mode 100644 index 35aafa9f602..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesClass struct for AdditionalPropertiesClass -type AdditionalPropertiesClass struct { - MapString map[string]string `json:"map_string,omitempty" xml:"map_string"` - MapNumber map[string]float32 `json:"map_number,omitempty" xml:"map_number"` - MapInteger map[string]int32 `json:"map_integer,omitempty" xml:"map_integer"` - MapBoolean map[string]bool `json:"map_boolean,omitempty" xml:"map_boolean"` - MapArrayInteger map[string][]int32 `json:"map_array_integer,omitempty" xml:"map_array_integer"` - MapArrayAnytype map[string][]map[string]interface{} `json:"map_array_anytype,omitempty" xml:"map_array_anytype"` - MapMapString map[string]map[string]string `json:"map_map_string,omitempty" xml:"map_map_string"` - MapMapAnytype map[string]map[string]map[string]interface{} `json:"map_map_anytype,omitempty" xml:"map_map_anytype"` - Anytype1 map[string]interface{} `json:"anytype_1,omitempty" xml:"anytype_1"` - Anytype2 map[string]interface{} `json:"anytype_2,omitempty" xml:"anytype_2"` - Anytype3 map[string]interface{} `json:"anytype_3,omitempty" xml:"anytype_3"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go deleted file mode 100644 index 8ea57854dba..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_integer.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger -type AdditionalPropertiesInteger struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go deleted file mode 100644 index 42f02627a3a..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_number.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber -type AdditionalPropertiesNumber struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go deleted file mode 100644 index f45e16a05f4..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_object.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesObject struct for AdditionalPropertiesObject -type AdditionalPropertiesObject struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go deleted file mode 100644 index 8e12de1f66c..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_string.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// AdditionalPropertiesString struct for AdditionalPropertiesString -type AdditionalPropertiesString struct { - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_animal.go b/samples/client/petstore/go/go-petstore-withXml/model_animal.go deleted file mode 100644 index e8f930b6618..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_animal.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Animal struct for Animal -type Animal struct { - ClassName string `json:"className" xml:"className"` - Color string `json:"color,omitempty" xml:"color"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go deleted file mode 100644 index 8d532bbbacb..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// ApiResponse struct for ApiResponse -type ApiResponse struct { - Code int32 `json:"code,omitempty" xml:"code"` - Type string `json:"type,omitempty" xml:"type"` - Message string `json:"message,omitempty" xml:"message"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go deleted file mode 100644 index 179ea4ef63a..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly -type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty" xml:"ArrayArrayNumber"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go deleted file mode 100644 index 6dccb378292..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// ArrayOfNumberOnly struct for ArrayOfNumberOnly -type ArrayOfNumberOnly struct { - ArrayNumber []float32 `json:"ArrayNumber,omitempty" xml:"ArrayNumber"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go deleted file mode 100644 index f8df9e29c33..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// ArrayTest struct for ArrayTest -type ArrayTest struct { - ArrayOfString []string `json:"array_of_string,omitempty" xml:"array_of_string"` - ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty" xml:"array_array_of_integer"` - ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty" xml:"array_array_of_model"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go deleted file mode 100644 index a0a9c70fd86..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_big_cat.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// BigCat struct for BigCat -type BigCat struct { - ClassName string `json:"className" xml:"className"` - Color string `json:"color,omitempty" xml:"color"` - Declawed bool `json:"declawed,omitempty" xml:"declawed"` - Kind string `json:"kind,omitempty" xml:"kind"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go deleted file mode 100644 index 49e5fa32504..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_big_cat_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// BigCatAllOf struct for BigCatAllOf -type BigCatAllOf struct { - Kind string `json:"kind,omitempty" xml:"kind"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go deleted file mode 100644 index 4dab2751ec2..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Capitalization struct for Capitalization -type Capitalization struct { - SmallCamel string `json:"smallCamel,omitempty" xml:"smallCamel"` - CapitalCamel string `json:"CapitalCamel,omitempty" xml:"CapitalCamel"` - SmallSnake string `json:"small_Snake,omitempty" xml:"small_Snake"` - CapitalSnake string `json:"Capital_Snake,omitempty" xml:"Capital_Snake"` - SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty" xml:"SCA_ETH_Flow_Points"` - // Name of the pet - ATT_NAME string `json:"ATT_NAME,omitempty" xml:"ATT_NAME"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_cat.go deleted file mode 100644 index b9345db8538..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Cat struct for Cat -type Cat struct { - ClassName string `json:"className" xml:"className"` - Color string `json:"color,omitempty" xml:"color"` - Declawed bool `json:"declawed,omitempty" xml:"declawed"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go deleted file mode 100644 index f430c16e9ac..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// CatAllOf struct for CatAllOf -type CatAllOf struct { - Declawed bool `json:"declawed,omitempty" xml:"declawed"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_category.go b/samples/client/petstore/go/go-petstore-withXml/model_category.go deleted file mode 100644 index 8c061446d4b..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_category.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Category struct for Category -type Category struct { - Id int64 `json:"id,omitempty" xml:"id"` - Name string `json:"name" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go deleted file mode 100644 index 62e2bf29b62..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// ClassModel Model for testing model with \"_class\" property -type ClassModel struct { - Class string `json:"_class,omitempty" xml:"_class"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_client.go b/samples/client/petstore/go/go-petstore-withXml/model_client.go deleted file mode 100644 index 019604e186e..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_client.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Client struct for Client -type Client struct { - Client string `json:"client,omitempty" xml:"client"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog.go b/samples/client/petstore/go/go-petstore-withXml/model_dog.go deleted file mode 100644 index 4dd159b9b46..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Dog struct for Dog -type Dog struct { - ClassName string `json:"className" xml:"className"` - Color string `json:"color,omitempty" xml:"color"` - Breed string `json:"breed,omitempty" xml:"breed"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go b/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go deleted file mode 100644 index a74acf44b73..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// DogAllOf struct for DogAllOf -type DogAllOf struct { - Breed string `json:"breed,omitempty" xml:"breed"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go deleted file mode 100644 index d0c6d7dbaaf..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// EnumArrays struct for EnumArrays -type EnumArrays struct { - JustSymbol string `json:"just_symbol,omitempty" xml:"just_symbol"` - ArrayEnum []string `json:"array_enum,omitempty" xml:"array_enum"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go deleted file mode 100644 index bbd14cd0d04..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// EnumClass the model 'EnumClass' -type EnumClass string - -// List of EnumClass -const ( - ABC EnumClass = "_abc" - EFG EnumClass = "-efg" - XYZ EnumClass = "(xyz)" -) diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go deleted file mode 100644 index ad5572d736d..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// EnumTest struct for EnumTest -type EnumTest struct { - EnumString string `json:"enum_string,omitempty" xml:"enum_string"` - EnumStringRequired string `json:"enum_string_required" xml:"enum_string_required"` - EnumInteger int32 `json:"enum_integer,omitempty" xml:"enum_integer"` - EnumNumber float64 `json:"enum_number,omitempty" xml:"enum_number"` - OuterEnum OuterEnum `json:"outerEnum,omitempty" xml:"outerEnum"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file.go b/samples/client/petstore/go/go-petstore-withXml/model_file.go deleted file mode 100644 index 36693c9add3..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_file.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// File Must be named `File` for test. -type File struct { - // Test capitalization - SourceURI string `json:"sourceURI,omitempty" xml:"sourceURI"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go deleted file mode 100644 index bb90ac891fe..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// FileSchemaTestClass struct for FileSchemaTestClass -type FileSchemaTestClass struct { - File File `json:"file,omitempty" xml:"file"` - Files []File `json:"files,omitempty" xml:"files"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go deleted file mode 100644 index 7509fd01c5f..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go +++ /dev/null @@ -1,32 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -import ( - "os" - "time" -) -// FormatTest struct for FormatTest -type FormatTest struct { - Integer int32 `json:"integer,omitempty" xml:"integer"` - Int32 int32 `json:"int32,omitempty" xml:"int32"` - Int64 int64 `json:"int64,omitempty" xml:"int64"` - Number float32 `json:"number" xml:"number"` - Float float32 `json:"float,omitempty" xml:"float"` - Double float64 `json:"double,omitempty" xml:"double"` - String string `json:"string,omitempty" xml:"string"` - Byte string `json:"byte" xml:"byte"` - Binary *os.File `json:"binary,omitempty" xml:"binary"` - Date string `json:"date" xml:"date"` - DateTime time.Time `json:"dateTime,omitempty" xml:"dateTime"` - Uuid string `json:"uuid,omitempty" xml:"uuid"` - Password string `json:"password" xml:"password"` - BigDecimal float64 `json:"BigDecimal,omitempty" xml:"BigDecimal"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go deleted file mode 100644 index cfee0a910ab..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// HasOnlyReadOnly struct for HasOnlyReadOnly -type HasOnlyReadOnly struct { - Bar string `json:"bar,omitempty" xml:"bar"` - Foo string `json:"foo,omitempty" xml:"foo"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_list.go b/samples/client/petstore/go/go-petstore-withXml/model_list.go deleted file mode 100644 index 04602979bb0..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_list.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// List struct for List -type List struct { - Var123List string `json:"123-list,omitempty" xml:"123-list"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go deleted file mode 100644 index 46bfa5f97f9..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// MapTest struct for MapTest -type MapTest struct { - MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty" xml:"map_map_of_string"` - MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty" xml:"map_of_enum_string"` - DirectMap map[string]bool `json:"direct_map,omitempty" xml:"direct_map"` - IndirectMap map[string]bool `json:"indirect_map,omitempty" xml:"indirect_map"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go deleted file mode 100644 index f0d4bd9f74a..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -import ( - "time" -) -// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass -type MixedPropertiesAndAdditionalPropertiesClass struct { - Uuid string `json:"uuid,omitempty" xml:"uuid"` - DateTime time.Time `json:"dateTime,omitempty" xml:"dateTime"` - Map map[string]Animal `json:"map,omitempty" xml:"map"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_name.go deleted file mode 100644 index 150b599748a..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_name.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Name Model for testing model name same as property name -type Name struct { - Name int32 `json:"name" xml:"name"` - SnakeCase int32 `json:"snake_case,omitempty" xml:"snake_case"` - Property string `json:"property,omitempty" xml:"property"` - Var123Number int32 `json:"123Number,omitempty" xml:"123Number"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go deleted file mode 100644 index 5c65ec80835..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// NumberOnly struct for NumberOnly -type NumberOnly struct { - JustNumber float32 `json:"JustNumber,omitempty" xml:"JustNumber"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_order.go b/samples/client/petstore/go/go-petstore-withXml/model_order.go deleted file mode 100644 index f624fbcf7a7..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_order.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -import ( - "time" -) -// Order struct for Order -type Order struct { - Id int64 `json:"id,omitempty" xml:"id"` - PetId int64 `json:"petId,omitempty" xml:"petId"` - Quantity int32 `json:"quantity,omitempty" xml:"quantity"` - ShipDate time.Time `json:"shipDate,omitempty" xml:"shipDate"` - // Order Status - Status string `json:"status,omitempty" xml:"status"` - Complete bool `json:"complete,omitempty" xml:"complete"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go deleted file mode 100644 index 7bae7692195..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// OuterComposite struct for OuterComposite -type OuterComposite struct { - MyNumber float32 `json:"my_number,omitempty" xml:"my_number"` - MyString string `json:"my_string,omitempty" xml:"my_string"` - MyBoolean bool `json:"my_boolean,omitempty" xml:"my_boolean"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go deleted file mode 100644 index 75974795456..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// OuterEnum the model 'OuterEnum' -type OuterEnum string - -// List of OuterEnum -const ( - PLACED OuterEnum = "placed" - APPROVED OuterEnum = "approved" - DELIVERED OuterEnum = "delivered" -) diff --git a/samples/client/petstore/go/go-petstore-withXml/model_pet.go b/samples/client/petstore/go/go-petstore-withXml/model_pet.go deleted file mode 100644 index dfe972977a7..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_pet.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Pet struct for Pet -type Pet struct { - Id int64 `json:"id,omitempty" xml:"id"` - Category Category `json:"category,omitempty" xml:"category"` - Name string `json:"name" xml:"name"` - PhotoUrls []string `json:"photoUrls" xml:"photoUrls"` - Tags []Tag `json:"tags,omitempty" xml:"tags"` - // pet status in the store - Status string `json:"status,omitempty" xml:"status"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go deleted file mode 100644 index 3d98e701220..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// ReadOnlyFirst struct for ReadOnlyFirst -type ReadOnlyFirst struct { - Bar string `json:"bar,omitempty" xml:"bar"` - Baz string `json:"baz,omitempty" xml:"baz"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_return.go b/samples/client/petstore/go/go-petstore-withXml/model_return.go deleted file mode 100644 index 5c7fc5c807e..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_return.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Return Model for testing reserved words -type Return struct { - Return int32 `json:"return,omitempty" xml:"return"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go deleted file mode 100644 index df479c77e30..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// SpecialModelName struct for SpecialModelName -type SpecialModelName struct { - SpecialPropertyName int64 `json:"$special[property.name],omitempty" xml:"$special[property.name]"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_tag.go b/samples/client/petstore/go/go-petstore-withXml/model_tag.go deleted file mode 100644 index 6f4abe36e46..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_tag.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// Tag struct for Tag -type Tag struct { - Id int64 `json:"id,omitempty" xml:"id"` - Name string `json:"name,omitempty" xml:"name"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go deleted file mode 100644 index 7071cb800ab..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_default.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// TypeHolderDefault struct for TypeHolderDefault -type TypeHolderDefault struct { - StringItem string `json:"string_item" xml:"string_item"` - NumberItem float32 `json:"number_item" xml:"number_item"` - IntegerItem int32 `json:"integer_item" xml:"integer_item"` - BoolItem bool `json:"bool_item" xml:"bool_item"` - ArrayItem []int32 `json:"array_item" xml:"array_item"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go b/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go deleted file mode 100644 index 4c7432f78d0..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_type_holder_example.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// TypeHolderExample struct for TypeHolderExample -type TypeHolderExample struct { - StringItem string `json:"string_item" xml:"string_item"` - NumberItem float32 `json:"number_item" xml:"number_item"` - FloatItem float32 `json:"float_item" xml:"float_item"` - IntegerItem int32 `json:"integer_item" xml:"integer_item"` - BoolItem bool `json:"bool_item" xml:"bool_item"` - ArrayItem []int32 `json:"array_item" xml:"array_item"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_user.go b/samples/client/petstore/go/go-petstore-withXml/model_user.go deleted file mode 100644 index 2e5962660aa..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_user.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// User struct for User -type User struct { - Id int64 `json:"id,omitempty" xml:"id"` - Username string `json:"username,omitempty" xml:"username"` - FirstName string `json:"firstName,omitempty" xml:"firstName"` - LastName string `json:"lastName,omitempty" xml:"lastName"` - Email string `json:"email,omitempty" xml:"email"` - Password string `json:"password,omitempty" xml:"password"` - Phone string `json:"phone,omitempty" xml:"phone"` - // User Status - UserStatus int32 `json:"userStatus,omitempty" xml:"userStatus"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go b/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go deleted file mode 100644 index c81766bc22c..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/model_xml_item.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore -// XmlItem struct for XmlItem -type XmlItem struct { - AttributeString string `json:"attribute_string,omitempty" xml:"attribute_string,attr"` - AttributeNumber float32 `json:"attribute_number,omitempty" xml:"attribute_number,attr"` - AttributeInteger int32 `json:"attribute_integer,omitempty" xml:"attribute_integer,attr"` - AttributeBoolean bool `json:"attribute_boolean,omitempty" xml:"attribute_boolean,attr"` - WrappedArray []int32 `json:"wrapped_array,omitempty" xml:"wrapped_array"` - NameString string `json:"name_string,omitempty" xml:"name_string"` - NameNumber float32 `json:"name_number,omitempty" xml:"name_number"` - NameInteger int32 `json:"name_integer,omitempty" xml:"name_integer"` - NameBoolean bool `json:"name_boolean,omitempty" xml:"name_boolean"` - NameArray []int32 `json:"name_array,omitempty" xml:"name_array"` - NameWrappedArray []int32 `json:"name_wrapped_array,omitempty" xml:"name_wrapped_array"` - PrefixString string `json:"prefix_string,omitempty" xml:"prefix_string"` - PrefixNumber float32 `json:"prefix_number,omitempty" xml:"prefix_number"` - PrefixInteger int32 `json:"prefix_integer,omitempty" xml:"prefix_integer"` - PrefixBoolean bool `json:"prefix_boolean,omitempty" xml:"prefix_boolean"` - PrefixArray []int32 `json:"prefix_array,omitempty" xml:"prefix_array"` - PrefixWrappedArray []int32 `json:"prefix_wrapped_array,omitempty" xml:"prefix_wrapped_array"` - NamespaceString string `json:"namespace_string,omitempty" xml:"namespace_string"` - NamespaceNumber float32 `json:"namespace_number,omitempty" xml:"namespace_number"` - NamespaceInteger int32 `json:"namespace_integer,omitempty" xml:"namespace_integer"` - NamespaceBoolean bool `json:"namespace_boolean,omitempty" xml:"namespace_boolean"` - NamespaceArray []int32 `json:"namespace_array,omitempty" xml:"namespace_array"` - NamespaceWrappedArray []int32 `json:"namespace_wrapped_array,omitempty" xml:"namespace_wrapped_array"` - PrefixNsString string `json:"prefix_ns_string,omitempty" xml:"prefix_ns_string"` - PrefixNsNumber float32 `json:"prefix_ns_number,omitempty" xml:"prefix_ns_number"` - PrefixNsInteger int32 `json:"prefix_ns_integer,omitempty" xml:"prefix_ns_integer"` - PrefixNsBoolean bool `json:"prefix_ns_boolean,omitempty" xml:"prefix_ns_boolean"` - PrefixNsArray []int32 `json:"prefix_ns_array,omitempty" xml:"prefix_ns_array"` - PrefixNsWrappedArray []int32 `json:"prefix_ns_wrapped_array,omitempty" xml:"prefix_ns_wrapped_array"` -} diff --git a/samples/client/petstore/go/go-petstore-withXml/response.go b/samples/client/petstore/go/go-petstore-withXml/response.go deleted file mode 100644 index b0682c66568..00000000000 --- a/samples/client/petstore/go/go-petstore-withXml/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package petstore - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResonse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/client/petstore/go/go-petstore/.openapi-generator/FILES index 28a8ffd70f1..ec2890e3651 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -67,52 +67,5 @@ docs/XmlItem.md git_push.sh go.mod go.sum -model_200_response.go -model_additional_properties_any_type.go -model_additional_properties_array.go -model_additional_properties_boolean.go -model_additional_properties_class.go -model_additional_properties_integer.go -model_additional_properties_number.go -model_additional_properties_object.go -model_additional_properties_string.go -model_animal.go -model_api_response.go -model_array_of_array_of_number_only.go -model_array_of_number_only.go -model_array_test_.go -model_big_cat.go -model_big_cat_all_of.go -model_capitalization.go -model_cat.go -model_cat_all_of.go -model_category.go -model_class_model.go -model_client.go -model_dog.go -model_dog_all_of.go -model_enum_arrays.go -model_enum_class.go -model_enum_test_.go -model_file.go -model_file_schema_test_class.go -model_format_test_.go -model_has_only_read_only.go -model_list.go -model_map_test_.go -model_mixed_properties_and_additional_properties_class.go -model_name.go -model_number_only.go -model_order.go -model_outer_composite.go -model_outer_enum.go -model_pet.go -model_read_only_first.go -model_return.go -model_special_model_name.go -model_tag.go -model_type_holder_default.go -model_type_holder_example.go -model_user.go -model_xml_item.go response.go +utils.go diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 611d9e5d5d4..d2a30bc04d7 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -17,13 +17,53 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import "./petstore" +import sw "./petstore" +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +``` +ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) ``` ## Documentation for API Endpoints @@ -127,44 +167,32 @@ Class | Method | HTTP request | Description -## api_key +### api_key - **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAPIKey, petstore.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` +Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request. -## api_key_query +### api_key_query - **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAPIKey, petstore.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` +Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request. -## http_basic_test +### http_basic_test - **Type**: HTTP basic authentication Example ```golang -auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{ +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) @@ -172,7 +200,7 @@ r, err := client.Service.Operation(auth, args) ``` -## petstore_auth +### petstore_auth - **Type**: OAuth @@ -185,7 +213,7 @@ r, err := client.Service.Operation(auth, args) Example ```golang -auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING") +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` @@ -197,11 +225,26 @@ import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, petstore.ContextOAuth2, tokenSource) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) r, err := client.Service.Operation(auth, args) ``` +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` ## Author diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index ab06c6e93fa..171722aaba5 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" ) // Linger please @@ -22,19 +21,59 @@ var ( _ _context.Context ) +type AnotherFakeApi interface { + + /* + * Call123TestSpecialTags To test special tags + * To test special tags and operation ID starting with number + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCall123TestSpecialTagsRequest + */ + Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest + + /* + * Call123TestSpecialTagsExecute executes the request + * @return Client + */ + Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) +} + // AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service +type ApiCall123TestSpecialTagsRequest struct { + ctx _context.Context + ApiService AnotherFakeApi + body *Client +} + +func (r ApiCall123TestSpecialTagsRequest) Body(body Client) ApiCall123TestSpecialTagsRequest { + r.body = &body + return r +} + +func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.Call123TestSpecialTagsExecute(r) +} + /* * Call123TestSpecialTags To test special tags - * * To test special tags and operation ID starting with number - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model + * @return ApiCall123TestSpecialTagsRequest + */ +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { + return ApiCall123TestSpecialTagsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -44,11 +83,19 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, bod localVarReturnValue Client ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/another-fake/dummy" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -68,20 +115,19 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, bod localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 60b5cede6bd..943ad618f9a 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -14,9 +14,8 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" - "github.com/antihax/optional" "os" + "time" "reflect" ) @@ -25,18 +24,231 @@ var ( _ _context.Context ) +type FakeApi interface { + + /* + * CreateXmlItem creates an XmlItem + * this route creates an XmlItem + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateXmlItemRequest + */ + CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest + + /* + * CreateXmlItemExecute executes the request + */ + CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) + + /* + * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize + * Test serialization of outer boolean types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterBooleanSerializeRequest + */ + FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest + + /* + * FakeOuterBooleanSerializeExecute executes the request + * @return bool + */ + FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) + + /* + * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize + * Test serialization of object with outer number type + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterCompositeSerializeRequest + */ + FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest + + /* + * FakeOuterCompositeSerializeExecute executes the request + * @return OuterComposite + */ + FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) + + /* + * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize + * Test serialization of outer number types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterNumberSerializeRequest + */ + FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest + + /* + * FakeOuterNumberSerializeExecute executes the request + * @return float32 + */ + FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) + + /* + * FakeOuterStringSerialize Method for FakeOuterStringSerialize + * Test serialization of outer string types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterStringSerializeRequest + */ + FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest + + /* + * FakeOuterStringSerializeExecute executes the request + * @return string + */ + FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) + + /* + * TestBodyWithFileSchema Method for TestBodyWithFileSchema + * For this test, the body for this request much reference a schema named `File`. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestBodyWithFileSchemaRequest + */ + TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest + + /* + * TestBodyWithFileSchemaExecute executes the request + */ + TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) + + /* + * TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestBodyWithQueryParamsRequest + */ + TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest + + /* + * TestBodyWithQueryParamsExecute executes the request + */ + TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) + + /* + * TestClientModel To test \"client\" model + * To test "client" model + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestClientModelRequest + */ + TestClientModel(ctx _context.Context) ApiTestClientModelRequest + + /* + * TestClientModelExecute executes the request + * @return Client + */ + TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) + + /* + * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestEndpointParametersRequest + */ + TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest + + /* + * TestEndpointParametersExecute executes the request + */ + TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) + + /* + * TestEnumParameters To test enum parameters + * To test enum parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestEnumParametersRequest + */ + TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest + + /* + * TestEnumParametersExecute executes the request + */ + TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) + + /* + * TestGroupParameters Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestGroupParametersRequest + */ + TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest + + /* + * TestGroupParametersExecute executes the request + */ + TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) + + /* + * TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestInlineAdditionalPropertiesRequest + */ + TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest + + /* + * TestInlineAdditionalPropertiesExecute executes the request + */ + TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) + + /* + * TestJsonFormData test json serialization of form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestJsonFormDataRequest + */ + TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest + + /* + * TestJsonFormDataExecute executes the request + */ + TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) + + /* + * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat + * To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestQueryParameterCollectionFormatRequest + */ + TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest + + /* + * TestQueryParameterCollectionFormatExecute executes the request + */ + TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) +} + // FakeApiService FakeApi service type FakeApiService service +type ApiCreateXmlItemRequest struct { + ctx _context.Context + ApiService FakeApi + xmlItem *XmlItem +} + +func (r ApiCreateXmlItemRequest) XmlItem(xmlItem XmlItem) ApiCreateXmlItemRequest { + r.xmlItem = &xmlItem + return r +} + +func (r ApiCreateXmlItemRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateXmlItemExecute(r) +} + /* * CreateXmlItem creates an XmlItem - * * this route creates an XmlItem - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param xmlItem XmlItem Body + * @return ApiCreateXmlItemRequest */ -func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (*_nethttp.Response, error) { +func (a *FakeApiService) CreateXmlItem(ctx _context.Context) ApiCreateXmlItemRequest { + return ApiCreateXmlItemRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) CreateXmlItemExecute(r ApiCreateXmlItemRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -45,11 +257,19 @@ func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (* localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/create_xml_item" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.CreateXmlItem") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/create_xml_item" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.xmlItem == nil { + return nil, reportError("xmlItem is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16"} @@ -69,20 +289,19 @@ func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (* localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &xmlItem - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.xmlItem + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -98,22 +317,39 @@ func (a *FakeApiService) CreateXmlItem(ctx _context.Context, xmlItem XmlItem) (* return localVarHTTPResponse, nil } -// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool +type ApiFakeOuterBooleanSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *bool +} + +func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBooleanSerializeRequest { + r.body = &body + return r +} + +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { + return r.ApiService.FakeOuterBooleanSerializeExecute(r) } /* * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * * Test serialization of outer boolean types - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: - * @param "Body" (optional.Bool) - Input boolean as post body + * @return ApiFakeOuterBooleanSerializeRequest + */ +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { + return ApiFakeOuterBooleanSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return bool */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -123,8 +359,13 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa localVarReturnValue bool ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/boolean" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -147,23 +388,19 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -188,22 +425,39 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa return localVarReturnValue, localVarHTTPResponse, nil } -// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' -type FakeOuterCompositeSerializeOpts struct { - Body optional.Interface +type ApiFakeOuterCompositeSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *OuterComposite +} + +func (r ApiFakeOuterCompositeSerializeRequest) Body(body OuterComposite) ApiFakeOuterCompositeSerializeRequest { + r.body = &body + return r +} + +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { + return r.ApiService.FakeOuterCompositeSerializeExecute(r) } /* * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * * Test serialization of object with outer number type - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: - * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body + * @return ApiFakeOuterCompositeSerializeRequest + */ +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { + return ApiFakeOuterCompositeSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return OuterComposite */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -213,8 +467,13 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local localVarReturnValue OuterComposite ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/composite" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -237,27 +496,19 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(OuterComposite) - if !localVarOptionalBodyok { - return localVarReturnValue, nil, reportError("body should be OuterComposite") - } - localVarPostBody = &localVarOptionalBody - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -282,22 +533,39 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local return localVarReturnValue, localVarHTTPResponse, nil } -// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 +type ApiFakeOuterNumberSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *float32 +} + +func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumberSerializeRequest { + r.body = &body + return r +} + +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { + return r.ApiService.FakeOuterNumberSerializeExecute(r) } /* * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * * Test serialization of outer number types - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: - * @param "Body" (optional.Float32) - Input number as post body + * @return ApiFakeOuterNumberSerializeRequest + */ +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { + return ApiFakeOuterNumberSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return float32 */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -307,8 +575,13 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar localVarReturnValue float32 ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/number" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/number" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -331,23 +604,19 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -372,22 +641,39 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar return localVarReturnValue, localVarHTTPResponse, nil } -// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' -type FakeOuterStringSerializeOpts struct { - Body optional.String +type ApiFakeOuterStringSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *string +} + +func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterStringSerializeRequest { + r.body = &body + return r +} + +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { + return r.ApiService.FakeOuterStringSerializeExecute(r) } /* * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * * Test serialization of outer string types - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: - * @param "Body" (optional.String) - Input string as post body + * @return ApiFakeOuterStringSerializeRequest + */ +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { + return ApiFakeOuterStringSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return string */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -397,8 +683,13 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar localVarReturnValue string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/string" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/string" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -421,23 +712,19 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -462,15 +749,38 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar return localVarReturnValue, localVarHTTPResponse, nil } +type ApiTestBodyWithFileSchemaRequest struct { + ctx _context.Context + ApiService FakeApi + body *FileSchemaTestClass +} + +func (r ApiTestBodyWithFileSchemaRequest) Body(body FileSchemaTestClass) ApiTestBodyWithFileSchemaRequest { + r.body = &body + return r +} + +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithFileSchemaExecute(r) +} + /* * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * - * For this test, the body for this request much reference a schema named `File`. - * + * For this test, the body for this request much reference a schema named `File`. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body + * @return ApiTestBodyWithFileSchemaRequest */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileSchemaTestClass) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { + return ApiTestBodyWithFileSchemaRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -479,11 +789,19 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileS localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/body-with-file-schema" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -503,20 +821,19 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileS localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -532,14 +849,42 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, body FileS return localVarHTTPResponse, nil } +type ApiTestBodyWithQueryParamsRequest struct { + ctx _context.Context + ApiService FakeApi + query *string + body *User +} + +func (r ApiTestBodyWithQueryParamsRequest) Query(query string) ApiTestBodyWithQueryParamsRequest { + r.query = &query + return r +} +func (r ApiTestBodyWithQueryParamsRequest) Body(body User) ApiTestBodyWithQueryParamsRequest { + r.body = &body + return r +} + +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithQueryParamsExecute(r) +} + /* * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param query - * @param body + * @return ApiTestBodyWithQueryParamsRequest */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, body User) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { + return ApiTestBodyWithQueryParamsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -548,13 +893,24 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/body-with-query-params" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.query == nil { + return nil, reportError("query is required and must be specified") + } + if r.body == nil { + return nil, reportError("body is required and must be specified") + } - localVarQueryParams.Add("query", parameterToString(query, "")) + localVarQueryParams.Add("query", parameterToString(*r.query, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -573,20 +929,19 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -602,16 +957,39 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str return localVarHTTPResponse, nil } +type ApiTestClientModelRequest struct { + ctx _context.Context + ApiService FakeApi + body *Client +} + +func (r ApiTestClientModelRequest) Body(body Client) ApiTestClientModelRequest { + r.body = &body + return r +} + +func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.TestClientModelExecute(r) +} + /* * TestClientModel To test \"client\" model - * - * To test \"client\" model - * + * To test "client" model * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model + * @return ApiTestClientModelRequest + */ +func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { + return ApiTestClientModelRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Client */ -func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { +func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -621,11 +999,19 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Cli localVarReturnValue Client ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -645,20 +1031,19 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Cli localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -683,43 +1068,106 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Cli return localVarReturnValue, localVarHTTPResponse, nil } -// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String +type ApiTestEndpointParametersRequest struct { + ctx _context.Context + ApiService FakeApi + number *float32 + double *float64 + patternWithoutDelimiter *string + byte_ *string + integer *int32 + int32_ *int32 + int64_ *int64 + float *float32 + string_ *string + binary **os.File + date *string + dateTime *time.Time + password *string + callback *string +} + +func (r ApiTestEndpointParametersRequest) Number(number float32) ApiTestEndpointParametersRequest { + r.number = &number + return r +} +func (r ApiTestEndpointParametersRequest) Double(double float64) ApiTestEndpointParametersRequest { + r.double = &double + return r +} +func (r ApiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) ApiTestEndpointParametersRequest { + r.patternWithoutDelimiter = &patternWithoutDelimiter + return r +} +func (r ApiTestEndpointParametersRequest) Byte_(byte_ string) ApiTestEndpointParametersRequest { + r.byte_ = &byte_ + return r +} +func (r ApiTestEndpointParametersRequest) Integer(integer int32) ApiTestEndpointParametersRequest { + r.integer = &integer + return r +} +func (r ApiTestEndpointParametersRequest) Int32_(int32_ int32) ApiTestEndpointParametersRequest { + r.int32_ = &int32_ + return r +} +func (r ApiTestEndpointParametersRequest) Int64_(int64_ int64) ApiTestEndpointParametersRequest { + r.int64_ = &int64_ + return r +} +func (r ApiTestEndpointParametersRequest) Float(float float32) ApiTestEndpointParametersRequest { + r.float = &float + return r +} +func (r ApiTestEndpointParametersRequest) String_(string_ string) ApiTestEndpointParametersRequest { + r.string_ = &string_ + return r +} +func (r ApiTestEndpointParametersRequest) Binary(binary *os.File) ApiTestEndpointParametersRequest { + r.binary = &binary + return r +} +func (r ApiTestEndpointParametersRequest) Date(date string) ApiTestEndpointParametersRequest { + r.date = &date + return r +} +func (r ApiTestEndpointParametersRequest) DateTime(dateTime time.Time) ApiTestEndpointParametersRequest { + r.dateTime = &dateTime + return r +} +func (r ApiTestEndpointParametersRequest) Password(password string) ApiTestEndpointParametersRequest { + r.password = &password + return r +} +func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpointParametersRequest { + r.callback = &callback + return r +} + +func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEndpointParametersExecute(r) } /* * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * + * Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param number None - * @param double None - * @param patternWithoutDelimiter None - * @param byte_ None - * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: - * @param "Integer" (optional.Int32) - None - * @param "Int32_" (optional.Int32) - None - * @param "Int64_" (optional.Int64) - None - * @param "Float" (optional.Float32) - None - * @param "String_" (optional.String) - None - * @param "Binary" (optional.Interface of *os.File) - None - * @param "Date" (optional.String) - None - * @param "DateTime" (optional.Time) - None - * @param "Password" (optional.String) - None - * @param "Callback" (optional.String) - None + * @return ApiTestEndpointParametersRequest */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { + return ApiTestEndpointParametersRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -728,23 +1176,40 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if number < 32.1 { + if r.number == nil { + return nil, reportError("number is required and must be specified") + } + if *r.number < 32.1 { return nil, reportError("number must be greater than 32.1") } - if number > 543.2 { + if *r.number > 543.2 { return nil, reportError("number must be less than 543.2") } - if double < 67.8 { + if r.double == nil { + return nil, reportError("double is required and must be specified") + } + if *r.double < 67.8 { return nil, reportError("double must be greater than 67.8") } - if double > 123.4 { + if *r.double > 123.4 { return nil, reportError("double must be less than 123.4") } + if r.patternWithoutDelimiter == nil { + return nil, reportError("patternWithoutDelimiter is required and must be specified") + } + if r.byte_ == nil { + return nil, reportError("byte_ is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -763,33 +1228,29 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { - localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) + if r.integer != nil { + localVarFormParams.Add("integer", parameterToString(*r.integer, "")) } - if localVarOptionals != nil && localVarOptionals.Int32_.IsSet() { - localVarFormParams.Add("int32", parameterToString(localVarOptionals.Int32_.Value(), "")) + if r.int32_ != nil { + localVarFormParams.Add("int32", parameterToString(*r.int32_, "")) } - if localVarOptionals != nil && localVarOptionals.Int64_.IsSet() { - localVarFormParams.Add("int64", parameterToString(localVarOptionals.Int64_.Value(), "")) + if r.int64_ != nil { + localVarFormParams.Add("int64", parameterToString(*r.int64_, "")) } - localVarFormParams.Add("number", parameterToString(number, "")) - if localVarOptionals != nil && localVarOptionals.Float.IsSet() { - localVarFormParams.Add("float", parameterToString(localVarOptionals.Float.Value(), "")) + localVarFormParams.Add("number", parameterToString(*r.number, "")) + if r.float != nil { + localVarFormParams.Add("float", parameterToString(*r.float, "")) } - localVarFormParams.Add("double", parameterToString(double, "")) - if localVarOptionals != nil && localVarOptionals.String_.IsSet() { - localVarFormParams.Add("string", parameterToString(localVarOptionals.String_.Value(), "")) + localVarFormParams.Add("double", parameterToString(*r.double, "")) + if r.string_ != nil { + localVarFormParams.Add("string", parameterToString(*r.string_, "")) } - localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, "")) - localVarFormParams.Add("byte", parameterToString(byte_, "")) + localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, "")) + localVarFormParams.Add("byte", parameterToString(*r.byte_, "")) localVarFormFileName = "binary" var localVarFile *os.File - if localVarOptionals != nil && localVarOptionals.Binary.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.Binary.Value().(*os.File) - if !localVarFileOk { - return nil, reportError("binary should be *os.File") - } + if r.binary != nil { + localVarFile = *r.binary } if localVarFile != nil { fbs, _ := _ioutil.ReadAll(localVarFile) @@ -797,31 +1258,30 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo localVarFileName = localVarFile.Name() localVarFile.Close() } - if localVarOptionals != nil && localVarOptionals.Date.IsSet() { - localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) + if r.date != nil { + localVarFormParams.Add("date", parameterToString(*r.date, "")) } - if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { - localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) + if r.dateTime != nil { + localVarFormParams.Add("dateTime", parameterToString(*r.dateTime, "")) } - if localVarOptionals != nil && localVarOptionals.Password.IsSet() { - localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + if r.password != nil { + localVarFormParams.Add("password", parameterToString(*r.password, "")) } - if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { - localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) + if r.callback != nil { + localVarFormParams.Add("callback", parameterToString(*r.callback, "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -837,35 +1297,73 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo return localVarHTTPResponse, nil } -// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String +type ApiTestEnumParametersRequest struct { + ctx _context.Context + ApiService FakeApi + enumHeaderStringArray *[]string + enumHeaderString *string + enumQueryStringArray *[]string + enumQueryString *string + enumQueryInteger *int32 + enumQueryDouble *float64 + enumFormStringArray *[]string + enumFormString *string +} + +func (r ApiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArray []string) ApiTestEnumParametersRequest { + r.enumHeaderStringArray = &enumHeaderStringArray + return r +} +func (r ApiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) ApiTestEnumParametersRequest { + r.enumHeaderString = &enumHeaderString + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) ApiTestEnumParametersRequest { + r.enumQueryStringArray = &enumQueryStringArray + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryString(enumQueryString string) ApiTestEnumParametersRequest { + r.enumQueryString = &enumQueryString + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) ApiTestEnumParametersRequest { + r.enumQueryInteger = &enumQueryInteger + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) ApiTestEnumParametersRequest { + r.enumQueryDouble = &enumQueryDouble + return r +} +func (r ApiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) ApiTestEnumParametersRequest { + r.enumFormStringArray = &enumFormStringArray + return r +} +func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiTestEnumParametersRequest { + r.enumFormString = &enumFormString + return r +} + +func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEnumParametersExecute(r) } /* * TestEnumParameters To test enum parameters - * * To test enum parameters - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *TestEnumParametersOpts - Optional Parameters: - * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) - * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) - * @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array) - * @param "EnumQueryString" (optional.String) - Query parameter enum test (string) - * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) - * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) - * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) - * @param "EnumFormString" (optional.String) - Form parameter enum test (string) + * @return ApiTestEnumParametersRequest */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { + return ApiTestEnumParametersRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -874,23 +1372,28 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { - localVarQueryParams.Add("enum_query_string_array", parameterToString(localVarOptionals.EnumQueryStringArray.Value(), "csv")) + if r.enumQueryStringArray != nil { + localVarQueryParams.Add("enum_query_string_array", parameterToString(*r.enumQueryStringArray, "csv")) } - if localVarOptionals != nil && localVarOptionals.EnumQueryString.IsSet() { - localVarQueryParams.Add("enum_query_string", parameterToString(localVarOptionals.EnumQueryString.Value(), "")) + if r.enumQueryString != nil { + localVarQueryParams.Add("enum_query_string", parameterToString(*r.enumQueryString, "")) } - if localVarOptionals != nil && localVarOptionals.EnumQueryInteger.IsSet() { - localVarQueryParams.Add("enum_query_integer", parameterToString(localVarOptionals.EnumQueryInteger.Value(), "")) + if r.enumQueryInteger != nil { + localVarQueryParams.Add("enum_query_integer", parameterToString(*r.enumQueryInteger, "")) } - if localVarOptionals != nil && localVarOptionals.EnumQueryDouble.IsSet() { - localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) + if r.enumQueryDouble != nil { + localVarQueryParams.Add("enum_query_double", parameterToString(*r.enumQueryDouble, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -909,31 +1412,30 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { - localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") + if r.enumHeaderStringArray != nil { + localVarHeaderParams["enum_header_string_array"] = parameterToString(*r.enumHeaderStringArray, "csv") } - if localVarOptionals != nil && localVarOptionals.EnumHeaderString.IsSet() { - localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "") + if r.enumHeaderString != nil { + localVarHeaderParams["enum_header_string"] = parameterToString(*r.enumHeaderString, "") } - if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() { - localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "csv")) + if r.enumFormStringArray != nil { + localVarFormParams.Add("enum_form_string_array", parameterToString(*r.enumFormStringArray, "csv")) } - if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { - localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) + if r.enumFormString != nil { + localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -949,28 +1451,63 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption return localVarHTTPResponse, nil } -// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 +type ApiTestGroupParametersRequest struct { + ctx _context.Context + ApiService FakeApi + requiredStringGroup *int32 + requiredBooleanGroup *bool + requiredInt64Group *int64 + stringGroup *int32 + booleanGroup *bool + int64Group *int64 +} + +func (r ApiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup int32) ApiTestGroupParametersRequest { + r.requiredStringGroup = &requiredStringGroup + return r +} +func (r ApiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) ApiTestGroupParametersRequest { + r.requiredBooleanGroup = &requiredBooleanGroup + return r +} +func (r ApiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) ApiTestGroupParametersRequest { + r.requiredInt64Group = &requiredInt64Group + return r +} +func (r ApiTestGroupParametersRequest) StringGroup(stringGroup int32) ApiTestGroupParametersRequest { + r.stringGroup = &stringGroup + return r +} +func (r ApiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) ApiTestGroupParametersRequest { + r.booleanGroup = &booleanGroup + return r +} +func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroupParametersRequest { + r.int64Group = &int64Group + return r +} + +func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestGroupParametersExecute(r) } /* * TestGroupParameters Fake endpoint to test group parameters (optional) - * * Fake endpoint to test group parameters (optional) - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requiredStringGroup Required String in group parameters - * @param requiredBooleanGroup Required Boolean in group parameters - * @param requiredInt64Group Required Integer in group parameters - * @param optional nil or *TestGroupParametersOpts - Optional Parameters: - * @param "StringGroup" (optional.Int32) - String in group parameters - * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters - * @param "Int64Group" (optional.Int64) - Integer in group parameters + * @return ApiTestGroupParametersRequest */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { + return ApiTestGroupParametersRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -979,19 +1516,33 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) - localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) - if localVarOptionals != nil && localVarOptionals.StringGroup.IsSet() { - localVarQueryParams.Add("string_group", parameterToString(localVarOptionals.StringGroup.Value(), "")) + if r.requiredStringGroup == nil { + return nil, reportError("requiredStringGroup is required and must be specified") } - if localVarOptionals != nil && localVarOptionals.Int64Group.IsSet() { - localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) + if r.requiredBooleanGroup == nil { + return nil, reportError("requiredBooleanGroup is required and must be specified") + } + if r.requiredInt64Group == nil { + return nil, reportError("requiredInt64Group is required and must be specified") + } + + localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) + localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, "")) + if r.stringGroup != nil { + localVarQueryParams.Add("string_group", parameterToString(*r.stringGroup, "")) + } + if r.int64Group != nil { + localVarQueryParams.Add("int64_group", parameterToString(*r.int64Group, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1010,23 +1561,22 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") - if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { - localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") + localVarHeaderParams["required_boolean_group"] = parameterToString(*r.requiredBooleanGroup, "") + if r.booleanGroup != nil { + localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1042,13 +1592,37 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin return localVarHTTPResponse, nil } +type ApiTestInlineAdditionalPropertiesRequest struct { + ctx _context.Context + ApiService FakeApi + param *map[string]string +} + +func (r ApiTestInlineAdditionalPropertiesRequest) Param(param map[string]string) ApiTestInlineAdditionalPropertiesRequest { + r.param = ¶m + return r +} + +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestInlineAdditionalPropertiesExecute(r) +} + /* * TestInlineAdditionalProperties test inline additionalProperties - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param request body + * @return ApiTestInlineAdditionalPropertiesRequest */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, param map[string]string) (*_nethttp.Response, error) { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { + return ApiTestInlineAdditionalPropertiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -1057,11 +1631,19 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, pa localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/inline-additionalProperties" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.param == nil { + return nil, reportError("param is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1081,20 +1663,19 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, pa localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = ¶m - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.param + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1110,14 +1691,42 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, pa return localVarHTTPResponse, nil } +type ApiTestJsonFormDataRequest struct { + ctx _context.Context + ApiService FakeApi + param *string + param2 *string +} + +func (r ApiTestJsonFormDataRequest) Param(param string) ApiTestJsonFormDataRequest { + r.param = ¶m + return r +} +func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataRequest { + r.param2 = ¶m2 + return r +} + +func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestJsonFormDataExecute(r) +} + /* * TestJsonFormData test json serialization of form data - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param field1 - * @param param2 field2 + * @return ApiTestJsonFormDataRequest */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { + return ApiTestJsonFormDataRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1126,11 +1735,22 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/jsonFormData" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.param == nil { + return nil, reportError("param is required and must be specified") + } + if r.param2 == nil { + return nil, reportError("param2 is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -1149,21 +1769,20 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - localVarFormParams.Add("param", parameterToString(param, "")) - localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarFormParams.Add("param", parameterToString(*r.param, "")) + localVarFormParams.Add("param2", parameterToString(*r.param2, "")) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1179,19 +1798,58 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa return localVarHTTPResponse, nil } +type ApiTestQueryParameterCollectionFormatRequest struct { + ctx _context.Context + ApiService FakeApi + pipe *[]string + ioutil *[]string + http *[]string + url *[]string + context *[]string +} + +func (r ApiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) ApiTestQueryParameterCollectionFormatRequest { + r.pipe = &pipe + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) ApiTestQueryParameterCollectionFormatRequest { + r.ioutil = &ioutil + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Http(http []string) ApiTestQueryParameterCollectionFormatRequest { + r.http = &http + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Url(url []string) ApiTestQueryParameterCollectionFormatRequest { + r.url = &url + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) ApiTestQueryParameterCollectionFormatRequest { + r.context = &context + return r +} + +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestQueryParameterCollectionFormatExecute(r) +} + /* * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * * To test the collection format in query parameters - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pipe - * @param ioutil - * @param http - * @param url - * @param context + * @return ApiTestQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { + return ApiTestQueryParameterCollectionFormatRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1200,18 +1858,38 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/test-query-paramters" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.pipe == nil { + return nil, reportError("pipe is required and must be specified") + } + if r.ioutil == nil { + return nil, reportError("ioutil is required and must be specified") + } + if r.http == nil { + return nil, reportError("http is required and must be specified") + } + if r.url == nil { + return nil, reportError("url is required and must be specified") + } + if r.context == nil { + return nil, reportError("context is required and must be specified") + } - localVarQueryParams.Add("pipe", parameterToString(pipe, "csv")) - localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) - localVarQueryParams.Add("url", parameterToString(url, "csv")) + localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(*r.http, "ssv")) + localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) { - t:=context + t := *r.context if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { @@ -1238,19 +1916,18 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index a57ae520af5..9c80d94ba93 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" ) // Linger please @@ -22,19 +21,59 @@ var ( _ _context.Context ) +type FakeClassnameTags123Api interface { + + /* + * TestClassname To test class name in snake case + * To test class name in snake case + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestClassnameRequest + */ + TestClassname(ctx _context.Context) ApiTestClassnameRequest + + /* + * TestClassnameExecute executes the request + * @return Client + */ + TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) +} + // FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service +type ApiTestClassnameRequest struct { + ctx _context.Context + ApiService FakeClassnameTags123Api + body *Client +} + +func (r ApiTestClassnameRequest) Body(body Client) ApiTestClassnameRequest { + r.body = &body + return r +} + +func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.TestClassnameExecute(r) +} + /* * TestClassname To test class name in snake case - * * To test class name in snake case - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body client model + * @return ApiTestClassnameRequest + */ +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { + return ApiTestClassnameRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, body Client) (Client, *_nethttp.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -44,11 +83,19 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, bod localVarReturnValue Client ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake_classname_test" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake_classname_test" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -68,32 +115,33 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, bod localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - if ctx != nil { + localVarPostBody = r.body + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["api_key_query"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("api_key_query", key) } - localVarQueryParams.Add("api_key_query", key) } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index e4e0b0d4982..d1c359febfd 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -14,9 +14,7 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" "strings" - "github.com/antihax/optional" "os" ) @@ -25,16 +23,164 @@ var ( _ _context.Context ) +type PetApi interface { + + /* + * AddPet Add a new pet to the store + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiAddPetRequest + */ + AddPet(ctx _context.Context) ApiAddPetRequest + + /* + * AddPetExecute executes the request + */ + AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) + + /* + * DeletePet Deletes a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId Pet id to delete + * @return ApiDeletePetRequest + */ + DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest + + /* + * DeletePetExecute executes the request + */ + DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) + + /* + * FindPetsByStatus Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFindPetsByStatusRequest + */ + FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest + + /* + * FindPetsByStatusExecute executes the request + * @return []Pet + */ + FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) + + /* + * FindPetsByTags Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFindPetsByTagsRequest + */ + FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest + + /* + * FindPetsByTagsExecute executes the request + * @return []Pet + */ + FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) + + /* + * GetPetById Find pet by ID + * Returns a single pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to return + * @return ApiGetPetByIdRequest + */ + GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest + + /* + * GetPetByIdExecute executes the request + * @return Pet + */ + GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) + + /* + * UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiUpdatePetRequest + */ + UpdatePet(ctx _context.Context) ApiUpdatePetRequest + + /* + * UpdatePetExecute executes the request + */ + UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) + + /* + * UpdatePetWithForm Updates a pet in the store with form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet that needs to be updated + * @return ApiUpdatePetWithFormRequest + */ + UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest + + /* + * UpdatePetWithFormExecute executes the request + */ + UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) + + /* + * UploadFile uploads an image + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to update + * @return ApiUploadFileRequest + */ + UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest + + /* + * UploadFileExecute executes the request + * @return ApiResponse + */ + UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) + + /* + * UploadFileWithRequiredFile uploads an image (required) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to update + * @return ApiUploadFileWithRequiredFileRequest + */ + UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest + + /* + * UploadFileWithRequiredFileExecute executes the request + * @return ApiResponse + */ + UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) +} + // PetApiService PetApi service type PetApiService service +type ApiAddPetRequest struct { + ctx _context.Context + ApiService PetApi + body *Pet +} + +func (r ApiAddPetRequest) Body(body Pet) ApiAddPetRequest { + r.body = &body + return r +} + +func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.AddPetExecute(r) +} + /* * AddPet Add a new pet to the store - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Pet object that needs to be added to the store + * @return ApiAddPetRequest */ -func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { +func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { + return ApiAddPetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -43,11 +189,19 @@ func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Respon localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -67,20 +221,19 @@ func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Respon localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -96,20 +249,40 @@ func (a *PetApiService) AddPet(ctx _context.Context, body Pet) (*_nethttp.Respon return localVarHTTPResponse, nil } -// DeletePetOpts Optional parameters for the method 'DeletePet' -type DeletePetOpts struct { - ApiKey optional.String +type ApiDeletePetRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + apiKey *string +} + +func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { + r.apiKey = &apiKey + return r +} + +func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeletePetExecute(r) } /* * DeletePet Deletes a pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete - * @param optional nil or *DeletePetOpts - Optional Parameters: - * @param "ApiKey" (optional.String) - + * @return ApiDeletePetRequest */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { + return ApiDeletePetRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -118,9 +291,13 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -143,22 +320,21 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { - localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") + if r.apiKey != nil { + localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -174,16 +350,39 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt return localVarHTTPResponse, nil } +type ApiFindPetsByStatusRequest struct { + ctx _context.Context + ApiService PetApi + status *[]string +} + +func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusRequest { + r.status = &status + return r +} + +func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { + return r.ApiService.FindPetsByStatusExecute(r) +} + /* * FindPetsByStatus Finds Pets by status - * * Multiple status values can be provided with comma separated strings - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param status Status values that need to be considered for filter + * @return ApiFindPetsByStatusRequest + */ +func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { + return ApiFindPetsByStatusRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -193,13 +392,21 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) localVarReturnValue []Pet ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/findByStatus" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.status == nil { + return localVarReturnValue, nil, reportError("status is required and must be specified") + } - localVarQueryParams.Add("status", parameterToString(status, "csv")) + localVarQueryParams.Add("status", parameterToString(*r.status, "csv")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -217,19 +424,18 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -254,16 +460,39 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) return localVarReturnValue, localVarHTTPResponse, nil } +type ApiFindPetsByTagsRequest struct { + ctx _context.Context + ApiService PetApi + tags *[]string +} + +func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { + r.tags = &tags + return r +} + +func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { + return r.ApiService.FindPetsByTagsExecute(r) +} + /* * FindPetsByTags Finds Pets by tags - * * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tags Tags to filter by + * @return ApiFindPetsByTagsRequest + */ +func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { + return ApiFindPetsByTagsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -273,13 +502,21 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P localVarReturnValue []Pet ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/findByTags" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/findByTags" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tags == nil { + return localVarReturnValue, nil, reportError("tags is required and must be specified") + } - localVarQueryParams.Add("tags", parameterToString(tags, "csv")) + localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,19 +534,18 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -334,16 +570,37 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetPetByIdRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 +} + + +func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { + return r.ApiService.GetPetByIdExecute(r) +} + /* * GetPetById Find pet by ID - * * Returns a single pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to return + * @return ApiGetPetByIdRequest + */ +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { + return ApiGetPetByIdRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request * @return Pet */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { +func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -353,9 +610,13 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne localVarReturnValue Pet ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -378,31 +639,32 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if ctx != nil { + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["api_key"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["api_key"] = key } - localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -427,13 +689,37 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne return localVarReturnValue, localVarHTTPResponse, nil } +type ApiUpdatePetRequest struct { + ctx _context.Context + ApiService PetApi + body *Pet +} + +func (r ApiUpdatePetRequest) Body(body Pet) ApiUpdatePetRequest { + r.body = &body + return r +} + +func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.UpdatePetExecute(r) +} + /* * UpdatePet Update an existing pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Pet object that needs to be added to the store + * @return ApiUpdatePetRequest */ -func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { + return ApiUpdatePetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -442,11 +728,19 @@ func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Res localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -466,20 +760,19 @@ func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Res localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -495,22 +788,45 @@ func (a *PetApiService) UpdatePet(ctx _context.Context, body Pet) (*_nethttp.Res return localVarHTTPResponse, nil } -// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String +type ApiUpdatePetWithFormRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + name *string + status *string +} + +func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormRequest { + r.name = &name + return r +} +func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest { + r.status = &status + return r +} + +func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.UpdatePetWithFormExecute(r) } /* * UpdatePetWithForm Updates a pet in the store with form data - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated - * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: - * @param "Name" (optional.String) - Updated name of the pet - * @param "Status" (optional.String) - Updated status of the pet + * @return ApiUpdatePetWithFormRequest */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { + return ApiUpdatePetWithFormRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -519,9 +835,13 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, loc localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -544,25 +864,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, loc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.Name.IsSet() { - localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + if r.name != nil { + localVarFormParams.Add("name", parameterToString(*r.name, "")) } - if localVarOptionals != nil && localVarOptionals.Status.IsSet() { - localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) + if r.status != nil { + localVarFormParams.Add("status", parameterToString(*r.status, "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -578,23 +897,46 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, loc return localVarHTTPResponse, nil } -// UploadFileOpts Optional parameters for the method 'UploadFile' -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface +type ApiUploadFileRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + additionalMetadata *string + file **os.File +} + +func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileRequest { + r.additionalMetadata = &additionalMetadata + return r +} +func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { + r.file = &file + return r +} + +func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFileExecute(r) } /* * UploadFile uploads an image - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param optional nil or *UploadFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server - * @param "File" (optional.Interface of *os.File) - file to upload + * @return ApiUploadFileRequest + */ +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { + return ApiUploadFileRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -604,9 +946,13 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp localVarReturnValue ApiResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}/uploadImage" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -629,17 +975,13 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { - localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + if r.additionalMetadata != nil { + localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } localVarFormFileName = "file" var localVarFile *os.File - if localVarOptionals != nil && localVarOptionals.File.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) - if !localVarFileOk { - return localVarReturnValue, nil, reportError("file should be *os.File") - } + if r.file != nil { + localVarFile = *r.file } if localVarFile != nil { fbs, _ := _ioutil.ReadAll(localVarFile) @@ -647,19 +989,18 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -684,22 +1025,46 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp return localVarReturnValue, localVarHTTPResponse, nil } -// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String +type ApiUploadFileWithRequiredFileRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + requiredFile **os.File + additionalMetadata *string +} + +func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) ApiUploadFileWithRequiredFileRequest { + r.requiredFile = &requiredFile + return r +} +func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest { + r.additionalMetadata = &additionalMetadata + return r +} + +func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFileWithRequiredFileExecute(r) } /* * UploadFileWithRequiredFile uploads an image (required) - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param requiredFile file to upload - * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server + * @return ApiUploadFileWithRequiredFileRequest + */ +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { + return ApiUploadFileWithRequiredFileRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -709,13 +1074,20 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i localVarReturnValue ApiResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.requiredFile == nil { + return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -734,30 +1106,29 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { - localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + if r.additionalMetadata != nil { + localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } localVarFormFileName = "requiredFile" - localVarFile := requiredFile + localVarFile := *r.requiredFile if localVarFile != nil { fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index d85adb59221..900593e388e 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" "strings" ) @@ -23,18 +22,98 @@ var ( _ _context.Context ) +type StoreApi interface { + + /* + * DeleteOrder Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param orderId ID of the order that needs to be deleted + * @return ApiDeleteOrderRequest + */ + DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest + + /* + * DeleteOrderExecute executes the request + */ + DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) + + /* + * GetInventory Returns pet inventories by status + * Returns a map of status codes to quantities + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiGetInventoryRequest + */ + GetInventory(ctx _context.Context) ApiGetInventoryRequest + + /* + * GetInventoryExecute executes the request + * @return map[string]int32 + */ + GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) + + /* + * GetOrderById Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param orderId ID of pet that needs to be fetched + * @return ApiGetOrderByIdRequest + */ + GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest + + /* + * GetOrderByIdExecute executes the request + * @return Order + */ + GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) + + /* + * PlaceOrder Place an order for a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiPlaceOrderRequest + */ + PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest + + /* + * PlaceOrderExecute executes the request + * @return Order + */ + PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) +} + // StoreApiService StoreApi service type StoreApiService service +type ApiDeleteOrderRequest struct { + ctx _context.Context + ApiService StoreApi + orderId string +} + + +func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeleteOrderExecute(r) +} + /* * DeleteOrder Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of the order that needs to be deleted + * @return ApiDeleteOrderRequest */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { + return ApiDeleteOrderRequest{ + ApiService: a, + ctx: ctx, + orderId: orderId, + } +} + +/* + * Execute executes the request + */ +func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -43,9 +122,13 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(orderId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -68,19 +151,18 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -96,15 +178,34 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n return localVarHTTPResponse, nil } +type ApiGetInventoryRequest struct { + ctx _context.Context + ApiService StoreApi +} + + +func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { + return r.ApiService.GetInventoryExecute(r) +} + /* * GetInventory Returns pet inventories by status - * * Returns a map of status codes to quantities - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiGetInventoryRequest + */ +func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { + return ApiGetInventoryRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return map[string]int32 */ -func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { +func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -114,8 +215,13 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, localVarReturnValue map[string]int32 ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/inventory" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/inventory" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -137,31 +243,32 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if ctx != nil { + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["api_key"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["api_key"] = key } - localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -186,16 +293,37 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetOrderByIdRequest struct { + ctx _context.Context + ApiService StoreApi + orderId int64 +} + + +func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { + return r.ApiService.GetOrderByIdExecute(r) +} + /* * GetOrderById Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of pet that needs to be fetched + * @return ApiGetOrderByIdRequest + */ +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { + return ApiGetOrderByIdRequest{ + ApiService: a, + ctx: ctx, + orderId: orderId, + } +} + +/* + * Execute executes the request * @return Order */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -205,17 +333,21 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord localVarReturnValue Order ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(orderId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if orderId < 1 { + if r.orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } - if orderId > 5 { + if r.orderId > 5 { return localVarReturnValue, nil, reportError("orderId must be less than 5") } @@ -236,19 +368,18 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -273,14 +404,38 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord return localVarReturnValue, localVarHTTPResponse, nil } +type ApiPlaceOrderRequest struct { + ctx _context.Context + ApiService StoreApi + body *Order +} + +func (r ApiPlaceOrderRequest) Body(body Order) ApiPlaceOrderRequest { + r.body = &body + return r +} + +func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { + return r.ApiService.PlaceOrderExecute(r) +} + /* * PlaceOrder Place an order for a pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body order placed for purchasing the pet + * @return ApiPlaceOrderRequest + */ +func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { + return ApiPlaceOrderRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Order */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -290,11 +445,19 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, * localVarReturnValue Order ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/order" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -314,20 +477,19 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, * localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 2ac2969f714..3f3814d618b 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" "strings" ) @@ -23,18 +22,148 @@ var ( _ _context.Context ) +type UserApi interface { + + /* + * CreateUser Create user + * This can only be done by the logged in user. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateUserRequest + */ + CreateUser(ctx _context.Context) ApiCreateUserRequest + + /* + * CreateUserExecute executes the request + */ + CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) + + /* + * CreateUsersWithArrayInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateUsersWithArrayInputRequest + */ + CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest + + /* + * CreateUsersWithArrayInputExecute executes the request + */ + CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) + + /* + * CreateUsersWithListInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateUsersWithListInputRequest + */ + CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest + + /* + * CreateUsersWithListInputExecute executes the request + */ + CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) + + /* + * DeleteUser Delete user + * This can only be done by the logged in user. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The name that needs to be deleted + * @return ApiDeleteUserRequest + */ + DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest + + /* + * DeleteUserExecute executes the request + */ + DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) + + /* + * GetUserByName Get user by user name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiGetUserByNameRequest + */ + GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest + + /* + * GetUserByNameExecute executes the request + * @return User + */ + GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) + + /* + * LoginUser Logs user into the system + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLoginUserRequest + */ + LoginUser(ctx _context.Context) ApiLoginUserRequest + + /* + * LoginUserExecute executes the request + * @return string + */ + LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) + + /* + * LogoutUser Logs out current logged in user session + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLogoutUserRequest + */ + LogoutUser(ctx _context.Context) ApiLogoutUserRequest + + /* + * LogoutUserExecute executes the request + */ + LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) + + /* + * UpdateUser Updated user + * This can only be done by the logged in user. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username name that need to be deleted + * @return ApiUpdateUserRequest + */ + UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest + + /* + * UpdateUserExecute executes the request + */ + UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) +} + // UserApiService UserApi service type UserApiService service +type ApiCreateUserRequest struct { + ctx _context.Context + ApiService UserApi + body *User +} + +func (r ApiCreateUserRequest) Body(body User) ApiCreateUserRequest { + r.body = &body + return r +} + +func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateUserExecute(r) +} + /* * CreateUser Create user - * * This can only be done by the logged in user. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body Created user object + * @return ApiCreateUserRequest */ -func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -43,11 +172,19 @@ func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp. localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -67,20 +204,19 @@ func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp. localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -96,13 +232,37 @@ func (a *UserApiService) CreateUser(ctx _context.Context, body User) (*_nethttp. return localVarHTTPResponse, nil } +type ApiCreateUsersWithArrayInputRequest struct { + ctx _context.Context + ApiService UserApi + body *[]User +} + +func (r ApiCreateUsersWithArrayInputRequest) Body(body []User) ApiCreateUsersWithArrayInputRequest { + r.body = &body + return r +} + +func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateUsersWithArrayInputExecute(r) +} + /* * CreateUsersWithArrayInput Creates list of users with given input array - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body List of user object + * @return ApiCreateUsersWithArrayInputRequest */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { + return ApiCreateUsersWithArrayInputRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -111,11 +271,19 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body [] localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/createWithArray" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/createWithArray" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -135,20 +303,19 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body [] localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -164,13 +331,37 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, body [] return localVarHTTPResponse, nil } +type ApiCreateUsersWithListInputRequest struct { + ctx _context.Context + ApiService UserApi + body *[]User +} + +func (r ApiCreateUsersWithListInputRequest) Body(body []User) ApiCreateUsersWithListInputRequest { + r.body = &body + return r +} + +func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateUsersWithListInputExecute(r) +} + /* * CreateUsersWithListInput Creates list of users with given input array - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param body List of user object + * @return ApiCreateUsersWithListInputRequest */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []User) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { + return ApiCreateUsersWithListInputRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -179,11 +370,19 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []U localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/createWithList" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/createWithList" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -203,20 +402,19 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []U localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -232,15 +430,36 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, body []U return localVarHTTPResponse, nil } +type ApiDeleteUserRequest struct { + ctx _context.Context + ApiService UserApi + username string +} + + +func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + /* * DeleteUser Delete user - * * This can only be done by the logged in user. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be deleted + * @return ApiDeleteUserRequest */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -249,9 +468,13 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -274,19 +497,18 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -302,14 +524,36 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne return localVarHTTPResponse, nil } +type ApiGetUserByNameRequest struct { + ctx _context.Context + ApiService UserApi + username string +} + + +func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { + return r.ApiService.GetUserByNameExecute(r) +} + /* * GetUserByName Get user by user name - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiGetUserByNameRequest + */ +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { + return ApiGetUserByNameRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +/* + * Execute executes the request * @return User */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { +func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -319,9 +563,13 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U localVarReturnValue User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -344,19 +592,18 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -381,15 +628,43 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U return localVarReturnValue, localVarHTTPResponse, nil } +type ApiLoginUserRequest struct { + ctx _context.Context + ApiService UserApi + username *string + password *string +} + +func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest { + r.username = &username + return r +} +func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { + r.password = &password + return r +} + +func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { + return r.ApiService.LoginUserExecute(r) +} + /* * LoginUser Logs user into the system - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The user name for login - * @param password The password for login in clear text + * @return ApiLoginUserRequest + */ +func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { + return ApiLoginUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return string */ -func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { +func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -399,14 +674,25 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo localVarReturnValue string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/login" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/login" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.username == nil { + return localVarReturnValue, nil, reportError("username is required and must be specified") + } + if r.password == nil { + return localVarReturnValue, nil, reportError("password is required and must be specified") + } - localVarQueryParams.Add("username", parameterToString(username, "")) - localVarQueryParams.Add("password", parameterToString(password, "")) + localVarQueryParams.Add("username", parameterToString(*r.username, "")) + localVarQueryParams.Add("password", parameterToString(*r.password, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -424,19 +710,18 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -461,12 +746,32 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo return localVarReturnValue, localVarHTTPResponse, nil } +type ApiLogoutUserRequest struct { + ctx _context.Context + ApiService UserApi +} + + +func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.LogoutUserExecute(r) +} + /* * LogoutUser Logs out current logged in user session - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLogoutUserRequest */ -func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { +func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { + return ApiLogoutUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -475,8 +780,13 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/logout" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/logout" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -498,19 +808,18 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -526,16 +835,41 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e return localVarHTTPResponse, nil } +type ApiUpdateUserRequest struct { + ctx _context.Context + ApiService UserApi + username string + body *User +} + +func (r ApiUpdateUserRequest) Body(body User) ApiUpdateUserRequest { + r.body = &body + return r +} + +func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.UpdateUserExecute(r) +} + /* * UpdateUser Updated user - * * This can only be done by the logged in user. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username name that need to be deleted - * @param body Updated user object + * @return ApiUpdateUserRequest */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body User) (*_nethttp.Response, error) { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -544,13 +878,20 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -570,20 +911,19 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string, body localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &body - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 769e38acab3..3c87567745c 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -17,7 +17,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "mime/multipart" "net/http" @@ -36,7 +35,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) @@ -48,17 +47,17 @@ type APIClient struct { // API Services - AnotherFakeApi *AnotherFakeApiService + AnotherFakeApi AnotherFakeApi - FakeApi *FakeApiService + FakeApi FakeApi - FakeClassnameTags123Api *FakeClassnameTags123ApiService + FakeClassnameTags123Api FakeClassnameTags123Api - PetApi *PetApiService + PetApi PetApi - StoreApi *StoreApiService + StoreApi StoreApi - UserApi *UserApiService + UserApi UserApi } type service struct { @@ -176,9 +175,9 @@ func parameterToJson(obj interface{}) (string, error) { // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } @@ -195,15 +194,9 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } log.Printf("\n%s\n", string(dump)) } - return resp, err } -// ChangeBasePath changes base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior func (c *APIClient) GetConfig() *Configuration { @@ -370,7 +363,6 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - return localVarRequest, nil } @@ -382,15 +374,6 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } - if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - _, err = (*f).Seek(0, io.SeekStart) - return - } if xmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err @@ -398,7 +381,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if err = json.Unmarshal(b, v); err != nil { + if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err!= nil { + return err + } + } else { + errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil diff --git a/samples/client/petstore/go/go-petstore/configuration.go b/samples/client/petstore/go/go-petstore/configuration.go index 4a35e840836..4c503f92637 100644 --- a/samples/client/petstore/go/go-petstore/configuration.go +++ b/samples/client/petstore/go/go-petstore/configuration.go @@ -10,6 +10,7 @@ package petstore import ( + "context" "fmt" "net/http" "strings" @@ -35,9 +36,23 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -52,7 +67,6 @@ type APIKey struct { Prefix string } - // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -62,36 +76,40 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - Url string + URL string Description string Variables map[string]ServerVariable } +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + // Configuration stores the configuration of the API client type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers []ServerConfiguration - HTTPClient *http.Client + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client } // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://petstore.swagger.io:80/v2", - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: []ServerConfiguration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ { - Url: "http://petstore.swagger.io:80/v2", + URL: "http://petstore.swagger.io:80/v2", Description: "No description provided", }, }, + OperationServers: map[string]ServerConfigurations{ + }, } return cfg } @@ -101,13 +119,13 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } -// ServerUrl returns URL based on server settings -func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { - if index < 0 || len(c.Servers) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) } - server := c.Servers[index] - url := server.Url + server := sc[index] + url := server.URL // go through variables and replace placeholders for name, variable := range server.Variables { @@ -128,3 +146,84 @@ func (c *Configuration) ServerUrl(index int, variables map[string]string) (strin } return url, nil } + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesAnyType.md index eadec3142ce..bcce58bb763 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesAnyType.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesAnyType + +`func NewAdditionalPropertiesAnyType() *AdditionalPropertiesAnyType` + +NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesAnyTypeWithDefaults + +`func NewAdditionalPropertiesAnyTypeWithDefaults() *AdditionalPropertiesAnyType` + +NewAdditionalPropertiesAnyTypeWithDefaults instantiates a new AdditionalPropertiesAnyType object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesAnyType) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesAnyType) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesAnyType) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesAnyType) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesArray.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesArray.md index 0c37598aeb2..9b01a34cbbf 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesArray.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesArray + +`func NewAdditionalPropertiesArray() *AdditionalPropertiesArray` + +NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesArrayWithDefaults + +`func NewAdditionalPropertiesArrayWithDefaults() *AdditionalPropertiesArray` + +NewAdditionalPropertiesArrayWithDefaults instantiates a new AdditionalPropertiesArray object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesArray) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesArray) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesArray) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesArray) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesBoolean.md index 7190fe8429b..da3ebcea97e 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesBoolean.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesBoolean + +`func NewAdditionalPropertiesBoolean() *AdditionalPropertiesBoolean` + +NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesBooleanWithDefaults + +`func NewAdditionalPropertiesBooleanWithDefaults() *AdditionalPropertiesBoolean` + +NewAdditionalPropertiesBooleanWithDefaults instantiates a new AdditionalPropertiesBoolean object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesBoolean) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesBoolean) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesBoolean) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesBoolean) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md index 0dd3f328f41..a035ff98c8f 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md @@ -4,17 +4,312 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapString** | **map[string]string** | | [optional] -**MapNumber** | **map[string]float32** | | [optional] -**MapInteger** | **map[string]int32** | | [optional] -**MapBoolean** | **map[string]bool** | | [optional] -**MapArrayInteger** | [**map[string][]int32**](array.md) | | [optional] -**MapArrayAnytype** | [**map[string][]map[string]interface{}**](array.md) | | [optional] -**MapMapString** | [**map[string]map[string]string**](map.md) | | [optional] -**MapMapAnytype** | [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] -**Anytype1** | **map[string]interface{}** | | [optional] -**Anytype2** | **map[string]interface{}** | | [optional] -**Anytype3** | **map[string]interface{}** | | [optional] +**MapString** | Pointer to **map[string]string** | | [optional] +**MapNumber** | Pointer to **map[string]float32** | | [optional] +**MapInteger** | Pointer to **map[string]int32** | | [optional] +**MapBoolean** | Pointer to **map[string]bool** | | [optional] +**MapArrayInteger** | Pointer to [**map[string][]int32**](array.md) | | [optional] +**MapArrayAnytype** | Pointer to [**map[string][]map[string]interface{}**](array.md) | | [optional] +**MapMapString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapMapAnytype** | Pointer to [**map[string]map[string]map[string]interface{}**](map.md) | | [optional] +**Anytype1** | Pointer to **map[string]interface{}** | | [optional] +**Anytype2** | Pointer to **map[string]interface{}** | | [optional] +**Anytype3** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewAdditionalPropertiesClass + +`func NewAdditionalPropertiesClass() *AdditionalPropertiesClass` + +NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesClassWithDefaults + +`func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass` + +NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMapString + +`func (o *AdditionalPropertiesClass) GetMapString() map[string]string` + +GetMapString returns the MapString field if non-nil, zero value otherwise. + +### GetMapStringOk + +`func (o *AdditionalPropertiesClass) GetMapStringOk() (*map[string]string, bool)` + +GetMapStringOk returns a tuple with the MapString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapString + +`func (o *AdditionalPropertiesClass) SetMapString(v map[string]string)` + +SetMapString sets MapString field to given value. + +### HasMapString + +`func (o *AdditionalPropertiesClass) HasMapString() bool` + +HasMapString returns a boolean if a field has been set. + +### GetMapNumber + +`func (o *AdditionalPropertiesClass) GetMapNumber() map[string]float32` + +GetMapNumber returns the MapNumber field if non-nil, zero value otherwise. + +### GetMapNumberOk + +`func (o *AdditionalPropertiesClass) GetMapNumberOk() (*map[string]float32, bool)` + +GetMapNumberOk returns a tuple with the MapNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapNumber + +`func (o *AdditionalPropertiesClass) SetMapNumber(v map[string]float32)` + +SetMapNumber sets MapNumber field to given value. + +### HasMapNumber + +`func (o *AdditionalPropertiesClass) HasMapNumber() bool` + +HasMapNumber returns a boolean if a field has been set. + +### GetMapInteger + +`func (o *AdditionalPropertiesClass) GetMapInteger() map[string]int32` + +GetMapInteger returns the MapInteger field if non-nil, zero value otherwise. + +### GetMapIntegerOk + +`func (o *AdditionalPropertiesClass) GetMapIntegerOk() (*map[string]int32, bool)` + +GetMapIntegerOk returns a tuple with the MapInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapInteger + +`func (o *AdditionalPropertiesClass) SetMapInteger(v map[string]int32)` + +SetMapInteger sets MapInteger field to given value. + +### HasMapInteger + +`func (o *AdditionalPropertiesClass) HasMapInteger() bool` + +HasMapInteger returns a boolean if a field has been set. + +### GetMapBoolean + +`func (o *AdditionalPropertiesClass) GetMapBoolean() map[string]bool` + +GetMapBoolean returns the MapBoolean field if non-nil, zero value otherwise. + +### GetMapBooleanOk + +`func (o *AdditionalPropertiesClass) GetMapBooleanOk() (*map[string]bool, bool)` + +GetMapBooleanOk returns a tuple with the MapBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapBoolean + +`func (o *AdditionalPropertiesClass) SetMapBoolean(v map[string]bool)` + +SetMapBoolean sets MapBoolean field to given value. + +### HasMapBoolean + +`func (o *AdditionalPropertiesClass) HasMapBoolean() bool` + +HasMapBoolean returns a boolean if a field has been set. + +### GetMapArrayInteger + +`func (o *AdditionalPropertiesClass) GetMapArrayInteger() map[string][]int32` + +GetMapArrayInteger returns the MapArrayInteger field if non-nil, zero value otherwise. + +### GetMapArrayIntegerOk + +`func (o *AdditionalPropertiesClass) GetMapArrayIntegerOk() (*map[string][]int32, bool)` + +GetMapArrayIntegerOk returns a tuple with the MapArrayInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapArrayInteger + +`func (o *AdditionalPropertiesClass) SetMapArrayInteger(v map[string][]int32)` + +SetMapArrayInteger sets MapArrayInteger field to given value. + +### HasMapArrayInteger + +`func (o *AdditionalPropertiesClass) HasMapArrayInteger() bool` + +HasMapArrayInteger returns a boolean if a field has been set. + +### GetMapArrayAnytype + +`func (o *AdditionalPropertiesClass) GetMapArrayAnytype() map[string][]map[string]interface{}` + +GetMapArrayAnytype returns the MapArrayAnytype field if non-nil, zero value otherwise. + +### GetMapArrayAnytypeOk + +`func (o *AdditionalPropertiesClass) GetMapArrayAnytypeOk() (*map[string][]map[string]interface{}, bool)` + +GetMapArrayAnytypeOk returns a tuple with the MapArrayAnytype field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapArrayAnytype + +`func (o *AdditionalPropertiesClass) SetMapArrayAnytype(v map[string][]map[string]interface{})` + +SetMapArrayAnytype sets MapArrayAnytype field to given value. + +### HasMapArrayAnytype + +`func (o *AdditionalPropertiesClass) HasMapArrayAnytype() bool` + +HasMapArrayAnytype returns a boolean if a field has been set. + +### GetMapMapString + +`func (o *AdditionalPropertiesClass) GetMapMapString() map[string]map[string]string` + +GetMapMapString returns the MapMapString field if non-nil, zero value otherwise. + +### GetMapMapStringOk + +`func (o *AdditionalPropertiesClass) GetMapMapStringOk() (*map[string]map[string]string, bool)` + +GetMapMapStringOk returns a tuple with the MapMapString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapMapString + +`func (o *AdditionalPropertiesClass) SetMapMapString(v map[string]map[string]string)` + +SetMapMapString sets MapMapString field to given value. + +### HasMapMapString + +`func (o *AdditionalPropertiesClass) HasMapMapString() bool` + +HasMapMapString returns a boolean if a field has been set. + +### GetMapMapAnytype + +`func (o *AdditionalPropertiesClass) GetMapMapAnytype() map[string]map[string]map[string]interface{}` + +GetMapMapAnytype returns the MapMapAnytype field if non-nil, zero value otherwise. + +### GetMapMapAnytypeOk + +`func (o *AdditionalPropertiesClass) GetMapMapAnytypeOk() (*map[string]map[string]map[string]interface{}, bool)` + +GetMapMapAnytypeOk returns a tuple with the MapMapAnytype field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapMapAnytype + +`func (o *AdditionalPropertiesClass) SetMapMapAnytype(v map[string]map[string]map[string]interface{})` + +SetMapMapAnytype sets MapMapAnytype field to given value. + +### HasMapMapAnytype + +`func (o *AdditionalPropertiesClass) HasMapMapAnytype() bool` + +HasMapMapAnytype returns a boolean if a field has been set. + +### GetAnytype1 + +`func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{}` + +GetAnytype1 returns the Anytype1 field if non-nil, zero value otherwise. + +### GetAnytype1Ok + +`func (o *AdditionalPropertiesClass) GetAnytype1Ok() (*map[string]interface{}, bool)` + +GetAnytype1Ok returns a tuple with the Anytype1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAnytype1 + +`func (o *AdditionalPropertiesClass) SetAnytype1(v map[string]interface{})` + +SetAnytype1 sets Anytype1 field to given value. + +### HasAnytype1 + +`func (o *AdditionalPropertiesClass) HasAnytype1() bool` + +HasAnytype1 returns a boolean if a field has been set. + +### GetAnytype2 + +`func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{}` + +GetAnytype2 returns the Anytype2 field if non-nil, zero value otherwise. + +### GetAnytype2Ok + +`func (o *AdditionalPropertiesClass) GetAnytype2Ok() (*map[string]interface{}, bool)` + +GetAnytype2Ok returns a tuple with the Anytype2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAnytype2 + +`func (o *AdditionalPropertiesClass) SetAnytype2(v map[string]interface{})` + +SetAnytype2 sets Anytype2 field to given value. + +### HasAnytype2 + +`func (o *AdditionalPropertiesClass) HasAnytype2() bool` + +HasAnytype2 returns a boolean if a field has been set. + +### GetAnytype3 + +`func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{}` + +GetAnytype3 returns the Anytype3 field if non-nil, zero value otherwise. + +### GetAnytype3Ok + +`func (o *AdditionalPropertiesClass) GetAnytype3Ok() (*map[string]interface{}, bool)` + +GetAnytype3Ok returns a tuple with the Anytype3 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAnytype3 + +`func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{})` + +SetAnytype3 sets Anytype3 field to given value. + +### HasAnytype3 + +`func (o *AdditionalPropertiesClass) HasAnytype3() bool` + +HasAnytype3 returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesInteger.md index 34e6fca8fb0..68d29ef339a 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesInteger.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesInteger + +`func NewAdditionalPropertiesInteger() *AdditionalPropertiesInteger` + +NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesIntegerWithDefaults + +`func NewAdditionalPropertiesIntegerWithDefaults() *AdditionalPropertiesInteger` + +NewAdditionalPropertiesIntegerWithDefaults instantiates a new AdditionalPropertiesInteger object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesInteger) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesInteger) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesInteger) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesInteger) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesNumber.md index 6d41fd2315c..53fb9c858c0 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesNumber.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesNumber + +`func NewAdditionalPropertiesNumber() *AdditionalPropertiesNumber` + +NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesNumberWithDefaults + +`func NewAdditionalPropertiesNumberWithDefaults() *AdditionalPropertiesNumber` + +NewAdditionalPropertiesNumberWithDefaults instantiates a new AdditionalPropertiesNumber object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesNumber) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesNumber) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesNumber) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesNumber) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesObject.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesObject.md index b856de693b1..8444c127941 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesObject.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesObject + +`func NewAdditionalPropertiesObject() *AdditionalPropertiesObject` + +NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesObjectWithDefaults + +`func NewAdditionalPropertiesObjectWithDefaults() *AdditionalPropertiesObject` + +NewAdditionalPropertiesObjectWithDefaults instantiates a new AdditionalPropertiesObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesObject) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesObject) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesObject) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesObject) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesString.md b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesString.md index 69ad2065685..6a95762122b 100644 --- a/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/go/go-petstore/docs/AdditionalPropertiesString.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewAdditionalPropertiesString + +`func NewAdditionalPropertiesString() *AdditionalPropertiesString` + +NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesStringWithDefaults + +`func NewAdditionalPropertiesStringWithDefaults() *AdditionalPropertiesString` + +NewAdditionalPropertiesStringWithDefaults instantiates a new AdditionalPropertiesString object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *AdditionalPropertiesString) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AdditionalPropertiesString) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AdditionalPropertiesString) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AdditionalPropertiesString) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Animal.md b/samples/client/petstore/go/go-petstore/docs/Animal.md index 02d23377da6..293f75c5171 100644 --- a/samples/client/petstore/go/go-petstore/docs/Animal.md +++ b/samples/client/petstore/go/go-petstore/docs/Animal.md @@ -5,7 +5,72 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] +**Color** | Pointer to **string** | | [optional] [default to "red"] + +## Methods + +### NewAnimal + +`func NewAnimal(className string, ) *Animal` + +NewAnimal instantiates a new Animal object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAnimalWithDefaults + +`func NewAnimalWithDefaults() *Animal` + +NewAnimalWithDefaults instantiates a new Animal object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClassName + +`func (o *Animal) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Animal) GetClassNameOk() (*string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClassName + +`func (o *Animal) SetClassName(v string)` + +SetClassName sets ClassName field to given value. + + +### GetColor + +`func (o *Animal) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Animal) GetColorOk() (*string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetColor + +`func (o *Animal) SetColor(v string)` + +SetColor sets Color field to given value. + +### HasColor + +`func (o *Animal) HasColor() bool` + +HasColor returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index 2c22f8f1b30..669daa616b7 100644 --- a/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -10,19 +10,51 @@ Method | HTTP request | Description ## Call123TestSpecialTags -> Client Call123TestSpecialTags(ctx, body) +> Client Call123TestSpecialTags(ctx).Body(body).Execute() To test special tags -To test special tags and operation ID starting with number -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.Client{Client: "Client_example"} // Client | client model + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Call123TestSpecialTags`: Client + fmt.Fprintf(os.Stdout, "Response from `AnotherFakeApi.Call123TestSpecialTags`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCall123TestSpecialTagsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/ApiResponse.md b/samples/client/petstore/go/go-petstore/docs/ApiResponse.md index 41d28fb578c..877dacb4293 100644 --- a/samples/client/petstore/go/go-petstore/docs/ApiResponse.md +++ b/samples/client/petstore/go/go-petstore/docs/ApiResponse.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int32** | | [optional] -**Type** | **string** | | [optional] -**Message** | **string** | | [optional] +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] + +## Methods + +### NewApiResponse + +`func NewApiResponse() *ApiResponse` + +NewApiResponse instantiates a new ApiResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewApiResponseWithDefaults + +`func NewApiResponseWithDefaults() *ApiResponse` + +NewApiResponseWithDefaults instantiates a new ApiResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *ApiResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *ApiResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *ApiResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *ApiResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetType + +`func (o *ApiResponse) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ApiResponse) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ApiResponse) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ApiResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetMessage + +`func (o *ApiResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ApiResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ApiResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ApiResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md index 555213013b2..cb46da598b1 100644 --- a/samples/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | [**[][]float32**](array.md) | | [optional] +**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] + +## Methods + +### NewArrayOfArrayOfNumberOnly + +`func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly` + +NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayOfArrayOfNumberOnlyWithDefaults + +`func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly` + +NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32` + +GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. + +### GetArrayArrayNumberOk + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool)` + +GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32)` + +SetArrayArrayNumber sets ArrayArrayNumber field to given value. + +### HasArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool` + +HasArrayArrayNumber returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md b/samples/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md index 56618756dd7..f0aaaa443b3 100644 --- a/samples/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **[]float32** | | [optional] +**ArrayNumber** | Pointer to **[]float32** | | [optional] + +## Methods + +### NewArrayOfNumberOnly + +`func NewArrayOfNumberOnly() *ArrayOfNumberOnly` + +NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayOfNumberOnlyWithDefaults + +`func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly` + +NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArrayNumber + +`func (o *ArrayOfNumberOnly) GetArrayNumber() []float32` + +GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. + +### GetArrayNumberOk + +`func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool)` + +GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayNumber + +`func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32)` + +SetArrayNumber sets ArrayNumber field to given value. + +### HasArrayNumber + +`func (o *ArrayOfNumberOnly) HasArrayNumber() bool` + +HasArrayNumber returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/ArrayTest.md b/samples/client/petstore/go/go-petstore/docs/ArrayTest.md index 0da0bc52d2d..a0f8d7528c3 100644 --- a/samples/client/petstore/go/go-petstore/docs/ArrayTest.md +++ b/samples/client/petstore/go/go-petstore/docs/ArrayTest.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayOfString** | **[]string** | | [optional] -**ArrayArrayOfInteger** | [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | [**[][]ReadOnlyFirst**](array.md) | | [optional] +**ArrayOfString** | Pointer to **[]string** | | [optional] +**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] +**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] + +## Methods + +### NewArrayTest + +`func NewArrayTest() *ArrayTest` + +NewArrayTest instantiates a new ArrayTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayTestWithDefaults + +`func NewArrayTestWithDefaults() *ArrayTest` + +NewArrayTestWithDefaults instantiates a new ArrayTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArrayOfString + +`func (o *ArrayTest) GetArrayOfString() []string` + +GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. + +### GetArrayOfStringOk + +`func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool)` + +GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayOfString + +`func (o *ArrayTest) SetArrayOfString(v []string)` + +SetArrayOfString sets ArrayOfString field to given value. + +### HasArrayOfString + +`func (o *ArrayTest) HasArrayOfString() bool` + +HasArrayOfString returns a boolean if a field has been set. + +### GetArrayArrayOfInteger + +`func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64` + +GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. + +### GetArrayArrayOfIntegerOk + +`func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool)` + +GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayArrayOfInteger + +`func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64)` + +SetArrayArrayOfInteger sets ArrayArrayOfInteger field to given value. + +### HasArrayArrayOfInteger + +`func (o *ArrayTest) HasArrayArrayOfInteger() bool` + +HasArrayArrayOfInteger returns a boolean if a field has been set. + +### GetArrayArrayOfModel + +`func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst` + +GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. + +### GetArrayArrayOfModelOk + +`func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool)` + +GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayArrayOfModel + +`func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst)` + +SetArrayArrayOfModel sets ArrayArrayOfModel field to given value. + +### HasArrayArrayOfModel + +`func (o *ArrayTest) HasArrayArrayOfModel() bool` + +HasArrayArrayOfModel returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/BigCat.md b/samples/client/petstore/go/go-petstore/docs/BigCat.md index a23cd724fb9..fb9db929939 100644 --- a/samples/client/petstore/go/go-petstore/docs/BigCat.md +++ b/samples/client/petstore/go/go-petstore/docs/BigCat.md @@ -4,10 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Declawed** | **bool** | | [optional] -**Kind** | **string** | | [optional] +**Kind** | Pointer to **string** | | [optional] + +## Methods + +### NewBigCat + +`func NewBigCat() *BigCat` + +NewBigCat instantiates a new BigCat object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBigCatWithDefaults + +`func NewBigCatWithDefaults() *BigCat` + +NewBigCatWithDefaults instantiates a new BigCat object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKind + +`func (o *BigCat) GetKind() string` + +GetKind returns the Kind field if non-nil, zero value otherwise. + +### GetKindOk + +`func (o *BigCat) GetKindOk() (*string, bool)` + +GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKind + +`func (o *BigCat) SetKind(v string)` + +SetKind sets Kind field to given value. + +### HasKind + +`func (o *BigCat) HasKind() bool` + +HasKind returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md b/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md index 03d37ee1031..b237a6b2144 100644 --- a/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md +++ b/samples/client/petstore/go/go-petstore/docs/BigCatAllOf.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Kind** | **string** | | [optional] +**Kind** | Pointer to **string** | | [optional] + +## Methods + +### NewBigCatAllOf + +`func NewBigCatAllOf() *BigCatAllOf` + +NewBigCatAllOf instantiates a new BigCatAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBigCatAllOfWithDefaults + +`func NewBigCatAllOfWithDefaults() *BigCatAllOf` + +NewBigCatAllOfWithDefaults instantiates a new BigCatAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKind + +`func (o *BigCatAllOf) GetKind() string` + +GetKind returns the Kind field if non-nil, zero value otherwise. + +### GetKindOk + +`func (o *BigCatAllOf) GetKindOk() (*string, bool)` + +GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKind + +`func (o *BigCatAllOf) SetKind(v string)` + +SetKind sets Kind field to given value. + +### HasKind + +`func (o *BigCatAllOf) HasKind() bool` + +HasKind returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Capitalization.md b/samples/client/petstore/go/go-petstore/docs/Capitalization.md index 426b8eabd9b..3f37bb13e00 100644 --- a/samples/client/petstore/go/go-petstore/docs/Capitalization.md +++ b/samples/client/petstore/go/go-petstore/docs/Capitalization.md @@ -4,12 +4,182 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SmallCamel** | **string** | | [optional] -**CapitalCamel** | **string** | | [optional] -**SmallSnake** | **string** | | [optional] -**CapitalSnake** | **string** | | [optional] -**SCAETHFlowPoints** | **string** | | [optional] -**ATT_NAME** | **string** | Name of the pet | [optional] +**SmallCamel** | Pointer to **string** | | [optional] +**CapitalCamel** | Pointer to **string** | | [optional] +**SmallSnake** | Pointer to **string** | | [optional] +**CapitalSnake** | Pointer to **string** | | [optional] +**SCAETHFlowPoints** | Pointer to **string** | | [optional] +**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] + +## Methods + +### NewCapitalization + +`func NewCapitalization() *Capitalization` + +NewCapitalization instantiates a new Capitalization object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapitalizationWithDefaults + +`func NewCapitalizationWithDefaults() *Capitalization` + +NewCapitalizationWithDefaults instantiates a new Capitalization object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSmallCamel + +`func (o *Capitalization) GetSmallCamel() string` + +GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. + +### GetSmallCamelOk + +`func (o *Capitalization) GetSmallCamelOk() (*string, bool)` + +GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSmallCamel + +`func (o *Capitalization) SetSmallCamel(v string)` + +SetSmallCamel sets SmallCamel field to given value. + +### HasSmallCamel + +`func (o *Capitalization) HasSmallCamel() bool` + +HasSmallCamel returns a boolean if a field has been set. + +### GetCapitalCamel + +`func (o *Capitalization) GetCapitalCamel() string` + +GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. + +### GetCapitalCamelOk + +`func (o *Capitalization) GetCapitalCamelOk() (*string, bool)` + +GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapitalCamel + +`func (o *Capitalization) SetCapitalCamel(v string)` + +SetCapitalCamel sets CapitalCamel field to given value. + +### HasCapitalCamel + +`func (o *Capitalization) HasCapitalCamel() bool` + +HasCapitalCamel returns a boolean if a field has been set. + +### GetSmallSnake + +`func (o *Capitalization) GetSmallSnake() string` + +GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. + +### GetSmallSnakeOk + +`func (o *Capitalization) GetSmallSnakeOk() (*string, bool)` + +GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSmallSnake + +`func (o *Capitalization) SetSmallSnake(v string)` + +SetSmallSnake sets SmallSnake field to given value. + +### HasSmallSnake + +`func (o *Capitalization) HasSmallSnake() bool` + +HasSmallSnake returns a boolean if a field has been set. + +### GetCapitalSnake + +`func (o *Capitalization) GetCapitalSnake() string` + +GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. + +### GetCapitalSnakeOk + +`func (o *Capitalization) GetCapitalSnakeOk() (*string, bool)` + +GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapitalSnake + +`func (o *Capitalization) SetCapitalSnake(v string)` + +SetCapitalSnake sets CapitalSnake field to given value. + +### HasCapitalSnake + +`func (o *Capitalization) HasCapitalSnake() bool` + +HasCapitalSnake returns a boolean if a field has been set. + +### GetSCAETHFlowPoints + +`func (o *Capitalization) GetSCAETHFlowPoints() string` + +GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. + +### GetSCAETHFlowPointsOk + +`func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool)` + +GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSCAETHFlowPoints + +`func (o *Capitalization) SetSCAETHFlowPoints(v string)` + +SetSCAETHFlowPoints sets SCAETHFlowPoints field to given value. + +### HasSCAETHFlowPoints + +`func (o *Capitalization) HasSCAETHFlowPoints() bool` + +HasSCAETHFlowPoints returns a boolean if a field has been set. + +### GetATT_NAME + +`func (o *Capitalization) GetATT_NAME() string` + +GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. + +### GetATT_NAMEOk + +`func (o *Capitalization) GetATT_NAMEOk() (*string, bool)` + +GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetATT_NAME + +`func (o *Capitalization) SetATT_NAME(v string)` + +SetATT_NAME sets ATT_NAME field to given value. + +### HasATT_NAME + +`func (o *Capitalization) HasATT_NAME() bool` + +HasATT_NAME returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Cat.md b/samples/client/petstore/go/go-petstore/docs/Cat.md index 1ef1f095e94..9f7f4f783cb 100644 --- a/samples/client/petstore/go/go-petstore/docs/Cat.md +++ b/samples/client/petstore/go/go-petstore/docs/Cat.md @@ -4,9 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Declawed** | **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### NewCat + +`func NewCat() *Cat` + +NewCat instantiates a new Cat object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCatWithDefaults + +`func NewCatWithDefaults() *Cat` + +NewCatWithDefaults instantiates a new Cat object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeclawed + +`func (o *Cat) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *Cat) GetDeclawedOk() (*bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeclawed + +`func (o *Cat) SetDeclawed(v bool)` + +SetDeclawed sets Declawed field to given value. + +### HasDeclawed + +`func (o *Cat) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/CatAllOf.md b/samples/client/petstore/go/go-petstore/docs/CatAllOf.md index c978cee0417..be0cc6c8519 100644 --- a/samples/client/petstore/go/go-petstore/docs/CatAllOf.md +++ b/samples/client/petstore/go/go-petstore/docs/CatAllOf.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### NewCatAllOf + +`func NewCatAllOf() *CatAllOf` + +NewCatAllOf instantiates a new CatAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCatAllOfWithDefaults + +`func NewCatAllOfWithDefaults() *CatAllOf` + +NewCatAllOfWithDefaults instantiates a new CatAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeclawed + +`func (o *CatAllOf) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *CatAllOf) GetDeclawedOk() (*bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeclawed + +`func (o *CatAllOf) SetDeclawed(v bool)` + +SetDeclawed sets Declawed field to given value. + +### HasDeclawed + +`func (o *CatAllOf) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Category.md b/samples/client/petstore/go/go-petstore/docs/Category.md index 01e8344bd06..0d3f6d4ff22 100644 --- a/samples/client/petstore/go/go-petstore/docs/Category.md +++ b/samples/client/petstore/go/go-petstore/docs/Category.md @@ -4,8 +4,73 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Name** | **string** | | [default to default-name] +**Id** | Pointer to **int64** | | [optional] +**Name** | **string** | | [default to "default-name"] + +## Methods + +### NewCategory + +`func NewCategory(name string, ) *Category` + +NewCategory instantiates a new Category object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCategoryWithDefaults + +`func NewCategoryWithDefaults() *Category` + +NewCategoryWithDefaults instantiates a new Category object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Category) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Category) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Category) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Category) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Category) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Category) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Category) SetName(v string)` + +SetName sets Name field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/ClassModel.md b/samples/client/petstore/go/go-petstore/docs/ClassModel.md index 0b925cebb1f..51954107bc0 100644 --- a/samples/client/petstore/go/go-petstore/docs/ClassModel.md +++ b/samples/client/petstore/go/go-petstore/docs/ClassModel.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Class** | **string** | | [optional] +**Class** | Pointer to **string** | | [optional] + +## Methods + +### NewClassModel + +`func NewClassModel() *ClassModel` + +NewClassModel instantiates a new ClassModel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClassModelWithDefaults + +`func NewClassModelWithDefaults() *ClassModel` + +NewClassModelWithDefaults instantiates a new ClassModel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClass + +`func (o *ClassModel) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *ClassModel) GetClassOk() (*string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClass + +`func (o *ClassModel) SetClass(v string)` + +SetClass sets Class field to given value. + +### HasClass + +`func (o *ClassModel) HasClass() bool` + +HasClass returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Client.md b/samples/client/petstore/go/go-petstore/docs/Client.md index 551da852eec..e24e7c05be5 100644 --- a/samples/client/petstore/go/go-petstore/docs/Client.md +++ b/samples/client/petstore/go/go-petstore/docs/Client.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Client** | **string** | | [optional] +**Client** | Pointer to **string** | | [optional] + +## Methods + +### NewClient + +`func NewClient() *Client` + +NewClient instantiates a new Client object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClientWithDefaults + +`func NewClientWithDefaults() *Client` + +NewClientWithDefaults instantiates a new Client object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClient + +`func (o *Client) GetClient() string` + +GetClient returns the Client field if non-nil, zero value otherwise. + +### GetClientOk + +`func (o *Client) GetClientOk() (*string, bool)` + +GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClient + +`func (o *Client) SetClient(v string)` + +SetClient sets Client field to given value. + +### HasClient + +`func (o *Client) HasClient() bool` + +HasClient returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Dog.md b/samples/client/petstore/go/go-petstore/docs/Dog.md index ff35dd5cdca..edf746aaf55 100644 --- a/samples/client/petstore/go/go-petstore/docs/Dog.md +++ b/samples/client/petstore/go/go-petstore/docs/Dog.md @@ -4,9 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Breed** | **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### NewDog + +`func NewDog() *Dog` + +NewDog instantiates a new Dog object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDogWithDefaults + +`func NewDogWithDefaults() *Dog` + +NewDogWithDefaults instantiates a new Dog object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBreed + +`func (o *Dog) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *Dog) GetBreedOk() (*string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBreed + +`func (o *Dog) SetBreed(v string)` + +SetBreed sets Breed field to given value. + +### HasBreed + +`func (o *Dog) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/DogAllOf.md b/samples/client/petstore/go/go-petstore/docs/DogAllOf.md index b87153e9265..3ed4dfa5ea2 100644 --- a/samples/client/petstore/go/go-petstore/docs/DogAllOf.md +++ b/samples/client/petstore/go/go-petstore/docs/DogAllOf.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Breed** | **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### NewDogAllOf + +`func NewDogAllOf() *DogAllOf` + +NewDogAllOf instantiates a new DogAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDogAllOfWithDefaults + +`func NewDogAllOfWithDefaults() *DogAllOf` + +NewDogAllOfWithDefaults instantiates a new DogAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBreed + +`func (o *DogAllOf) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *DogAllOf) GetBreedOk() (*string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBreed + +`func (o *DogAllOf) SetBreed(v string)` + +SetBreed sets Breed field to given value. + +### HasBreed + +`func (o *DogAllOf) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/EnumArrays.md b/samples/client/petstore/go/go-petstore/docs/EnumArrays.md index 3021f881830..28011e23f56 100644 --- a/samples/client/petstore/go/go-petstore/docs/EnumArrays.md +++ b/samples/client/petstore/go/go-petstore/docs/EnumArrays.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustSymbol** | **string** | | [optional] -**ArrayEnum** | **[]string** | | [optional] +**JustSymbol** | Pointer to **string** | | [optional] +**ArrayEnum** | Pointer to **[]string** | | [optional] + +## Methods + +### NewEnumArrays + +`func NewEnumArrays() *EnumArrays` + +NewEnumArrays instantiates a new EnumArrays object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnumArraysWithDefaults + +`func NewEnumArraysWithDefaults() *EnumArrays` + +NewEnumArraysWithDefaults instantiates a new EnumArrays object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetJustSymbol + +`func (o *EnumArrays) GetJustSymbol() string` + +GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. + +### GetJustSymbolOk + +`func (o *EnumArrays) GetJustSymbolOk() (*string, bool)` + +GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJustSymbol + +`func (o *EnumArrays) SetJustSymbol(v string)` + +SetJustSymbol sets JustSymbol field to given value. + +### HasJustSymbol + +`func (o *EnumArrays) HasJustSymbol() bool` + +HasJustSymbol returns a boolean if a field has been set. + +### GetArrayEnum + +`func (o *EnumArrays) GetArrayEnum() []string` + +GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. + +### GetArrayEnumOk + +`func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool)` + +GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayEnum + +`func (o *EnumArrays) SetArrayEnum(v []string)` + +SetArrayEnum sets ArrayEnum field to given value. + +### HasArrayEnum + +`func (o *EnumArrays) HasArrayEnum() bool` + +HasArrayEnum returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/EnumClass.md b/samples/client/petstore/go/go-petstore/docs/EnumClass.md index c6932388c06..e231f94bd73 100644 --- a/samples/client/petstore/go/go-petstore/docs/EnumClass.md +++ b/samples/client/petstore/go/go-petstore/docs/EnumClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/EnumTest.md b/samples/client/petstore/go/go-petstore/docs/EnumTest.md index eeec09b66b4..131b8e110a0 100644 --- a/samples/client/petstore/go/go-petstore/docs/EnumTest.md +++ b/samples/client/petstore/go/go-petstore/docs/EnumTest.md @@ -4,11 +4,151 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | **string** | | [optional] +**EnumString** | Pointer to **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int32** | | [optional] -**EnumNumber** | **float64** | | [optional] -**OuterEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**EnumInteger** | Pointer to **int32** | | [optional] +**EnumNumber** | Pointer to **float64** | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] + +## Methods + +### NewEnumTest + +`func NewEnumTest(enumStringRequired string, ) *EnumTest` + +NewEnumTest instantiates a new EnumTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnumTestWithDefaults + +`func NewEnumTestWithDefaults() *EnumTest` + +NewEnumTestWithDefaults instantiates a new EnumTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEnumString + +`func (o *EnumTest) GetEnumString() string` + +GetEnumString returns the EnumString field if non-nil, zero value otherwise. + +### GetEnumStringOk + +`func (o *EnumTest) GetEnumStringOk() (*string, bool)` + +GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumString + +`func (o *EnumTest) SetEnumString(v string)` + +SetEnumString sets EnumString field to given value. + +### HasEnumString + +`func (o *EnumTest) HasEnumString() bool` + +HasEnumString returns a boolean if a field has been set. + +### GetEnumStringRequired + +`func (o *EnumTest) GetEnumStringRequired() string` + +GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. + +### GetEnumStringRequiredOk + +`func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool)` + +GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumStringRequired + +`func (o *EnumTest) SetEnumStringRequired(v string)` + +SetEnumStringRequired sets EnumStringRequired field to given value. + + +### GetEnumInteger + +`func (o *EnumTest) GetEnumInteger() int32` + +GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. + +### GetEnumIntegerOk + +`func (o *EnumTest) GetEnumIntegerOk() (*int32, bool)` + +GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumInteger + +`func (o *EnumTest) SetEnumInteger(v int32)` + +SetEnumInteger sets EnumInteger field to given value. + +### HasEnumInteger + +`func (o *EnumTest) HasEnumInteger() bool` + +HasEnumInteger returns a boolean if a field has been set. + +### GetEnumNumber + +`func (o *EnumTest) GetEnumNumber() float64` + +GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. + +### GetEnumNumberOk + +`func (o *EnumTest) GetEnumNumberOk() (*float64, bool)` + +GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumNumber + +`func (o *EnumTest) SetEnumNumber(v float64)` + +SetEnumNumber sets EnumNumber field to given value. + +### HasEnumNumber + +`func (o *EnumTest) HasEnumNumber() bool` + +HasEnumNumber returns a boolean if a field has been set. + +### GetOuterEnum + +`func (o *EnumTest) GetOuterEnum() OuterEnum` + +GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. + +### GetOuterEnumOk + +`func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool)` + +GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOuterEnum + +`func (o *EnumTest) SetOuterEnum(v OuterEnum)` + +SetOuterEnum sets OuterEnum field to given value. + +### HasOuterEnum + +`func (o *EnumTest) HasOuterEnum() bool` + +HasOuterEnum returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index 6ba47e807f3..93be8280eb6 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -23,19 +23,49 @@ Method | HTTP request | Description ## CreateXmlItem -> CreateXmlItem(ctx, xmlItem) +> CreateXmlItem(ctx).XmlItem(xmlItem).Execute() creates an XmlItem -this route creates an XmlItem -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + xmlItem := openapiclient.XmlItem{AttributeString: "AttributeString_example", AttributeNumber: 123, AttributeInteger: 123, AttributeBoolean: true, WrappedArray: []int32{123), NameString: "NameString_example", NameNumber: 123, NameInteger: 123, NameBoolean: true, NameArray: []int32{123), NameWrappedArray: []int32{123), PrefixString: "PrefixString_example", PrefixNumber: 123, PrefixInteger: 123, PrefixBoolean: true, PrefixArray: []int32{123), PrefixWrappedArray: []int32{123), NamespaceString: "NamespaceString_example", NamespaceNumber: 123, NamespaceInteger: 123, NamespaceBoolean: true, NamespaceArray: []int32{123), NamespaceWrappedArray: []int32{123), PrefixNsString: "PrefixNsString_example", PrefixNsNumber: 123, PrefixNsInteger: 123, PrefixNsBoolean: true, PrefixNsArray: []int32{123), PrefixNsWrappedArray: []int32{123)} // XmlItem | XmlItem Body + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.CreateXmlItem(context.Background(), xmlItem).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.CreateXmlItem``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateXmlItemRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | + **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | ### Return type @@ -57,28 +87,51 @@ No authorization required ## FakeOuterBooleanSerialize -> bool FakeOuterBooleanSerialize(ctx, optional) +> bool FakeOuterBooleanSerialize(ctx).Body(body).Execute() -Test serialization of outer boolean types -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := true // bool | Input boolean as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterBooleanSerialize`: bool + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterBooleanSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterBooleanSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.Bool**| Input boolean as post body | + **body** | **bool** | Input boolean as post body | ### Return type @@ -100,28 +153,51 @@ No authorization required ## FakeOuterCompositeSerialize -> OuterComposite FakeOuterCompositeSerialize(ctx, optional) +> OuterComposite FakeOuterCompositeSerialize(ctx).Body(body).Execute() -Test serialization of object with outer number type -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.OuterComposite{MyNumber: 123, MyString: "MyString_example", MyBoolean: false} // OuterComposite | Input composite as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterCompositeSerialize`: OuterComposite + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterCompositeSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterCompositeSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body | + **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | ### Return type @@ -143,28 +219,51 @@ No authorization required ## FakeOuterNumberSerialize -> float32 FakeOuterNumberSerialize(ctx, optional) +> float32 FakeOuterNumberSerialize(ctx).Body(body).Execute() -Test serialization of outer number types -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := 987 // float32 | Input number as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterNumberSerialize`: float32 + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterNumberSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterNumberSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.Float32**| Input number as post body | + **body** | **float32** | Input number as post body | ### Return type @@ -186,28 +285,51 @@ No authorization required ## FakeOuterStringSerialize -> string FakeOuterStringSerialize(ctx, optional) +> string FakeOuterStringSerialize(ctx).Body(body).Execute() -Test serialization of outer string types -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := "body_example" // string | Input string as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterStringSerialize`: string + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterStringSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterStringSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.String**| Input string as post body | + **body** | **string** | Input string as post body | ### Return type @@ -229,19 +351,49 @@ No authorization required ## TestBodyWithFileSchema -> TestBodyWithFileSchema(ctx, body) +> TestBodyWithFileSchema(ctx).Body(body).Execute() -For this test, the body for this request much reference a schema named `File`. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.FileSchemaTestClass{File: openapiclient.File{SourceURI: "SourceURI_example"}, Files: []File{openapiclient.File{SourceURI: "SourceURI_example"})} // FileSchemaTestClass | + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestBodyWithFileSchemaRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -263,18 +415,49 @@ No authorization required ## TestBodyWithQueryParams -> TestBodyWithQueryParams(ctx, query, body) +> TestBodyWithQueryParams(ctx).Query(query).Body(body).Execute() -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + query := "query_example" // string | + body := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123} // User | + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background(), query, body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestBodyWithQueryParamsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**query** | **string**| | -**body** | [**User**](User.md)| | + **query** | **string** | | + **body** | [**User**](User.md) | | ### Return type @@ -296,19 +479,51 @@ No authorization required ## TestClientModel -> Client TestClientModel(ctx, body) +> Client TestClientModel(ctx).Body(body).Execute() To test \"client\" model -To test \"client\" model -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.Client{Client: "Client_example"} // Client | client model + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestClientModel(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClientModel`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeApi.TestClientModel`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestClientModelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md) | client model | ### Return type @@ -330,45 +545,75 @@ No authorization required ## TestEndpointParameters -> TestEndpointParameters(ctx, number, double, patternWithoutDelimiter, byte_, optional) +> TestEndpointParameters(ctx).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + number := 987 // float32 | None + double := 987 // float64 | None + patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None + byte_ := 987 // string | None + integer := 987 // int32 | None (optional) + int32_ := 987 // int32 | None (optional) + int64_ := 987 // int64 | None (optional) + float := 987 // float32 | None (optional) + string_ := "string__example" // string | None (optional) + binary := 987 // *os.File | None (optional) + date := Get-Date // string | None (optional) + dateTime := Get-Date // time.Time | None (optional) + password := "password_example" // string | None (optional) + callback := "callback_example" // string | None (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background(), number, double, patternWithoutDelimiter, byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestEndpointParametersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**number** | **float32**| None | -**double** | **float64**| None | -**patternWithoutDelimiter** | **string**| None | -**byte_** | **string**| None | - **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - - **integer** | **optional.Int32**| None | - **int32_** | **optional.Int32**| None | - **int64_** | **optional.Int64**| None | - **float** | **optional.Float32**| None | - **string_** | **optional.String**| None | - **binary** | **optional.Interface of *os.File****optional.*os.File**| None | - **date** | **optional.String**| None | - **dateTime** | **optional.Time**| None | - **password** | **optional.String**| None | - **callback** | **optional.String**| None | + **number** | **float32** | None | + **double** | **float64** | None | + **patternWithoutDelimiter** | **string** | None | + **byte_** | **string** | None | + **integer** | **int32** | None | + **int32_** | **int32** | None | + **int64_** | **int64** | None | + **float** | **float32** | None | + **string_** | **string** | None | + **binary** | ***os.File** | None | + **date** | **string** | None | + **dateTime** | **time.Time** | None | + **password** | **string** | None | + **callback** | **string** | None | ### Return type @@ -390,35 +635,63 @@ Name | Type | Description | Notes ## TestEnumParameters -> TestEnumParameters(ctx, optional) +> TestEnumParameters(ctx).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() To test enum parameters -To test enum parameters -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) + enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") + enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) + enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") + enumQueryInteger := 987 // int32 | Query parameter enum test (double) (optional) + enumQueryDouble := 987 // float64 | Query parameter enum test (double) (optional) + enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") + enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background(), ).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestEnumParametersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestEnumParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**optional.Interface of []string**](string.md)| Header parameter enum test (string array) | - **enumHeaderString** | **optional.String**| Header parameter enum test (string) | [default to -efg] - **enumQueryStringArray** | [**optional.Interface of []string**](string.md)| Query parameter enum test (string array) | - **enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg] - **enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) | - **enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) | - **enumFormStringArray** | [**optional.Interface of []string**](string.md)| Form parameter enum test (string array) | [default to $] - **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] + **enumHeaderStringArray** | [**[]string**](string.md) | Header parameter enum test (string array) | + **enumHeaderString** | **string** | Header parameter enum test (string) | [default to "-efg"] + **enumQueryStringArray** | [**[]string**](string.md) | Query parameter enum test (string array) | + **enumQueryString** | **string** | Query parameter enum test (string) | [default to "-efg"] + **enumQueryInteger** | **int32** | Query parameter enum test (double) | + **enumQueryDouble** | **float64** | Query parameter enum test (double) | + **enumFormStringArray** | [**[]string**](string.md) | Form parameter enum test (string array) | [default to "$"] + **enumFormString** | **string** | Form parameter enum test (string) | [default to "-efg"] ### Return type @@ -440,36 +713,59 @@ No authorization required ## TestGroupParameters -> TestGroupParameters(ctx, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, optional) +> TestGroupParameters(ctx).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() Fake endpoint to test group parameters (optional) -Fake endpoint to test group parameters (optional) -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + requiredStringGroup := 987 // int32 | Required String in group parameters + requiredBooleanGroup := true // bool | Required Boolean in group parameters + requiredInt64Group := 987 // int64 | Required Integer in group parameters + stringGroup := 987 // int32 | String in group parameters (optional) + booleanGroup := true // bool | Boolean in group parameters (optional) + int64Group := 987 // int64 | Integer in group parameters (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background(), requiredStringGroup, requiredBooleanGroup, requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestGroupParametersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**requiredStringGroup** | **int32**| Required String in group parameters | -**requiredBooleanGroup** | **bool**| Required Boolean in group parameters | -**requiredInt64Group** | **int64**| Required Integer in group parameters | - **optional** | ***TestGroupParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestGroupParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **stringGroup** | **optional.Int32**| String in group parameters | - **booleanGroup** | **optional.Bool**| Boolean in group parameters | - **int64Group** | **optional.Int64**| Integer in group parameters | + **requiredStringGroup** | **int32** | Required String in group parameters | + **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | + **requiredInt64Group** | **int64** | Required Integer in group parameters | + **stringGroup** | **int32** | String in group parameters | + **booleanGroup** | **bool** | Boolean in group parameters | + **int64Group** | **int64** | Integer in group parameters | ### Return type @@ -491,17 +787,47 @@ No authorization required ## TestInlineAdditionalProperties -> TestInlineAdditionalProperties(ctx, param) +> TestInlineAdditionalProperties(ctx).Param(param).Execute() test inline additionalProperties -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + param := map[string]string{ "Key" = "Value" } // map[string]string | request body + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background(), param).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestInlineAdditionalPropertiesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**param** | [**map[string]string**](string.md)| request body | + **param** | [**map[string]string**](string.md) | request body | ### Return type @@ -523,18 +849,49 @@ No authorization required ## TestJsonFormData -> TestJsonFormData(ctx, param, param2) +> TestJsonFormData(ctx).Param(param).Param2(param2).Execute() test json serialization of form data -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + param := "param_example" // string | field1 + param2 := "param2_example" // string | field2 + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background(), param, param2).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestJsonFormDataRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**param** | **string**| field1 | -**param2** | **string**| field2 | + **param** | **string** | field1 | + **param2** | **string** | field2 | ### Return type @@ -556,23 +913,57 @@ No authorization required ## TestQueryParameterCollectionFormat -> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) +> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() -To test the collection format in query parameters -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pipe := []string{"Inner_example"} // []string | + ioutil := []string{"Inner_example"} // []string | + http := []string{"Inner_example"} // []string | + url := []string{"Inner_example"} // []string | + context := []string{"Inner_example"} // []string | + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background(), pipe, ioutil, http, url, context).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestQueryParameterCollectionFormatRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pipe** | [**[]string**](string.md)| | -**ioutil** | [**[]string**](string.md)| | -**http** | [**[]string**](string.md)| | -**url** | [**[]string**](string.md)| | -**context** | [**[]string**](string.md)| | + **pipe** | [**[]string**](string.md) | | + **ioutil** | [**[]string**](string.md) | | + **http** | [**[]string**](string.md) | | + **url** | [**[]string**](string.md) | | + **context** | [**[]string**](string.md) | | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md index 224542b7051..3f8d0a41de3 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -10,19 +10,51 @@ Method | HTTP request | Description ## TestClassname -> Client TestClassname(ctx, body) +> Client TestClassname(ctx).Body(body).Execute() To test class name in snake case -To test class name in snake case -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.Client{Client: "Client_example"} // Client | client model + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClassname`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123Api.TestClassname`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestClassnameRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/File.md b/samples/client/petstore/go/go-petstore/docs/File.md index a113b0312cd..91fe90e06f1 100644 --- a/samples/client/petstore/go/go-petstore/docs/File.md +++ b/samples/client/petstore/go/go-petstore/docs/File.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SourceURI** | **string** | Test capitalization | [optional] +**SourceURI** | Pointer to **string** | Test capitalization | [optional] + +## Methods + +### NewFile + +`func NewFile() *File` + +NewFile instantiates a new File object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFileWithDefaults + +`func NewFileWithDefaults() *File` + +NewFileWithDefaults instantiates a new File object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSourceURI + +`func (o *File) GetSourceURI() string` + +GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. + +### GetSourceURIOk + +`func (o *File) GetSourceURIOk() (*string, bool)` + +GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceURI + +`func (o *File) SetSourceURI(v string)` + +SetSourceURI sets SourceURI field to given value. + +### HasSourceURI + +`func (o *File) HasSourceURI() bool` + +HasSourceURI returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md b/samples/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md index ae51414dd6c..2db8eb31902 100644 --- a/samples/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**File** | [**File**](File.md) | | [optional] -**Files** | [**[]File**](File.md) | | [optional] +**File** | Pointer to [**File**](File.md) | | [optional] +**Files** | Pointer to [**[]File**](File.md) | | [optional] + +## Methods + +### NewFileSchemaTestClass + +`func NewFileSchemaTestClass() *FileSchemaTestClass` + +NewFileSchemaTestClass instantiates a new FileSchemaTestClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFileSchemaTestClassWithDefaults + +`func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass` + +NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFile + +`func (o *FileSchemaTestClass) GetFile() File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *FileSchemaTestClass) GetFileOk() (*File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFile + +`func (o *FileSchemaTestClass) SetFile(v File)` + +SetFile sets File field to given value. + +### HasFile + +`func (o *FileSchemaTestClass) HasFile() bool` + +HasFile returns a boolean if a field has been set. + +### GetFiles + +`func (o *FileSchemaTestClass) GetFiles() []File` + +GetFiles returns the Files field if non-nil, zero value otherwise. + +### GetFilesOk + +`func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool)` + +GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFiles + +`func (o *FileSchemaTestClass) SetFiles(v []File)` + +SetFiles sets Files field to given value. + +### HasFiles + +`func (o *FileSchemaTestClass) HasFiles() bool` + +HasFiles returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/FormatTest.md b/samples/client/petstore/go/go-petstore/docs/FormatTest.md index 4e8c3332b63..9235479afc1 100644 --- a/samples/client/petstore/go/go-petstore/docs/FormatTest.md +++ b/samples/client/petstore/go/go-petstore/docs/FormatTest.md @@ -4,20 +4,370 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int32** | | [optional] -**Int32** | **int32** | | [optional] -**Int64** | **int64** | | [optional] +**Integer** | Pointer to **int32** | | [optional] +**Int32** | Pointer to **int32** | | [optional] +**Int64** | Pointer to **int64** | | [optional] **Number** | **float32** | | -**Float** | **float32** | | [optional] -**Double** | **float64** | | [optional] -**String** | **string** | | [optional] +**Float** | Pointer to **float32** | | [optional] +**Double** | Pointer to **float64** | | [optional] +**String** | Pointer to **string** | | [optional] **Byte** | **string** | | -**Binary** | [***os.File**](*os.File.md) | | [optional] +**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] **Date** | **string** | | -**DateTime** | [**time.Time**](time.Time.md) | | [optional] -**Uuid** | **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] **Password** | **string** | | -**BigDecimal** | **float64** | | [optional] +**BigDecimal** | Pointer to **float64** | | [optional] + +## Methods + +### NewFormatTest + +`func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest` + +NewFormatTest instantiates a new FormatTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFormatTestWithDefaults + +`func NewFormatTestWithDefaults() *FormatTest` + +NewFormatTestWithDefaults instantiates a new FormatTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInteger + +`func (o *FormatTest) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *FormatTest) GetIntegerOk() (*int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInteger + +`func (o *FormatTest) SetInteger(v int32)` + +SetInteger sets Integer field to given value. + +### HasInteger + +`func (o *FormatTest) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### GetInt32 + +`func (o *FormatTest) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *FormatTest) GetInt32Ok() (*int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInt32 + +`func (o *FormatTest) SetInt32(v int32)` + +SetInt32 sets Int32 field to given value. + +### HasInt32 + +`func (o *FormatTest) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### GetInt64 + +`func (o *FormatTest) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *FormatTest) GetInt64Ok() (*int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInt64 + +`func (o *FormatTest) SetInt64(v int64)` + +SetInt64 sets Int64 field to given value. + +### HasInt64 + +`func (o *FormatTest) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### GetNumber + +`func (o *FormatTest) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *FormatTest) GetNumberOk() (*float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *FormatTest) SetNumber(v float32)` + +SetNumber sets Number field to given value. + + +### GetFloat + +`func (o *FormatTest) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *FormatTest) GetFloatOk() (*float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFloat + +`func (o *FormatTest) SetFloat(v float32)` + +SetFloat sets Float field to given value. + +### HasFloat + +`func (o *FormatTest) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### GetDouble + +`func (o *FormatTest) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *FormatTest) GetDoubleOk() (*float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDouble + +`func (o *FormatTest) SetDouble(v float64)` + +SetDouble sets Double field to given value. + +### HasDouble + +`func (o *FormatTest) HasDouble() bool` + +HasDouble returns a boolean if a field has been set. + +### GetString + +`func (o *FormatTest) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *FormatTest) GetStringOk() (*string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetString + +`func (o *FormatTest) SetString(v string)` + +SetString sets String field to given value. + +### HasString + +`func (o *FormatTest) HasString() bool` + +HasString returns a boolean if a field has been set. + +### GetByte + +`func (o *FormatTest) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *FormatTest) GetByteOk() (*string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetByte + +`func (o *FormatTest) SetByte(v string)` + +SetByte sets Byte field to given value. + + +### GetBinary + +`func (o *FormatTest) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *FormatTest) GetBinaryOk() (**os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBinary + +`func (o *FormatTest) SetBinary(v *os.File)` + +SetBinary sets Binary field to given value. + +### HasBinary + +`func (o *FormatTest) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### GetDate + +`func (o *FormatTest) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *FormatTest) GetDateOk() (*string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDate + +`func (o *FormatTest) SetDate(v string)` + +SetDate sets Date field to given value. + + +### GetDateTime + +`func (o *FormatTest) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *FormatTest) GetDateTimeOk() (*time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateTime + +`func (o *FormatTest) SetDateTime(v time.Time)` + +SetDateTime sets DateTime field to given value. + +### HasDateTime + +`func (o *FormatTest) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### GetUuid + +`func (o *FormatTest) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *FormatTest) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *FormatTest) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *FormatTest) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetPassword + +`func (o *FormatTest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *FormatTest) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *FormatTest) SetPassword(v string)` + +SetPassword sets Password field to given value. + + +### GetBigDecimal + +`func (o *FormatTest) GetBigDecimal() float64` + +GetBigDecimal returns the BigDecimal field if non-nil, zero value otherwise. + +### GetBigDecimalOk + +`func (o *FormatTest) GetBigDecimalOk() (*float64, bool)` + +GetBigDecimalOk returns a tuple with the BigDecimal field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBigDecimal + +`func (o *FormatTest) SetBigDecimal(v float64)` + +SetBigDecimal sets BigDecimal field to given value. + +### HasBigDecimal + +`func (o *FormatTest) HasBigDecimal() bool` + +HasBigDecimal returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md b/samples/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md index 3b6ff48ab9f..7f54d772840 100644 --- a/samples/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [readonly] -**Foo** | **string** | | [optional] [readonly] +**Bar** | Pointer to **string** | | [optional] [readonly] +**Foo** | Pointer to **string** | | [optional] [readonly] + +## Methods + +### NewHasOnlyReadOnly + +`func NewHasOnlyReadOnly() *HasOnlyReadOnly` + +NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHasOnlyReadOnlyWithDefaults + +`func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly` + +NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBar + +`func (o *HasOnlyReadOnly) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *HasOnlyReadOnly) GetBarOk() (*string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBar + +`func (o *HasOnlyReadOnly) SetBar(v string)` + +SetBar sets Bar field to given value. + +### HasBar + +`func (o *HasOnlyReadOnly) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### GetFoo + +`func (o *HasOnlyReadOnly) GetFoo() string` + +GetFoo returns the Foo field if non-nil, zero value otherwise. + +### GetFooOk + +`func (o *HasOnlyReadOnly) GetFooOk() (*string, bool)` + +GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFoo + +`func (o *HasOnlyReadOnly) SetFoo(v string)` + +SetFoo sets Foo field to given value. + +### HasFoo + +`func (o *HasOnlyReadOnly) HasFoo() bool` + +HasFoo returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/List.md b/samples/client/petstore/go/go-petstore/docs/List.md index bba2e529906..271c8236a8b 100644 --- a/samples/client/petstore/go/go-petstore/docs/List.md +++ b/samples/client/petstore/go/go-petstore/docs/List.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Var123List** | **string** | | [optional] +**Var123List** | Pointer to **string** | | [optional] + +## Methods + +### NewList + +`func NewList() *List` + +NewList instantiates a new List object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListWithDefaults + +`func NewListWithDefaults() *List` + +NewListWithDefaults instantiates a new List object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVar123List + +`func (o *List) GetVar123List() string` + +GetVar123List returns the Var123List field if non-nil, zero value otherwise. + +### GetVar123ListOk + +`func (o *List) GetVar123ListOk() (*string, bool)` + +GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVar123List + +`func (o *List) SetVar123List(v string)` + +SetVar123List sets Var123List field to given value. + +### HasVar123List + +`func (o *List) HasVar123List() bool` + +HasVar123List returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/MapTest.md b/samples/client/petstore/go/go-petstore/docs/MapTest.md index 6645e044658..6b35263c4e3 100644 --- a/samples/client/petstore/go/go-petstore/docs/MapTest.md +++ b/samples/client/petstore/go/go-petstore/docs/MapTest.md @@ -4,10 +4,130 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | **map[string]string** | | [optional] -**DirectMap** | **map[string]bool** | | [optional] -**IndirectMap** | **map[string]bool** | | [optional] +**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapOfEnumString** | Pointer to **map[string]string** | | [optional] +**DirectMap** | Pointer to **map[string]bool** | | [optional] +**IndirectMap** | Pointer to **map[string]bool** | | [optional] + +## Methods + +### NewMapTest + +`func NewMapTest() *MapTest` + +NewMapTest instantiates a new MapTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMapTestWithDefaults + +`func NewMapTestWithDefaults() *MapTest` + +NewMapTestWithDefaults instantiates a new MapTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMapMapOfString + +`func (o *MapTest) GetMapMapOfString() map[string]map[string]string` + +GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. + +### GetMapMapOfStringOk + +`func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool)` + +GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapMapOfString + +`func (o *MapTest) SetMapMapOfString(v map[string]map[string]string)` + +SetMapMapOfString sets MapMapOfString field to given value. + +### HasMapMapOfString + +`func (o *MapTest) HasMapMapOfString() bool` + +HasMapMapOfString returns a boolean if a field has been set. + +### GetMapOfEnumString + +`func (o *MapTest) GetMapOfEnumString() map[string]string` + +GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. + +### GetMapOfEnumStringOk + +`func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool)` + +GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapOfEnumString + +`func (o *MapTest) SetMapOfEnumString(v map[string]string)` + +SetMapOfEnumString sets MapOfEnumString field to given value. + +### HasMapOfEnumString + +`func (o *MapTest) HasMapOfEnumString() bool` + +HasMapOfEnumString returns a boolean if a field has been set. + +### GetDirectMap + +`func (o *MapTest) GetDirectMap() map[string]bool` + +GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. + +### GetDirectMapOk + +`func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool)` + +GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectMap + +`func (o *MapTest) SetDirectMap(v map[string]bool)` + +SetDirectMap sets DirectMap field to given value. + +### HasDirectMap + +`func (o *MapTest) HasDirectMap() bool` + +HasDirectMap returns a boolean if a field has been set. + +### GetIndirectMap + +`func (o *MapTest) GetIndirectMap() map[string]bool` + +GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. + +### GetIndirectMapOk + +`func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool)` + +GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndirectMap + +`func (o *MapTest) SetIndirectMap(v map[string]bool)` + +SetIndirectMap sets IndirectMap field to given value. + +### HasIndirectMap + +`func (o *MapTest) HasIndirectMap() bool` + +HasIndirectMap returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index a2ce1068b27..f726ffe63e1 100644 --- a/samples/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **string** | | [optional] -**DateTime** | [**time.Time**](time.Time.md) | | [optional] -**Map** | [**map[string]Animal**](Animal.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] + +## Methods + +### NewMixedPropertiesAndAdditionalPropertiesClass + +`func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass` + +NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults + +`func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass` + +NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time)` + +SetDateTime sets DateTime field to given value. + +### HasDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### GetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal` + +GetMap returns the Map field if non-nil, zero value otherwise. + +### GetMapOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool)` + +GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal)` + +SetMap sets Map field to given value. + +### HasMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool` + +HasMap returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Model200Response.md b/samples/client/petstore/go/go-petstore/docs/Model200Response.md index 27b93bd1549..4e0d89fe88f 100644 --- a/samples/client/petstore/go/go-petstore/docs/Model200Response.md +++ b/samples/client/petstore/go/go-petstore/docs/Model200Response.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int32** | | [optional] -**Class** | **string** | | [optional] +**Name** | Pointer to **int32** | | [optional] +**Class** | Pointer to **string** | | [optional] + +## Methods + +### NewModel200Response + +`func NewModel200Response() *Model200Response` + +NewModel200Response instantiates a new Model200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewModel200ResponseWithDefaults + +`func NewModel200ResponseWithDefaults() *Model200Response` + +NewModel200ResponseWithDefaults instantiates a new Model200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Model200Response) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Model200Response) GetNameOk() (*int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Model200Response) SetName(v int32)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Model200Response) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetClass + +`func (o *Model200Response) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *Model200Response) GetClassOk() (*string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClass + +`func (o *Model200Response) SetClass(v string)` + +SetClass sets Class field to given value. + +### HasClass + +`func (o *Model200Response) HasClass() bool` + +HasClass returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Name.md b/samples/client/petstore/go/go-petstore/docs/Name.md index 3e91109a16a..18cf04789d6 100644 --- a/samples/client/petstore/go/go-petstore/docs/Name.md +++ b/samples/client/petstore/go/go-petstore/docs/Name.md @@ -5,9 +5,124 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int32** | | -**SnakeCase** | **int32** | | [optional] [readonly] -**Property** | **string** | | [optional] -**Var123Number** | **int32** | | [optional] [readonly] +**SnakeCase** | Pointer to **int32** | | [optional] [readonly] +**Property** | Pointer to **string** | | [optional] +**Var123Number** | Pointer to **int32** | | [optional] [readonly] + +## Methods + +### NewName + +`func NewName(name int32, ) *Name` + +NewName instantiates a new Name object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNameWithDefaults + +`func NewNameWithDefaults() *Name` + +NewNameWithDefaults instantiates a new Name object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Name) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Name) GetNameOk() (*int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Name) SetName(v int32)` + +SetName sets Name field to given value. + + +### GetSnakeCase + +`func (o *Name) GetSnakeCase() int32` + +GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. + +### GetSnakeCaseOk + +`func (o *Name) GetSnakeCaseOk() (*int32, bool)` + +GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSnakeCase + +`func (o *Name) SetSnakeCase(v int32)` + +SetSnakeCase sets SnakeCase field to given value. + +### HasSnakeCase + +`func (o *Name) HasSnakeCase() bool` + +HasSnakeCase returns a boolean if a field has been set. + +### GetProperty + +`func (o *Name) GetProperty() string` + +GetProperty returns the Property field if non-nil, zero value otherwise. + +### GetPropertyOk + +`func (o *Name) GetPropertyOk() (*string, bool)` + +GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperty + +`func (o *Name) SetProperty(v string)` + +SetProperty sets Property field to given value. + +### HasProperty + +`func (o *Name) HasProperty() bool` + +HasProperty returns a boolean if a field has been set. + +### GetVar123Number + +`func (o *Name) GetVar123Number() int32` + +GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. + +### GetVar123NumberOk + +`func (o *Name) GetVar123NumberOk() (*int32, bool)` + +GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVar123Number + +`func (o *Name) SetVar123Number(v int32)` + +SetVar123Number sets Var123Number field to given value. + +### HasVar123Number + +`func (o *Name) HasVar123Number() bool` + +HasVar123Number returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/NumberOnly.md b/samples/client/petstore/go/go-petstore/docs/NumberOnly.md index 604cf37eede..81941828b62 100644 --- a/samples/client/petstore/go/go-petstore/docs/NumberOnly.md +++ b/samples/client/petstore/go/go-petstore/docs/NumberOnly.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **float32** | | [optional] +**JustNumber** | Pointer to **float32** | | [optional] + +## Methods + +### NewNumberOnly + +`func NewNumberOnly() *NumberOnly` + +NewNumberOnly instantiates a new NumberOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNumberOnlyWithDefaults + +`func NewNumberOnlyWithDefaults() *NumberOnly` + +NewNumberOnlyWithDefaults instantiates a new NumberOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetJustNumber + +`func (o *NumberOnly) GetJustNumber() float32` + +GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. + +### GetJustNumberOk + +`func (o *NumberOnly) GetJustNumberOk() (*float32, bool)` + +GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJustNumber + +`func (o *NumberOnly) SetJustNumber(v float32)` + +SetJustNumber sets JustNumber field to given value. + +### HasJustNumber + +`func (o *NumberOnly) HasJustNumber() bool` + +HasJustNumber returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Order.md b/samples/client/petstore/go/go-petstore/docs/Order.md index eeef0971005..78cace2f229 100644 --- a/samples/client/petstore/go/go-petstore/docs/Order.md +++ b/samples/client/petstore/go/go-petstore/docs/Order.md @@ -4,12 +4,182 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**PetId** | **int64** | | [optional] -**Quantity** | **int32** | | [optional] -**ShipDate** | [**time.Time**](time.Time.md) | | [optional] -**Status** | **string** | Order Status | [optional] -**Complete** | **bool** | | [optional] [default to false] +**Id** | Pointer to **int64** | | [optional] +**PetId** | Pointer to **int64** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Status** | Pointer to **string** | Order Status | [optional] +**Complete** | Pointer to **bool** | | [optional] [default to false] + +## Methods + +### NewOrder + +`func NewOrder() *Order` + +NewOrder instantiates a new Order object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderWithDefaults + +`func NewOrderWithDefaults() *Order` + +NewOrderWithDefaults instantiates a new Order object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Order) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Order) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Order) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Order) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPetId + +`func (o *Order) GetPetId() int64` + +GetPetId returns the PetId field if non-nil, zero value otherwise. + +### GetPetIdOk + +`func (o *Order) GetPetIdOk() (*int64, bool)` + +GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPetId + +`func (o *Order) SetPetId(v int64)` + +SetPetId sets PetId field to given value. + +### HasPetId + +`func (o *Order) HasPetId() bool` + +HasPetId returns a boolean if a field has been set. + +### GetQuantity + +`func (o *Order) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *Order) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *Order) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *Order) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetShipDate + +`func (o *Order) GetShipDate() time.Time` + +GetShipDate returns the ShipDate field if non-nil, zero value otherwise. + +### GetShipDateOk + +`func (o *Order) GetShipDateOk() (*time.Time, bool)` + +GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShipDate + +`func (o *Order) SetShipDate(v time.Time)` + +SetShipDate sets ShipDate field to given value. + +### HasShipDate + +`func (o *Order) HasShipDate() bool` + +HasShipDate returns a boolean if a field has been set. + +### GetStatus + +`func (o *Order) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Order) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Order) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *Order) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetComplete + +`func (o *Order) GetComplete() bool` + +GetComplete returns the Complete field if non-nil, zero value otherwise. + +### GetCompleteOk + +`func (o *Order) GetCompleteOk() (*bool, bool)` + +GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComplete + +`func (o *Order) SetComplete(v bool)` + +SetComplete sets Complete field to given value. + +### HasComplete + +`func (o *Order) HasComplete() bool` + +HasComplete returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/OuterComposite.md b/samples/client/petstore/go/go-petstore/docs/OuterComposite.md index df9bce1bd90..1ebf86c0a2e 100644 --- a/samples/client/petstore/go/go-petstore/docs/OuterComposite.md +++ b/samples/client/petstore/go/go-petstore/docs/OuterComposite.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **float32** | | [optional] -**MyString** | **string** | | [optional] -**MyBoolean** | **bool** | | [optional] +**MyNumber** | Pointer to **float32** | | [optional] +**MyString** | Pointer to **string** | | [optional] +**MyBoolean** | Pointer to **bool** | | [optional] + +## Methods + +### NewOuterComposite + +`func NewOuterComposite() *OuterComposite` + +NewOuterComposite instantiates a new OuterComposite object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOuterCompositeWithDefaults + +`func NewOuterCompositeWithDefaults() *OuterComposite` + +NewOuterCompositeWithDefaults instantiates a new OuterComposite object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMyNumber + +`func (o *OuterComposite) GetMyNumber() float32` + +GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. + +### GetMyNumberOk + +`func (o *OuterComposite) GetMyNumberOk() (*float32, bool)` + +GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyNumber + +`func (o *OuterComposite) SetMyNumber(v float32)` + +SetMyNumber sets MyNumber field to given value. + +### HasMyNumber + +`func (o *OuterComposite) HasMyNumber() bool` + +HasMyNumber returns a boolean if a field has been set. + +### GetMyString + +`func (o *OuterComposite) GetMyString() string` + +GetMyString returns the MyString field if non-nil, zero value otherwise. + +### GetMyStringOk + +`func (o *OuterComposite) GetMyStringOk() (*string, bool)` + +GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyString + +`func (o *OuterComposite) SetMyString(v string)` + +SetMyString sets MyString field to given value. + +### HasMyString + +`func (o *OuterComposite) HasMyString() bool` + +HasMyString returns a boolean if a field has been set. + +### GetMyBoolean + +`func (o *OuterComposite) GetMyBoolean() bool` + +GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. + +### GetMyBooleanOk + +`func (o *OuterComposite) GetMyBooleanOk() (*bool, bool)` + +GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyBoolean + +`func (o *OuterComposite) SetMyBoolean(v bool)` + +SetMyBoolean sets MyBoolean field to given value. + +### HasMyBoolean + +`func (o *OuterComposite) HasMyBoolean() bool` + +HasMyBoolean returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/OuterEnum.md b/samples/client/petstore/go/go-petstore/docs/OuterEnum.md index c97466159c5..13bed2d17fd 100644 --- a/samples/client/petstore/go/go-petstore/docs/OuterEnum.md +++ b/samples/client/petstore/go/go-petstore/docs/OuterEnum.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Pet.md b/samples/client/petstore/go/go-petstore/docs/Pet.md index c48104c6397..a6eae34657d 100644 --- a/samples/client/petstore/go/go-petstore/docs/Pet.md +++ b/samples/client/petstore/go/go-petstore/docs/Pet.md @@ -4,12 +4,172 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Category** | Pointer to [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **[]string** | | -**Tags** | [**[]Tag**](Tag.md) | | [optional] -**Status** | **string** | pet status in the store | [optional] +**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] +**Status** | Pointer to **string** | pet status in the store | [optional] + +## Methods + +### NewPet + +`func NewPet(name string, photoUrls []string, ) *Pet` + +NewPet instantiates a new Pet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPetWithDefaults + +`func NewPetWithDefaults() *Pet` + +NewPetWithDefaults instantiates a new Pet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Pet) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Pet) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Pet) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Pet) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetCategory + +`func (o *Pet) GetCategory() Category` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *Pet) GetCategoryOk() (*Category, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *Pet) SetCategory(v Category)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *Pet) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + +### GetName + +`func (o *Pet) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Pet) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Pet) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPhotoUrls + +`func (o *Pet) GetPhotoUrls() []string` + +GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. + +### GetPhotoUrlsOk + +`func (o *Pet) GetPhotoUrlsOk() (*[]string, bool)` + +GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhotoUrls + +`func (o *Pet) SetPhotoUrls(v []string)` + +SetPhotoUrls sets PhotoUrls field to given value. + + +### GetTags + +`func (o *Pet) GetTags() []Tag` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Pet) GetTagsOk() (*[]Tag, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Pet) SetTags(v []Tag)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Pet) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetStatus + +`func (o *Pet) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Pet) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Pet) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *Pet) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/PetApi.md b/samples/client/petstore/go/go-petstore/docs/PetApi.md index 6ee9afef754..c2559ac673a 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore/docs/PetApi.md @@ -18,17 +18,47 @@ Method | HTTP request | Description ## AddPet -> AddPet(ctx, body) +> AddPet(ctx).Body(body).Execute() Add a new pet to the store -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.AddPet(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddPetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -50,28 +80,53 @@ Name | Type | Description | Notes ## DeletePet -> DeletePet(ctx, petId, optional) +> DeletePet(ctx, petId).ApiKey(apiKey).Execute() Deletes a pet -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | Pet id to delete + apiKey := "apiKey_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| Pet id to delete | - **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters +**petId** | **int64** | Pet id to delete | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a DeletePetOpts struct +Other parameters are passed through a pointer to a apiDeletePetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **apiKey** | **optional.String**| | + **apiKey** | **string** | | ### Return type @@ -93,19 +148,51 @@ Name | Type | Description | Notes ## FindPetsByStatus -> []Pet FindPetsByStatus(ctx, status) +> []Pet FindPetsByStatus(ctx).Status(status).Execute() Finds Pets by status -Multiple status values can be provided with comma separated strings -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + status := []string{"Status_example"} // []string | Status values that need to be considered for filter + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background(), status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByStatus`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByStatus`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPetsByStatusRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**status** | [**[]string**](string.md)| Status values that need to be considered for filter | + **status** | [**[]string**](string.md) | Status values that need to be considered for filter | ### Return type @@ -127,19 +214,51 @@ Name | Type | Description | Notes ## FindPetsByTags -> []Pet FindPetsByTags(ctx, tags) +> []Pet FindPetsByTags(ctx).Tags(tags).Execute() Finds Pets by tags -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + tags := []string{"Inner_example"} // []string | Tags to filter by + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.FindPetsByTags(context.Background(), tags).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByTags`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByTags`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPetsByTagsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**tags** | [**[]string**](string.md)| Tags to filter by | + **tags** | [**[]string**](string.md) | Tags to filter by | ### Return type @@ -161,19 +280,55 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById(ctx, petId) +> Pet GetPetById(ctx, petId).Execute() Find pet by ID -Returns a single pet -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet to return + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPetById`: Pet + fmt.Fprintf(os.Stdout, "Response from `PetApi.GetPetById`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to return | +**petId** | **int64** | ID of pet to return | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPetByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -195,17 +350,47 @@ Name | Type | Description | Notes ## UpdatePet -> UpdatePet(ctx, body) +> UpdatePet(ctx).Body(body).Execute() Update an existing pet -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UpdatePet(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdatePetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -227,29 +412,55 @@ Name | Type | Description | Notes ## UpdatePetWithForm -> UpdatePetWithForm(ctx, petId, optional) +> UpdatePetWithForm(ctx, petId).Name(name).Status(status).Execute() Updates a pet in the store with form data -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet that needs to be updated + name := "name_example" // string | Updated name of the pet (optional) + status := "status_example" // string | Updated status of the pet (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet that needs to be updated | - **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters +**petId** | **int64** | ID of pet that needs to be updated | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct +Other parameters are passed through a pointer to a apiUpdatePetWithFormRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **optional.String**| Updated name of the pet | - **status** | **optional.String**| Updated status of the pet | + **name** | **string** | Updated name of the pet | + **status** | **string** | Updated status of the pet | ### Return type @@ -271,29 +482,57 @@ Name | Type | Description | Notes ## UploadFile -> ApiResponse UploadFile(ctx, petId, optional) +> ApiResponse UploadFile(ctx, petId).AdditionalMetadata(additionalMetadata).File(file).Execute() uploads an image -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet to update + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + file := 987 // *os.File | file to upload (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFile`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to update | - **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters +**petId** | **int64** | ID of pet to update | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a UploadFileOpts struct +Other parameters are passed through a pointer to a apiUploadFileRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **additionalMetadata** | **optional.String**| Additional data to pass to server | - **file** | **optional.Interface of *os.File****optional.*os.File**| file to upload | + **additionalMetadata** | **string** | Additional data to pass to server | + **file** | ***os.File** | file to upload | ### Return type @@ -315,30 +554,57 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile(ctx, petId, requiredFile, optional) +> ApiResponse UploadFileWithRequiredFile(ctx, petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() uploads an image (required) -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet to update + requiredFile := 987 // *os.File | file to upload + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId, requiredFile).AdditionalMetadata(additionalMetadata).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFileWithRequiredFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFileWithRequiredFile`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to update | -**requiredFile** | ***os.File*****os.File**| file to upload | - **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters +**petId** | **int64** | ID of pet to update | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a UploadFileWithRequiredFileOpts struct +Other parameters are passed through a pointer to a apiUploadFileWithRequiredFileRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - **additionalMetadata** | **optional.String**| Additional data to pass to server | + **requiredFile** | ***os.File** | file to upload | + **additionalMetadata** | **string** | Additional data to pass to server | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md b/samples/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md index a86828404ec..2e25d6d230e 100644 --- a/samples/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [readonly] -**Baz** | **string** | | [optional] +**Bar** | Pointer to **string** | | [optional] [readonly] +**Baz** | Pointer to **string** | | [optional] + +## Methods + +### NewReadOnlyFirst + +`func NewReadOnlyFirst() *ReadOnlyFirst` + +NewReadOnlyFirst instantiates a new ReadOnlyFirst object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReadOnlyFirstWithDefaults + +`func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst` + +NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBar + +`func (o *ReadOnlyFirst) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *ReadOnlyFirst) GetBarOk() (*string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBar + +`func (o *ReadOnlyFirst) SetBar(v string)` + +SetBar sets Bar field to given value. + +### HasBar + +`func (o *ReadOnlyFirst) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### GetBaz + +`func (o *ReadOnlyFirst) GetBaz() string` + +GetBaz returns the Baz field if non-nil, zero value otherwise. + +### GetBazOk + +`func (o *ReadOnlyFirst) GetBazOk() (*string, bool)` + +GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaz + +`func (o *ReadOnlyFirst) SetBaz(v string)` + +SetBaz sets Baz field to given value. + +### HasBaz + +`func (o *ReadOnlyFirst) HasBaz() bool` + +HasBaz returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/Return.md b/samples/client/petstore/go/go-petstore/docs/Return.md index 11be0b27c50..d6be5a42f31 100644 --- a/samples/client/petstore/go/go-petstore/docs/Return.md +++ b/samples/client/petstore/go/go-petstore/docs/Return.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Return** | **int32** | | [optional] +**Return** | Pointer to **int32** | | [optional] + +## Methods + +### NewReturn + +`func NewReturn() *Return` + +NewReturn instantiates a new Return object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReturnWithDefaults + +`func NewReturnWithDefaults() *Return` + +NewReturnWithDefaults instantiates a new Return object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReturn + +`func (o *Return) GetReturn() int32` + +GetReturn returns the Return field if non-nil, zero value otherwise. + +### GetReturnOk + +`func (o *Return) GetReturnOk() (*int32, bool)` + +GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReturn + +`func (o *Return) SetReturn(v int32)` + +SetReturn sets Return field to given value. + +### HasReturn + +`func (o *Return) HasReturn() bool` + +HasReturn returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/SpecialModelName.md b/samples/client/petstore/go/go-petstore/docs/SpecialModelName.md index 96d7a28a409..3e5a187c1d1 100644 --- a/samples/client/petstore/go/go-petstore/docs/SpecialModelName.md +++ b/samples/client/petstore/go/go-petstore/docs/SpecialModelName.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **int64** | | [optional] +**SpecialPropertyName** | Pointer to **int64** | | [optional] + +## Methods + +### NewSpecialModelName + +`func NewSpecialModelName() *SpecialModelName` + +NewSpecialModelName instantiates a new SpecialModelName object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpecialModelNameWithDefaults + +`func NewSpecialModelNameWithDefaults() *SpecialModelName` + +NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSpecialPropertyName + +`func (o *SpecialModelName) GetSpecialPropertyName() int64` + +GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. + +### GetSpecialPropertyNameOk + +`func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool)` + +GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecialPropertyName + +`func (o *SpecialModelName) SetSpecialPropertyName(v int64)` + +SetSpecialPropertyName sets SpecialPropertyName field to given value. + +### HasSpecialPropertyName + +`func (o *SpecialModelName) HasSpecialPropertyName() bool` + +HasSpecialPropertyName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/client/petstore/go/go-petstore/docs/StoreApi.md index 531ab09ff68..58a65c02215 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreApi.md @@ -13,19 +13,53 @@ Method | HTTP request | Description ## DeleteOrder -> DeleteOrder(ctx, orderId) +> DeleteOrder(ctx, orderId).Execute() Delete purchase order by ID -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + orderId := "orderId_example" // string | ID of the order that needs to be deleted + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **string**| ID of the order that needs to be deleted | +**orderId** | **string** | ID of the order that needs to be deleted | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteOrderRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -47,16 +81,47 @@ No authorization required ## GetInventory -> map[string]int32 GetInventory(ctx, ) +> map[string]int32 GetInventory(ctx).Execute() Returns pet inventories by status -Returns a map of status codes to quantities -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.GetInventory(context.Background(), ).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInventory`: map[string]int32 + fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetInventory`: %v\n", resp) +} +``` + +### Path Parameters This endpoint does not need any parameter. +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInventoryRequest struct via the builder pattern + + ### Return type **map[string]int32** @@ -77,19 +142,55 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById(ctx, orderId) +> Order GetOrderById(ctx, orderId).Execute() Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + orderId := 987 // int64 | ID of pet that needs to be fetched + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOrderById`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetOrderById`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **int64**| ID of pet that needs to be fetched | +**orderId** | **int64** | ID of pet that needs to be fetched | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetOrderByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -111,17 +212,49 @@ No authorization required ## PlaceOrder -> Order PlaceOrder(ctx, body) +> Order PlaceOrder(ctx).Body(body).Execute() Place an order for a pet -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.Order{Id: int64(123), PetId: int64(123), Quantity: 123, ShipDate: "TODO", Status: "Status_example", Complete: false} // Order | order placed for purchasing the pet + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.PlaceOrder(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PlaceOrder`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreApi.PlaceOrder`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPlaceOrderRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/Tag.md b/samples/client/petstore/go/go-petstore/docs/Tag.md index d6b3cc117b5..391be6b4900 100644 --- a/samples/client/petstore/go/go-petstore/docs/Tag.md +++ b/samples/client/petstore/go/go-petstore/docs/Tag.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Name** | **string** | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewTag + +`func NewTag() *Tag` + +NewTag instantiates a new Tag object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTagWithDefaults + +`func NewTagWithDefaults() *Tag` + +NewTagWithDefaults instantiates a new Tag object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Tag) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Tag) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Tag) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Tag) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Tag) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Tag) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Tag) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Tag) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/TypeHolderDefault.md b/samples/client/petstore/go/go-petstore/docs/TypeHolderDefault.md index 1b9f077c303..34b38a6065f 100644 --- a/samples/client/petstore/go/go-petstore/docs/TypeHolderDefault.md +++ b/samples/client/petstore/go/go-petstore/docs/TypeHolderDefault.md @@ -4,12 +4,132 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**StringItem** | **string** | | [default to what] +**StringItem** | **string** | | [default to "what"] **NumberItem** | **float32** | | **IntegerItem** | **int32** | | **BoolItem** | **bool** | | [default to true] **ArrayItem** | **[]int32** | | +## Methods + +### NewTypeHolderDefault + +`func NewTypeHolderDefault(stringItem string, numberItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderDefault` + +NewTypeHolderDefault instantiates a new TypeHolderDefault object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTypeHolderDefaultWithDefaults + +`func NewTypeHolderDefaultWithDefaults() *TypeHolderDefault` + +NewTypeHolderDefaultWithDefaults instantiates a new TypeHolderDefault object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStringItem + +`func (o *TypeHolderDefault) GetStringItem() string` + +GetStringItem returns the StringItem field if non-nil, zero value otherwise. + +### GetStringItemOk + +`func (o *TypeHolderDefault) GetStringItemOk() (*string, bool)` + +GetStringItemOk returns a tuple with the StringItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStringItem + +`func (o *TypeHolderDefault) SetStringItem(v string)` + +SetStringItem sets StringItem field to given value. + + +### GetNumberItem + +`func (o *TypeHolderDefault) GetNumberItem() float32` + +GetNumberItem returns the NumberItem field if non-nil, zero value otherwise. + +### GetNumberItemOk + +`func (o *TypeHolderDefault) GetNumberItemOk() (*float32, bool)` + +GetNumberItemOk returns a tuple with the NumberItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumberItem + +`func (o *TypeHolderDefault) SetNumberItem(v float32)` + +SetNumberItem sets NumberItem field to given value. + + +### GetIntegerItem + +`func (o *TypeHolderDefault) GetIntegerItem() int32` + +GetIntegerItem returns the IntegerItem field if non-nil, zero value otherwise. + +### GetIntegerItemOk + +`func (o *TypeHolderDefault) GetIntegerItemOk() (*int32, bool)` + +GetIntegerItemOk returns a tuple with the IntegerItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIntegerItem + +`func (o *TypeHolderDefault) SetIntegerItem(v int32)` + +SetIntegerItem sets IntegerItem field to given value. + + +### GetBoolItem + +`func (o *TypeHolderDefault) GetBoolItem() bool` + +GetBoolItem returns the BoolItem field if non-nil, zero value otherwise. + +### GetBoolItemOk + +`func (o *TypeHolderDefault) GetBoolItemOk() (*bool, bool)` + +GetBoolItemOk returns a tuple with the BoolItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBoolItem + +`func (o *TypeHolderDefault) SetBoolItem(v bool)` + +SetBoolItem sets BoolItem field to given value. + + +### GetArrayItem + +`func (o *TypeHolderDefault) GetArrayItem() []int32` + +GetArrayItem returns the ArrayItem field if non-nil, zero value otherwise. + +### GetArrayItemOk + +`func (o *TypeHolderDefault) GetArrayItemOk() (*[]int32, bool)` + +GetArrayItemOk returns a tuple with the ArrayItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayItem + +`func (o *TypeHolderDefault) SetArrayItem(v []int32)` + +SetArrayItem sets ArrayItem field to given value. + + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md b/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md index f4d62ea836b..259aae8df56 100644 --- a/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md +++ b/samples/client/petstore/go/go-petstore/docs/TypeHolderExample.md @@ -11,6 +11,146 @@ Name | Type | Description | Notes **BoolItem** | **bool** | | **ArrayItem** | **[]int32** | | +## Methods + +### NewTypeHolderExample + +`func NewTypeHolderExample(stringItem string, numberItem float32, floatItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderExample` + +NewTypeHolderExample instantiates a new TypeHolderExample object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTypeHolderExampleWithDefaults + +`func NewTypeHolderExampleWithDefaults() *TypeHolderExample` + +NewTypeHolderExampleWithDefaults instantiates a new TypeHolderExample object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStringItem + +`func (o *TypeHolderExample) GetStringItem() string` + +GetStringItem returns the StringItem field if non-nil, zero value otherwise. + +### GetStringItemOk + +`func (o *TypeHolderExample) GetStringItemOk() (*string, bool)` + +GetStringItemOk returns a tuple with the StringItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStringItem + +`func (o *TypeHolderExample) SetStringItem(v string)` + +SetStringItem sets StringItem field to given value. + + +### GetNumberItem + +`func (o *TypeHolderExample) GetNumberItem() float32` + +GetNumberItem returns the NumberItem field if non-nil, zero value otherwise. + +### GetNumberItemOk + +`func (o *TypeHolderExample) GetNumberItemOk() (*float32, bool)` + +GetNumberItemOk returns a tuple with the NumberItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumberItem + +`func (o *TypeHolderExample) SetNumberItem(v float32)` + +SetNumberItem sets NumberItem field to given value. + + +### GetFloatItem + +`func (o *TypeHolderExample) GetFloatItem() float32` + +GetFloatItem returns the FloatItem field if non-nil, zero value otherwise. + +### GetFloatItemOk + +`func (o *TypeHolderExample) GetFloatItemOk() (*float32, bool)` + +GetFloatItemOk returns a tuple with the FloatItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFloatItem + +`func (o *TypeHolderExample) SetFloatItem(v float32)` + +SetFloatItem sets FloatItem field to given value. + + +### GetIntegerItem + +`func (o *TypeHolderExample) GetIntegerItem() int32` + +GetIntegerItem returns the IntegerItem field if non-nil, zero value otherwise. + +### GetIntegerItemOk + +`func (o *TypeHolderExample) GetIntegerItemOk() (*int32, bool)` + +GetIntegerItemOk returns a tuple with the IntegerItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIntegerItem + +`func (o *TypeHolderExample) SetIntegerItem(v int32)` + +SetIntegerItem sets IntegerItem field to given value. + + +### GetBoolItem + +`func (o *TypeHolderExample) GetBoolItem() bool` + +GetBoolItem returns the BoolItem field if non-nil, zero value otherwise. + +### GetBoolItemOk + +`func (o *TypeHolderExample) GetBoolItemOk() (*bool, bool)` + +GetBoolItemOk returns a tuple with the BoolItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBoolItem + +`func (o *TypeHolderExample) SetBoolItem(v bool)` + +SetBoolItem sets BoolItem field to given value. + + +### GetArrayItem + +`func (o *TypeHolderExample) GetArrayItem() []int32` + +GetArrayItem returns the ArrayItem field if non-nil, zero value otherwise. + +### GetArrayItemOk + +`func (o *TypeHolderExample) GetArrayItemOk() (*[]int32, bool)` + +GetArrayItemOk returns a tuple with the ArrayItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayItem + +`func (o *TypeHolderExample) SetArrayItem(v []int32)` + +SetArrayItem sets ArrayItem field to given value. + + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/User.md b/samples/client/petstore/go/go-petstore/docs/User.md index 7675d7ff701..a6bea41030b 100644 --- a/samples/client/petstore/go/go-petstore/docs/User.md +++ b/samples/client/petstore/go/go-petstore/docs/User.md @@ -4,14 +4,234 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int32** | User Status | [optional] +**Id** | Pointer to **int64** | | [optional] +**Username** | Pointer to **string** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**UserStatus** | Pointer to **int32** | User Status | [optional] + +## Methods + +### NewUser + +`func NewUser() *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *User) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *User) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *User) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *User) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetUsername + +`func (o *User) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *User) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *User) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *User) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetEmail + +`func (o *User) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *User) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *User) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *User) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetPassword + +`func (o *User) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *User) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *User) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *User) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetPhone + +`func (o *User) GetPhone() string` + +GetPhone returns the Phone field if non-nil, zero value otherwise. + +### GetPhoneOk + +`func (o *User) GetPhoneOk() (*string, bool)` + +GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhone + +`func (o *User) SetPhone(v string)` + +SetPhone sets Phone field to given value. + +### HasPhone + +`func (o *User) HasPhone() bool` + +HasPhone returns a boolean if a field has been set. + +### GetUserStatus + +`func (o *User) GetUserStatus() int32` + +GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. + +### GetUserStatusOk + +`func (o *User) GetUserStatusOk() (*int32, bool)` + +GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserStatus + +`func (o *User) SetUserStatus(v int32)` + +SetUserStatus sets UserStatus field to given value. + +### HasUserStatus + +`func (o *User) HasUserStatus() bool` + +HasUserStatus returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/docs/UserApi.md b/samples/client/petstore/go/go-petstore/docs/UserApi.md index d9f16bb5fb0..761b86e84be 100644 --- a/samples/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/client/petstore/go/go-petstore/docs/UserApi.md @@ -17,19 +17,49 @@ Method | HTTP request | Description ## CreateUser -> CreateUser(ctx, body) +> CreateUser(ctx).Body(body).Execute() Create user -This can only be done by the logged in user. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123} // User | Created user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.CreateUser(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md) | Created user object | ### Return type @@ -51,17 +81,47 @@ No authorization required ## CreateUsersWithArrayInput -> CreateUsersWithArrayInput(ctx, body) +> CreateUsersWithArrayInput(ctx).Body(body).Execute() Creates list of users with given input array -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := []User{openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123}} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUsersWithArrayInputRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**[]User**](User.md)| List of user object | + **body** | [**[]User**](User.md) | List of user object | ### Return type @@ -83,17 +143,47 @@ No authorization required ## CreateUsersWithListInput -> CreateUsersWithListInput(ctx, body) +> CreateUsersWithListInput(ctx).Body(body).Execute() Creates list of users with given input array -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := []User{} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background(), body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUsersWithListInputRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**body** | [**[]User**](User.md)| List of user object | + **body** | [**[]User**](User.md) | List of user object | ### Return type @@ -115,19 +205,53 @@ No authorization required ## DeleteUser -> DeleteUser(ctx, username) +> DeleteUser(ctx, username).Execute() Delete user -This can only be done by the logged in user. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The name that needs to be deleted + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The name that needs to be deleted | +**username** | **string** | The name that needs to be deleted | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -149,17 +273,53 @@ No authorization required ## GetUserByName -> User GetUserByName(ctx, username) +> User GetUserByName(ctx, username).Execute() Get user by user name -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUserByName`: User + fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserByName`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The name that needs to be fetched. Use user1 for testing. | +**username** | **string** | The name that needs to be fetched. Use user1 for testing. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUserByNameRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -181,18 +341,51 @@ No authorization required ## LoginUser -> string LoginUser(ctx, username, password) +> string LoginUser(ctx).Username(username).Password(password).Execute() Logs user into the system -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The user name for login + password := "password_example" // string | The password for login in clear text + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.LoginUser(context.Background(), username, password).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `LoginUser`: string + fmt.Fprintf(os.Stdout, "Response from `UserApi.LoginUser`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiLoginUserRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The user name for login | -**password** | **string**| The password for login in clear text | + **username** | **string** | The user name for login | + **password** | **string** | The password for login in clear text | ### Return type @@ -214,14 +407,43 @@ No authorization required ## LogoutUser -> LogoutUser(ctx, ) +> LogoutUser(ctx).Execute() Logs out current logged in user session -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.LogoutUser(context.Background(), ).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters This endpoint does not need any parameter. +### Other Parameters + +Other parameters are passed through a pointer to a apiLogoutUserRequest struct via the builder pattern + + ### Return type (empty response body) @@ -242,20 +464,55 @@ No authorization required ## UpdateUser -> UpdateUser(ctx, username, body) +> UpdateUser(ctx, username).Body(body).Execute() Updated user -This can only be done by the logged in user. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | name that need to be deleted + body := // User | Updated user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username, body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| name that need to be deleted | -**body** | [**User**](User.md)| Updated user object | +**username** | **string** | name that need to be deleted | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**User**](User.md) | Updated user object | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/XmlItem.md b/samples/client/petstore/go/go-petstore/docs/XmlItem.md index 8a9c2dc0b50..b309819923e 100644 --- a/samples/client/petstore/go/go-petstore/docs/XmlItem.md +++ b/samples/client/petstore/go/go-petstore/docs/XmlItem.md @@ -4,35 +4,780 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AttributeString** | **string** | | [optional] -**AttributeNumber** | **float32** | | [optional] -**AttributeInteger** | **int32** | | [optional] -**AttributeBoolean** | **bool** | | [optional] -**WrappedArray** | **[]int32** | | [optional] -**NameString** | **string** | | [optional] -**NameNumber** | **float32** | | [optional] -**NameInteger** | **int32** | | [optional] -**NameBoolean** | **bool** | | [optional] -**NameArray** | **[]int32** | | [optional] -**NameWrappedArray** | **[]int32** | | [optional] -**PrefixString** | **string** | | [optional] -**PrefixNumber** | **float32** | | [optional] -**PrefixInteger** | **int32** | | [optional] -**PrefixBoolean** | **bool** | | [optional] -**PrefixArray** | **[]int32** | | [optional] -**PrefixWrappedArray** | **[]int32** | | [optional] -**NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **float32** | | [optional] -**NamespaceInteger** | **int32** | | [optional] -**NamespaceBoolean** | **bool** | | [optional] -**NamespaceArray** | **[]int32** | | [optional] -**NamespaceWrappedArray** | **[]int32** | | [optional] -**PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **float32** | | [optional] -**PrefixNsInteger** | **int32** | | [optional] -**PrefixNsBoolean** | **bool** | | [optional] -**PrefixNsArray** | **[]int32** | | [optional] -**PrefixNsWrappedArray** | **[]int32** | | [optional] +**AttributeString** | Pointer to **string** | | [optional] +**AttributeNumber** | Pointer to **float32** | | [optional] +**AttributeInteger** | Pointer to **int32** | | [optional] +**AttributeBoolean** | Pointer to **bool** | | [optional] +**WrappedArray** | Pointer to **[]int32** | | [optional] +**NameString** | Pointer to **string** | | [optional] +**NameNumber** | Pointer to **float32** | | [optional] +**NameInteger** | Pointer to **int32** | | [optional] +**NameBoolean** | Pointer to **bool** | | [optional] +**NameArray** | Pointer to **[]int32** | | [optional] +**NameWrappedArray** | Pointer to **[]int32** | | [optional] +**PrefixString** | Pointer to **string** | | [optional] +**PrefixNumber** | Pointer to **float32** | | [optional] +**PrefixInteger** | Pointer to **int32** | | [optional] +**PrefixBoolean** | Pointer to **bool** | | [optional] +**PrefixArray** | Pointer to **[]int32** | | [optional] +**PrefixWrappedArray** | Pointer to **[]int32** | | [optional] +**NamespaceString** | Pointer to **string** | | [optional] +**NamespaceNumber** | Pointer to **float32** | | [optional] +**NamespaceInteger** | Pointer to **int32** | | [optional] +**NamespaceBoolean** | Pointer to **bool** | | [optional] +**NamespaceArray** | Pointer to **[]int32** | | [optional] +**NamespaceWrappedArray** | Pointer to **[]int32** | | [optional] +**PrefixNsString** | Pointer to **string** | | [optional] +**PrefixNsNumber** | Pointer to **float32** | | [optional] +**PrefixNsInteger** | Pointer to **int32** | | [optional] +**PrefixNsBoolean** | Pointer to **bool** | | [optional] +**PrefixNsArray** | Pointer to **[]int32** | | [optional] +**PrefixNsWrappedArray** | Pointer to **[]int32** | | [optional] + +## Methods + +### NewXmlItem + +`func NewXmlItem() *XmlItem` + +NewXmlItem instantiates a new XmlItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewXmlItemWithDefaults + +`func NewXmlItemWithDefaults() *XmlItem` + +NewXmlItemWithDefaults instantiates a new XmlItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAttributeString + +`func (o *XmlItem) GetAttributeString() string` + +GetAttributeString returns the AttributeString field if non-nil, zero value otherwise. + +### GetAttributeStringOk + +`func (o *XmlItem) GetAttributeStringOk() (*string, bool)` + +GetAttributeStringOk returns a tuple with the AttributeString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributeString + +`func (o *XmlItem) SetAttributeString(v string)` + +SetAttributeString sets AttributeString field to given value. + +### HasAttributeString + +`func (o *XmlItem) HasAttributeString() bool` + +HasAttributeString returns a boolean if a field has been set. + +### GetAttributeNumber + +`func (o *XmlItem) GetAttributeNumber() float32` + +GetAttributeNumber returns the AttributeNumber field if non-nil, zero value otherwise. + +### GetAttributeNumberOk + +`func (o *XmlItem) GetAttributeNumberOk() (*float32, bool)` + +GetAttributeNumberOk returns a tuple with the AttributeNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributeNumber + +`func (o *XmlItem) SetAttributeNumber(v float32)` + +SetAttributeNumber sets AttributeNumber field to given value. + +### HasAttributeNumber + +`func (o *XmlItem) HasAttributeNumber() bool` + +HasAttributeNumber returns a boolean if a field has been set. + +### GetAttributeInteger + +`func (o *XmlItem) GetAttributeInteger() int32` + +GetAttributeInteger returns the AttributeInteger field if non-nil, zero value otherwise. + +### GetAttributeIntegerOk + +`func (o *XmlItem) GetAttributeIntegerOk() (*int32, bool)` + +GetAttributeIntegerOk returns a tuple with the AttributeInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributeInteger + +`func (o *XmlItem) SetAttributeInteger(v int32)` + +SetAttributeInteger sets AttributeInteger field to given value. + +### HasAttributeInteger + +`func (o *XmlItem) HasAttributeInteger() bool` + +HasAttributeInteger returns a boolean if a field has been set. + +### GetAttributeBoolean + +`func (o *XmlItem) GetAttributeBoolean() bool` + +GetAttributeBoolean returns the AttributeBoolean field if non-nil, zero value otherwise. + +### GetAttributeBooleanOk + +`func (o *XmlItem) GetAttributeBooleanOk() (*bool, bool)` + +GetAttributeBooleanOk returns a tuple with the AttributeBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributeBoolean + +`func (o *XmlItem) SetAttributeBoolean(v bool)` + +SetAttributeBoolean sets AttributeBoolean field to given value. + +### HasAttributeBoolean + +`func (o *XmlItem) HasAttributeBoolean() bool` + +HasAttributeBoolean returns a boolean if a field has been set. + +### GetWrappedArray + +`func (o *XmlItem) GetWrappedArray() []int32` + +GetWrappedArray returns the WrappedArray field if non-nil, zero value otherwise. + +### GetWrappedArrayOk + +`func (o *XmlItem) GetWrappedArrayOk() (*[]int32, bool)` + +GetWrappedArrayOk returns a tuple with the WrappedArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWrappedArray + +`func (o *XmlItem) SetWrappedArray(v []int32)` + +SetWrappedArray sets WrappedArray field to given value. + +### HasWrappedArray + +`func (o *XmlItem) HasWrappedArray() bool` + +HasWrappedArray returns a boolean if a field has been set. + +### GetNameString + +`func (o *XmlItem) GetNameString() string` + +GetNameString returns the NameString field if non-nil, zero value otherwise. + +### GetNameStringOk + +`func (o *XmlItem) GetNameStringOk() (*string, bool)` + +GetNameStringOk returns a tuple with the NameString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameString + +`func (o *XmlItem) SetNameString(v string)` + +SetNameString sets NameString field to given value. + +### HasNameString + +`func (o *XmlItem) HasNameString() bool` + +HasNameString returns a boolean if a field has been set. + +### GetNameNumber + +`func (o *XmlItem) GetNameNumber() float32` + +GetNameNumber returns the NameNumber field if non-nil, zero value otherwise. + +### GetNameNumberOk + +`func (o *XmlItem) GetNameNumberOk() (*float32, bool)` + +GetNameNumberOk returns a tuple with the NameNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameNumber + +`func (o *XmlItem) SetNameNumber(v float32)` + +SetNameNumber sets NameNumber field to given value. + +### HasNameNumber + +`func (o *XmlItem) HasNameNumber() bool` + +HasNameNumber returns a boolean if a field has been set. + +### GetNameInteger + +`func (o *XmlItem) GetNameInteger() int32` + +GetNameInteger returns the NameInteger field if non-nil, zero value otherwise. + +### GetNameIntegerOk + +`func (o *XmlItem) GetNameIntegerOk() (*int32, bool)` + +GetNameIntegerOk returns a tuple with the NameInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameInteger + +`func (o *XmlItem) SetNameInteger(v int32)` + +SetNameInteger sets NameInteger field to given value. + +### HasNameInteger + +`func (o *XmlItem) HasNameInteger() bool` + +HasNameInteger returns a boolean if a field has been set. + +### GetNameBoolean + +`func (o *XmlItem) GetNameBoolean() bool` + +GetNameBoolean returns the NameBoolean field if non-nil, zero value otherwise. + +### GetNameBooleanOk + +`func (o *XmlItem) GetNameBooleanOk() (*bool, bool)` + +GetNameBooleanOk returns a tuple with the NameBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameBoolean + +`func (o *XmlItem) SetNameBoolean(v bool)` + +SetNameBoolean sets NameBoolean field to given value. + +### HasNameBoolean + +`func (o *XmlItem) HasNameBoolean() bool` + +HasNameBoolean returns a boolean if a field has been set. + +### GetNameArray + +`func (o *XmlItem) GetNameArray() []int32` + +GetNameArray returns the NameArray field if non-nil, zero value otherwise. + +### GetNameArrayOk + +`func (o *XmlItem) GetNameArrayOk() (*[]int32, bool)` + +GetNameArrayOk returns a tuple with the NameArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameArray + +`func (o *XmlItem) SetNameArray(v []int32)` + +SetNameArray sets NameArray field to given value. + +### HasNameArray + +`func (o *XmlItem) HasNameArray() bool` + +HasNameArray returns a boolean if a field has been set. + +### GetNameWrappedArray + +`func (o *XmlItem) GetNameWrappedArray() []int32` + +GetNameWrappedArray returns the NameWrappedArray field if non-nil, zero value otherwise. + +### GetNameWrappedArrayOk + +`func (o *XmlItem) GetNameWrappedArrayOk() (*[]int32, bool)` + +GetNameWrappedArrayOk returns a tuple with the NameWrappedArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameWrappedArray + +`func (o *XmlItem) SetNameWrappedArray(v []int32)` + +SetNameWrappedArray sets NameWrappedArray field to given value. + +### HasNameWrappedArray + +`func (o *XmlItem) HasNameWrappedArray() bool` + +HasNameWrappedArray returns a boolean if a field has been set. + +### GetPrefixString + +`func (o *XmlItem) GetPrefixString() string` + +GetPrefixString returns the PrefixString field if non-nil, zero value otherwise. + +### GetPrefixStringOk + +`func (o *XmlItem) GetPrefixStringOk() (*string, bool)` + +GetPrefixStringOk returns a tuple with the PrefixString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixString + +`func (o *XmlItem) SetPrefixString(v string)` + +SetPrefixString sets PrefixString field to given value. + +### HasPrefixString + +`func (o *XmlItem) HasPrefixString() bool` + +HasPrefixString returns a boolean if a field has been set. + +### GetPrefixNumber + +`func (o *XmlItem) GetPrefixNumber() float32` + +GetPrefixNumber returns the PrefixNumber field if non-nil, zero value otherwise. + +### GetPrefixNumberOk + +`func (o *XmlItem) GetPrefixNumberOk() (*float32, bool)` + +GetPrefixNumberOk returns a tuple with the PrefixNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNumber + +`func (o *XmlItem) SetPrefixNumber(v float32)` + +SetPrefixNumber sets PrefixNumber field to given value. + +### HasPrefixNumber + +`func (o *XmlItem) HasPrefixNumber() bool` + +HasPrefixNumber returns a boolean if a field has been set. + +### GetPrefixInteger + +`func (o *XmlItem) GetPrefixInteger() int32` + +GetPrefixInteger returns the PrefixInteger field if non-nil, zero value otherwise. + +### GetPrefixIntegerOk + +`func (o *XmlItem) GetPrefixIntegerOk() (*int32, bool)` + +GetPrefixIntegerOk returns a tuple with the PrefixInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixInteger + +`func (o *XmlItem) SetPrefixInteger(v int32)` + +SetPrefixInteger sets PrefixInteger field to given value. + +### HasPrefixInteger + +`func (o *XmlItem) HasPrefixInteger() bool` + +HasPrefixInteger returns a boolean if a field has been set. + +### GetPrefixBoolean + +`func (o *XmlItem) GetPrefixBoolean() bool` + +GetPrefixBoolean returns the PrefixBoolean field if non-nil, zero value otherwise. + +### GetPrefixBooleanOk + +`func (o *XmlItem) GetPrefixBooleanOk() (*bool, bool)` + +GetPrefixBooleanOk returns a tuple with the PrefixBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixBoolean + +`func (o *XmlItem) SetPrefixBoolean(v bool)` + +SetPrefixBoolean sets PrefixBoolean field to given value. + +### HasPrefixBoolean + +`func (o *XmlItem) HasPrefixBoolean() bool` + +HasPrefixBoolean returns a boolean if a field has been set. + +### GetPrefixArray + +`func (o *XmlItem) GetPrefixArray() []int32` + +GetPrefixArray returns the PrefixArray field if non-nil, zero value otherwise. + +### GetPrefixArrayOk + +`func (o *XmlItem) GetPrefixArrayOk() (*[]int32, bool)` + +GetPrefixArrayOk returns a tuple with the PrefixArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixArray + +`func (o *XmlItem) SetPrefixArray(v []int32)` + +SetPrefixArray sets PrefixArray field to given value. + +### HasPrefixArray + +`func (o *XmlItem) HasPrefixArray() bool` + +HasPrefixArray returns a boolean if a field has been set. + +### GetPrefixWrappedArray + +`func (o *XmlItem) GetPrefixWrappedArray() []int32` + +GetPrefixWrappedArray returns the PrefixWrappedArray field if non-nil, zero value otherwise. + +### GetPrefixWrappedArrayOk + +`func (o *XmlItem) GetPrefixWrappedArrayOk() (*[]int32, bool)` + +GetPrefixWrappedArrayOk returns a tuple with the PrefixWrappedArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixWrappedArray + +`func (o *XmlItem) SetPrefixWrappedArray(v []int32)` + +SetPrefixWrappedArray sets PrefixWrappedArray field to given value. + +### HasPrefixWrappedArray + +`func (o *XmlItem) HasPrefixWrappedArray() bool` + +HasPrefixWrappedArray returns a boolean if a field has been set. + +### GetNamespaceString + +`func (o *XmlItem) GetNamespaceString() string` + +GetNamespaceString returns the NamespaceString field if non-nil, zero value otherwise. + +### GetNamespaceStringOk + +`func (o *XmlItem) GetNamespaceStringOk() (*string, bool)` + +GetNamespaceStringOk returns a tuple with the NamespaceString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespaceString + +`func (o *XmlItem) SetNamespaceString(v string)` + +SetNamespaceString sets NamespaceString field to given value. + +### HasNamespaceString + +`func (o *XmlItem) HasNamespaceString() bool` + +HasNamespaceString returns a boolean if a field has been set. + +### GetNamespaceNumber + +`func (o *XmlItem) GetNamespaceNumber() float32` + +GetNamespaceNumber returns the NamespaceNumber field if non-nil, zero value otherwise. + +### GetNamespaceNumberOk + +`func (o *XmlItem) GetNamespaceNumberOk() (*float32, bool)` + +GetNamespaceNumberOk returns a tuple with the NamespaceNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespaceNumber + +`func (o *XmlItem) SetNamespaceNumber(v float32)` + +SetNamespaceNumber sets NamespaceNumber field to given value. + +### HasNamespaceNumber + +`func (o *XmlItem) HasNamespaceNumber() bool` + +HasNamespaceNumber returns a boolean if a field has been set. + +### GetNamespaceInteger + +`func (o *XmlItem) GetNamespaceInteger() int32` + +GetNamespaceInteger returns the NamespaceInteger field if non-nil, zero value otherwise. + +### GetNamespaceIntegerOk + +`func (o *XmlItem) GetNamespaceIntegerOk() (*int32, bool)` + +GetNamespaceIntegerOk returns a tuple with the NamespaceInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespaceInteger + +`func (o *XmlItem) SetNamespaceInteger(v int32)` + +SetNamespaceInteger sets NamespaceInteger field to given value. + +### HasNamespaceInteger + +`func (o *XmlItem) HasNamespaceInteger() bool` + +HasNamespaceInteger returns a boolean if a field has been set. + +### GetNamespaceBoolean + +`func (o *XmlItem) GetNamespaceBoolean() bool` + +GetNamespaceBoolean returns the NamespaceBoolean field if non-nil, zero value otherwise. + +### GetNamespaceBooleanOk + +`func (o *XmlItem) GetNamespaceBooleanOk() (*bool, bool)` + +GetNamespaceBooleanOk returns a tuple with the NamespaceBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespaceBoolean + +`func (o *XmlItem) SetNamespaceBoolean(v bool)` + +SetNamespaceBoolean sets NamespaceBoolean field to given value. + +### HasNamespaceBoolean + +`func (o *XmlItem) HasNamespaceBoolean() bool` + +HasNamespaceBoolean returns a boolean if a field has been set. + +### GetNamespaceArray + +`func (o *XmlItem) GetNamespaceArray() []int32` + +GetNamespaceArray returns the NamespaceArray field if non-nil, zero value otherwise. + +### GetNamespaceArrayOk + +`func (o *XmlItem) GetNamespaceArrayOk() (*[]int32, bool)` + +GetNamespaceArrayOk returns a tuple with the NamespaceArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespaceArray + +`func (o *XmlItem) SetNamespaceArray(v []int32)` + +SetNamespaceArray sets NamespaceArray field to given value. + +### HasNamespaceArray + +`func (o *XmlItem) HasNamespaceArray() bool` + +HasNamespaceArray returns a boolean if a field has been set. + +### GetNamespaceWrappedArray + +`func (o *XmlItem) GetNamespaceWrappedArray() []int32` + +GetNamespaceWrappedArray returns the NamespaceWrappedArray field if non-nil, zero value otherwise. + +### GetNamespaceWrappedArrayOk + +`func (o *XmlItem) GetNamespaceWrappedArrayOk() (*[]int32, bool)` + +GetNamespaceWrappedArrayOk returns a tuple with the NamespaceWrappedArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespaceWrappedArray + +`func (o *XmlItem) SetNamespaceWrappedArray(v []int32)` + +SetNamespaceWrappedArray sets NamespaceWrappedArray field to given value. + +### HasNamespaceWrappedArray + +`func (o *XmlItem) HasNamespaceWrappedArray() bool` + +HasNamespaceWrappedArray returns a boolean if a field has been set. + +### GetPrefixNsString + +`func (o *XmlItem) GetPrefixNsString() string` + +GetPrefixNsString returns the PrefixNsString field if non-nil, zero value otherwise. + +### GetPrefixNsStringOk + +`func (o *XmlItem) GetPrefixNsStringOk() (*string, bool)` + +GetPrefixNsStringOk returns a tuple with the PrefixNsString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNsString + +`func (o *XmlItem) SetPrefixNsString(v string)` + +SetPrefixNsString sets PrefixNsString field to given value. + +### HasPrefixNsString + +`func (o *XmlItem) HasPrefixNsString() bool` + +HasPrefixNsString returns a boolean if a field has been set. + +### GetPrefixNsNumber + +`func (o *XmlItem) GetPrefixNsNumber() float32` + +GetPrefixNsNumber returns the PrefixNsNumber field if non-nil, zero value otherwise. + +### GetPrefixNsNumberOk + +`func (o *XmlItem) GetPrefixNsNumberOk() (*float32, bool)` + +GetPrefixNsNumberOk returns a tuple with the PrefixNsNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNsNumber + +`func (o *XmlItem) SetPrefixNsNumber(v float32)` + +SetPrefixNsNumber sets PrefixNsNumber field to given value. + +### HasPrefixNsNumber + +`func (o *XmlItem) HasPrefixNsNumber() bool` + +HasPrefixNsNumber returns a boolean if a field has been set. + +### GetPrefixNsInteger + +`func (o *XmlItem) GetPrefixNsInteger() int32` + +GetPrefixNsInteger returns the PrefixNsInteger field if non-nil, zero value otherwise. + +### GetPrefixNsIntegerOk + +`func (o *XmlItem) GetPrefixNsIntegerOk() (*int32, bool)` + +GetPrefixNsIntegerOk returns a tuple with the PrefixNsInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNsInteger + +`func (o *XmlItem) SetPrefixNsInteger(v int32)` + +SetPrefixNsInteger sets PrefixNsInteger field to given value. + +### HasPrefixNsInteger + +`func (o *XmlItem) HasPrefixNsInteger() bool` + +HasPrefixNsInteger returns a boolean if a field has been set. + +### GetPrefixNsBoolean + +`func (o *XmlItem) GetPrefixNsBoolean() bool` + +GetPrefixNsBoolean returns the PrefixNsBoolean field if non-nil, zero value otherwise. + +### GetPrefixNsBooleanOk + +`func (o *XmlItem) GetPrefixNsBooleanOk() (*bool, bool)` + +GetPrefixNsBooleanOk returns a tuple with the PrefixNsBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNsBoolean + +`func (o *XmlItem) SetPrefixNsBoolean(v bool)` + +SetPrefixNsBoolean sets PrefixNsBoolean field to given value. + +### HasPrefixNsBoolean + +`func (o *XmlItem) HasPrefixNsBoolean() bool` + +HasPrefixNsBoolean returns a boolean if a field has been set. + +### GetPrefixNsArray + +`func (o *XmlItem) GetPrefixNsArray() []int32` + +GetPrefixNsArray returns the PrefixNsArray field if non-nil, zero value otherwise. + +### GetPrefixNsArrayOk + +`func (o *XmlItem) GetPrefixNsArrayOk() (*[]int32, bool)` + +GetPrefixNsArrayOk returns a tuple with the PrefixNsArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNsArray + +`func (o *XmlItem) SetPrefixNsArray(v []int32)` + +SetPrefixNsArray sets PrefixNsArray field to given value. + +### HasPrefixNsArray + +`func (o *XmlItem) HasPrefixNsArray() bool` + +HasPrefixNsArray returns a boolean if a field has been set. + +### GetPrefixNsWrappedArray + +`func (o *XmlItem) GetPrefixNsWrappedArray() []int32` + +GetPrefixNsWrappedArray returns the PrefixNsWrappedArray field if non-nil, zero value otherwise. + +### GetPrefixNsWrappedArrayOk + +`func (o *XmlItem) GetPrefixNsWrappedArrayOk() (*[]int32, bool)` + +GetPrefixNsWrappedArrayOk returns a tuple with the PrefixNsWrappedArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefixNsWrappedArray + +`func (o *XmlItem) SetPrefixNsWrappedArray(v []int32)` + +SetPrefixNsWrappedArray sets PrefixNsWrappedArray field to given value. + +### HasPrefixNsWrappedArray + +`func (o *XmlItem) HasPrefixNsWrappedArray() bool` + +HasPrefixNsWrappedArray returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go/go-petstore/go.mod b/samples/client/petstore/go/go-petstore/go.mod index 1af1846f985..f9811556cc5 100644 --- a/samples/client/petstore/go/go-petstore/go.mod +++ b/samples/client/petstore/go/go-petstore/go.mod @@ -1,6 +1,7 @@ module github.com/GIT_USER_ID/GIT_REPO_ID +go 1.13 + require ( - github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 ) diff --git a/samples/client/petstore/go/go-petstore/go.sum b/samples/client/petstore/go/go-petstore/go.sum index ee695202297..ce55b3c6a08 100644 --- a/samples/client/petstore/go/go-petstore/go.sum +++ b/samples/client/petstore/go/go-petstore/go.sum @@ -1,8 +1,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= -github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/samples/client/petstore/go/go-petstore/model_200_response.go b/samples/client/petstore/go/go-petstore/model_200_response.go index 8ae5118c9fd..c23c13c54c2 100644 --- a/samples/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/client/petstore/go/go-petstore/model_200_response.go @@ -8,8 +8,143 @@ */ package petstore + +import ( + "encoding/json" +) + // Model200Response Model for testing model name starting with number type Model200Response struct { - Name int32 `json:"name,omitempty"` - Class string `json:"class,omitempty"` + Name *int32 `json:"name,omitempty"` + Class *string `json:"class,omitempty"` } + +// NewModel200Response instantiates a new Model200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModel200Response() *Model200Response { + this := Model200Response{} + return &this +} + +// NewModel200ResponseWithDefaults instantiates a new Model200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModel200ResponseWithDefaults() *Model200Response { + this := Model200Response{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Model200Response) GetName() int32 { + if o == nil || o.Name == nil { + var ret int32 + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetNameOk() (*int32, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Model200Response) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given int32 and assigns it to the Name field. +func (o *Model200Response) SetName(v int32) { + o.Name = &v +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Model200Response) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetClassOk() (*string, bool) { + if o == nil || o.Class == nil { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Model200Response) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Model200Response) SetClass(v string) { + o.Class = &v +} + +func (o Model200Response) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Class != nil { + toSerialize["class"] = o.Class + } + return json.Marshal(toSerialize) +} + +type NullableModel200Response struct { + value *Model200Response + isSet bool +} + +func (v NullableModel200Response) Get() *Model200Response { + return v.value +} + +func (v *NullableModel200Response) Set(val *Model200Response) { + v.value = val + v.isSet = true +} + +func (v NullableModel200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableModel200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModel200Response(val *Model200Response) *NullableModel200Response { + return &NullableModel200Response{value: val, isSet: true} +} + +func (v NullableModel200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModel200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go b/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go index a7b1282d7eb..a511ab6d5be 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType type AdditionalPropertiesAnyType struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesAnyType instantiates a new AdditionalPropertiesAnyType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesAnyType() *AdditionalPropertiesAnyType { + this := AdditionalPropertiesAnyType{} + return &this +} + +// NewAdditionalPropertiesAnyTypeWithDefaults instantiates a new AdditionalPropertiesAnyType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesAnyTypeWithDefaults() *AdditionalPropertiesAnyType { + this := AdditionalPropertiesAnyType{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesAnyType) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesAnyType) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesAnyType) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesAnyType) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesAnyType struct { + value *AdditionalPropertiesAnyType + isSet bool +} + +func (v NullableAdditionalPropertiesAnyType) Get() *AdditionalPropertiesAnyType { + return v.value +} + +func (v *NullableAdditionalPropertiesAnyType) Set(val *AdditionalPropertiesAnyType) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesAnyType) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesAnyType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesAnyType(val *AdditionalPropertiesAnyType) *NullableAdditionalPropertiesAnyType { + return &NullableAdditionalPropertiesAnyType{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesAnyType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_array.go b/samples/client/petstore/go/go-petstore/model_additional_properties_array.go index f5483849933..7952e9cd56a 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_array.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_array.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesArray struct for AdditionalPropertiesArray type AdditionalPropertiesArray struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesArray instantiates a new AdditionalPropertiesArray object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesArray() *AdditionalPropertiesArray { + this := AdditionalPropertiesArray{} + return &this +} + +// NewAdditionalPropertiesArrayWithDefaults instantiates a new AdditionalPropertiesArray object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesArrayWithDefaults() *AdditionalPropertiesArray { + this := AdditionalPropertiesArray{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesArray) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesArray) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesArray) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesArray) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesArray) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesArray struct { + value *AdditionalPropertiesArray + isSet bool +} + +func (v NullableAdditionalPropertiesArray) Get() *AdditionalPropertiesArray { + return v.value +} + +func (v *NullableAdditionalPropertiesArray) Set(val *AdditionalPropertiesArray) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesArray) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesArray) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesArray(val *AdditionalPropertiesArray) *NullableAdditionalPropertiesArray { + return &NullableAdditionalPropertiesArray{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesArray) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesArray) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go b/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go index 14474772978..f64d9633a47 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_boolean.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean type AdditionalPropertiesBoolean struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesBoolean instantiates a new AdditionalPropertiesBoolean object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesBoolean() *AdditionalPropertiesBoolean { + this := AdditionalPropertiesBoolean{} + return &this +} + +// NewAdditionalPropertiesBooleanWithDefaults instantiates a new AdditionalPropertiesBoolean object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesBooleanWithDefaults() *AdditionalPropertiesBoolean { + this := AdditionalPropertiesBoolean{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesBoolean) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesBoolean) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesBoolean) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesBoolean) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesBoolean struct { + value *AdditionalPropertiesBoolean + isSet bool +} + +func (v NullableAdditionalPropertiesBoolean) Get() *AdditionalPropertiesBoolean { + return v.value +} + +func (v *NullableAdditionalPropertiesBoolean) Set(val *AdditionalPropertiesBoolean) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesBoolean) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesBoolean) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesBoolean(val *AdditionalPropertiesBoolean) *NullableAdditionalPropertiesBoolean { + return &NullableAdditionalPropertiesBoolean{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesBoolean) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go index 00ca7fb4406..d60a6889b74 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -8,17 +8,467 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { - MapString map[string]string `json:"map_string,omitempty"` - MapNumber map[string]float32 `json:"map_number,omitempty"` - MapInteger map[string]int32 `json:"map_integer,omitempty"` - MapBoolean map[string]bool `json:"map_boolean,omitempty"` - MapArrayInteger map[string][]int32 `json:"map_array_integer,omitempty"` - MapArrayAnytype map[string][]map[string]interface{} `json:"map_array_anytype,omitempty"` - MapMapString map[string]map[string]string `json:"map_map_string,omitempty"` - MapMapAnytype map[string]map[string]map[string]interface{} `json:"map_map_anytype,omitempty"` - Anytype1 map[string]interface{} `json:"anytype_1,omitempty"` - Anytype2 map[string]interface{} `json:"anytype_2,omitempty"` - Anytype3 map[string]interface{} `json:"anytype_3,omitempty"` + MapString *map[string]string `json:"map_string,omitempty"` + MapNumber *map[string]float32 `json:"map_number,omitempty"` + MapInteger *map[string]int32 `json:"map_integer,omitempty"` + MapBoolean *map[string]bool `json:"map_boolean,omitempty"` + MapArrayInteger *map[string][]int32 `json:"map_array_integer,omitempty"` + MapArrayAnytype *map[string][]map[string]interface{} `json:"map_array_anytype,omitempty"` + MapMapString *map[string]map[string]string `json:"map_map_string,omitempty"` + MapMapAnytype *map[string]map[string]map[string]interface{} `json:"map_map_anytype,omitempty"` + Anytype1 *map[string]interface{} `json:"anytype_1,omitempty"` + Anytype2 *map[string]interface{} `json:"anytype_2,omitempty"` + Anytype3 *map[string]interface{} `json:"anytype_3,omitempty"` } + +// NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesClass() *AdditionalPropertiesClass { + this := AdditionalPropertiesClass{} + return &this +} + +// NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass { + this := AdditionalPropertiesClass{} + return &this +} + +// GetMapString returns the MapString field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapString() map[string]string { + if o == nil || o.MapString == nil { + var ret map[string]string + return ret + } + return *o.MapString +} + +// GetMapStringOk returns a tuple with the MapString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapStringOk() (*map[string]string, bool) { + if o == nil || o.MapString == nil { + return nil, false + } + return o.MapString, true +} + +// HasMapString returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapString() bool { + if o != nil && o.MapString != nil { + return true + } + + return false +} + +// SetMapString gets a reference to the given map[string]string and assigns it to the MapString field. +func (o *AdditionalPropertiesClass) SetMapString(v map[string]string) { + o.MapString = &v +} + +// GetMapNumber returns the MapNumber field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapNumber() map[string]float32 { + if o == nil || o.MapNumber == nil { + var ret map[string]float32 + return ret + } + return *o.MapNumber +} + +// GetMapNumberOk returns a tuple with the MapNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapNumberOk() (*map[string]float32, bool) { + if o == nil || o.MapNumber == nil { + return nil, false + } + return o.MapNumber, true +} + +// HasMapNumber returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapNumber() bool { + if o != nil && o.MapNumber != nil { + return true + } + + return false +} + +// SetMapNumber gets a reference to the given map[string]float32 and assigns it to the MapNumber field. +func (o *AdditionalPropertiesClass) SetMapNumber(v map[string]float32) { + o.MapNumber = &v +} + +// GetMapInteger returns the MapInteger field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapInteger() map[string]int32 { + if o == nil || o.MapInteger == nil { + var ret map[string]int32 + return ret + } + return *o.MapInteger +} + +// GetMapIntegerOk returns a tuple with the MapInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapIntegerOk() (*map[string]int32, bool) { + if o == nil || o.MapInteger == nil { + return nil, false + } + return o.MapInteger, true +} + +// HasMapInteger returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapInteger() bool { + if o != nil && o.MapInteger != nil { + return true + } + + return false +} + +// SetMapInteger gets a reference to the given map[string]int32 and assigns it to the MapInteger field. +func (o *AdditionalPropertiesClass) SetMapInteger(v map[string]int32) { + o.MapInteger = &v +} + +// GetMapBoolean returns the MapBoolean field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapBoolean() map[string]bool { + if o == nil || o.MapBoolean == nil { + var ret map[string]bool + return ret + } + return *o.MapBoolean +} + +// GetMapBooleanOk returns a tuple with the MapBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapBooleanOk() (*map[string]bool, bool) { + if o == nil || o.MapBoolean == nil { + return nil, false + } + return o.MapBoolean, true +} + +// HasMapBoolean returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapBoolean() bool { + if o != nil && o.MapBoolean != nil { + return true + } + + return false +} + +// SetMapBoolean gets a reference to the given map[string]bool and assigns it to the MapBoolean field. +func (o *AdditionalPropertiesClass) SetMapBoolean(v map[string]bool) { + o.MapBoolean = &v +} + +// GetMapArrayInteger returns the MapArrayInteger field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapArrayInteger() map[string][]int32 { + if o == nil || o.MapArrayInteger == nil { + var ret map[string][]int32 + return ret + } + return *o.MapArrayInteger +} + +// GetMapArrayIntegerOk returns a tuple with the MapArrayInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapArrayIntegerOk() (*map[string][]int32, bool) { + if o == nil || o.MapArrayInteger == nil { + return nil, false + } + return o.MapArrayInteger, true +} + +// HasMapArrayInteger returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapArrayInteger() bool { + if o != nil && o.MapArrayInteger != nil { + return true + } + + return false +} + +// SetMapArrayInteger gets a reference to the given map[string][]int32 and assigns it to the MapArrayInteger field. +func (o *AdditionalPropertiesClass) SetMapArrayInteger(v map[string][]int32) { + o.MapArrayInteger = &v +} + +// GetMapArrayAnytype returns the MapArrayAnytype field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapArrayAnytype() map[string][]map[string]interface{} { + if o == nil || o.MapArrayAnytype == nil { + var ret map[string][]map[string]interface{} + return ret + } + return *o.MapArrayAnytype +} + +// GetMapArrayAnytypeOk returns a tuple with the MapArrayAnytype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapArrayAnytypeOk() (*map[string][]map[string]interface{}, bool) { + if o == nil || o.MapArrayAnytype == nil { + return nil, false + } + return o.MapArrayAnytype, true +} + +// HasMapArrayAnytype returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapArrayAnytype() bool { + if o != nil && o.MapArrayAnytype != nil { + return true + } + + return false +} + +// SetMapArrayAnytype gets a reference to the given map[string][]map[string]interface{} and assigns it to the MapArrayAnytype field. +func (o *AdditionalPropertiesClass) SetMapArrayAnytype(v map[string][]map[string]interface{}) { + o.MapArrayAnytype = &v +} + +// GetMapMapString returns the MapMapString field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapMapString() map[string]map[string]string { + if o == nil || o.MapMapString == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapMapString +} + +// GetMapMapStringOk returns a tuple with the MapMapString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapMapStringOk() (*map[string]map[string]string, bool) { + if o == nil || o.MapMapString == nil { + return nil, false + } + return o.MapMapString, true +} + +// HasMapMapString returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapMapString() bool { + if o != nil && o.MapMapString != nil { + return true + } + + return false +} + +// SetMapMapString gets a reference to the given map[string]map[string]string and assigns it to the MapMapString field. +func (o *AdditionalPropertiesClass) SetMapMapString(v map[string]map[string]string) { + o.MapMapString = &v +} + +// GetMapMapAnytype returns the MapMapAnytype field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapMapAnytype() map[string]map[string]map[string]interface{} { + if o == nil || o.MapMapAnytype == nil { + var ret map[string]map[string]map[string]interface{} + return ret + } + return *o.MapMapAnytype +} + +// GetMapMapAnytypeOk returns a tuple with the MapMapAnytype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapMapAnytypeOk() (*map[string]map[string]map[string]interface{}, bool) { + if o == nil || o.MapMapAnytype == nil { + return nil, false + } + return o.MapMapAnytype, true +} + +// HasMapMapAnytype returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapMapAnytype() bool { + if o != nil && o.MapMapAnytype != nil { + return true + } + + return false +} + +// SetMapMapAnytype gets a reference to the given map[string]map[string]map[string]interface{} and assigns it to the MapMapAnytype field. +func (o *AdditionalPropertiesClass) SetMapMapAnytype(v map[string]map[string]map[string]interface{}) { + o.MapMapAnytype = &v +} + +// GetAnytype1 returns the Anytype1 field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetAnytype1() map[string]interface{} { + if o == nil || o.Anytype1 == nil { + var ret map[string]interface{} + return ret + } + return *o.Anytype1 +} + +// GetAnytype1Ok returns a tuple with the Anytype1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetAnytype1Ok() (*map[string]interface{}, bool) { + if o == nil || o.Anytype1 == nil { + return nil, false + } + return o.Anytype1, true +} + +// HasAnytype1 returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasAnytype1() bool { + if o != nil && o.Anytype1 != nil { + return true + } + + return false +} + +// SetAnytype1 gets a reference to the given map[string]interface{} and assigns it to the Anytype1 field. +func (o *AdditionalPropertiesClass) SetAnytype1(v map[string]interface{}) { + o.Anytype1 = &v +} + +// GetAnytype2 returns the Anytype2 field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetAnytype2() map[string]interface{} { + if o == nil || o.Anytype2 == nil { + var ret map[string]interface{} + return ret + } + return *o.Anytype2 +} + +// GetAnytype2Ok returns a tuple with the Anytype2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetAnytype2Ok() (*map[string]interface{}, bool) { + if o == nil || o.Anytype2 == nil { + return nil, false + } + return o.Anytype2, true +} + +// HasAnytype2 returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasAnytype2() bool { + if o != nil && o.Anytype2 != nil { + return true + } + + return false +} + +// SetAnytype2 gets a reference to the given map[string]interface{} and assigns it to the Anytype2 field. +func (o *AdditionalPropertiesClass) SetAnytype2(v map[string]interface{}) { + o.Anytype2 = &v +} + +// GetAnytype3 returns the Anytype3 field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetAnytype3() map[string]interface{} { + if o == nil || o.Anytype3 == nil { + var ret map[string]interface{} + return ret + } + return *o.Anytype3 +} + +// GetAnytype3Ok returns a tuple with the Anytype3 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetAnytype3Ok() (*map[string]interface{}, bool) { + if o == nil || o.Anytype3 == nil { + return nil, false + } + return o.Anytype3, true +} + +// HasAnytype3 returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasAnytype3() bool { + if o != nil && o.Anytype3 != nil { + return true + } + + return false +} + +// SetAnytype3 gets a reference to the given map[string]interface{} and assigns it to the Anytype3 field. +func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{}) { + o.Anytype3 = &v +} + +func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapString != nil { + toSerialize["map_string"] = o.MapString + } + if o.MapNumber != nil { + toSerialize["map_number"] = o.MapNumber + } + if o.MapInteger != nil { + toSerialize["map_integer"] = o.MapInteger + } + if o.MapBoolean != nil { + toSerialize["map_boolean"] = o.MapBoolean + } + if o.MapArrayInteger != nil { + toSerialize["map_array_integer"] = o.MapArrayInteger + } + if o.MapArrayAnytype != nil { + toSerialize["map_array_anytype"] = o.MapArrayAnytype + } + if o.MapMapString != nil { + toSerialize["map_map_string"] = o.MapMapString + } + if o.MapMapAnytype != nil { + toSerialize["map_map_anytype"] = o.MapMapAnytype + } + if o.Anytype1 != nil { + toSerialize["anytype_1"] = o.Anytype1 + } + if o.Anytype2 != nil { + toSerialize["anytype_2"] = o.Anytype2 + } + if o.Anytype3 != nil { + toSerialize["anytype_3"] = o.Anytype3 + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesClass struct { + value *AdditionalPropertiesClass + isSet bool +} + +func (v NullableAdditionalPropertiesClass) Get() *AdditionalPropertiesClass { + return v.value +} + +func (v *NullableAdditionalPropertiesClass) Set(val *AdditionalPropertiesClass) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesClass) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesClass(val *AdditionalPropertiesClass) *NullableAdditionalPropertiesClass { + return &NullableAdditionalPropertiesClass{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go b/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go index 14b97ab3453..eeb60fc08db 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_integer.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesInteger struct for AdditionalPropertiesInteger type AdditionalPropertiesInteger struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesInteger instantiates a new AdditionalPropertiesInteger object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesInteger() *AdditionalPropertiesInteger { + this := AdditionalPropertiesInteger{} + return &this +} + +// NewAdditionalPropertiesIntegerWithDefaults instantiates a new AdditionalPropertiesInteger object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesIntegerWithDefaults() *AdditionalPropertiesInteger { + this := AdditionalPropertiesInteger{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesInteger) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesInteger) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesInteger) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesInteger) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesInteger) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesInteger struct { + value *AdditionalPropertiesInteger + isSet bool +} + +func (v NullableAdditionalPropertiesInteger) Get() *AdditionalPropertiesInteger { + return v.value +} + +func (v *NullableAdditionalPropertiesInteger) Set(val *AdditionalPropertiesInteger) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesInteger) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesInteger) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesInteger(val *AdditionalPropertiesInteger) *NullableAdditionalPropertiesInteger { + return &NullableAdditionalPropertiesInteger{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesInteger) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesInteger) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_number.go b/samples/client/petstore/go/go-petstore/model_additional_properties_number.go index 0516142b1c5..bd385cbe088 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_number.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_number.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesNumber struct for AdditionalPropertiesNumber type AdditionalPropertiesNumber struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesNumber instantiates a new AdditionalPropertiesNumber object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesNumber() *AdditionalPropertiesNumber { + this := AdditionalPropertiesNumber{} + return &this +} + +// NewAdditionalPropertiesNumberWithDefaults instantiates a new AdditionalPropertiesNumber object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesNumberWithDefaults() *AdditionalPropertiesNumber { + this := AdditionalPropertiesNumber{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesNumber) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesNumber) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesNumber) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesNumber) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesNumber) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesNumber struct { + value *AdditionalPropertiesNumber + isSet bool +} + +func (v NullableAdditionalPropertiesNumber) Get() *AdditionalPropertiesNumber { + return v.value +} + +func (v *NullableAdditionalPropertiesNumber) Set(val *AdditionalPropertiesNumber) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesNumber) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesNumber) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesNumber(val *AdditionalPropertiesNumber) *NullableAdditionalPropertiesNumber { + return &NullableAdditionalPropertiesNumber{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesNumber) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesNumber) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_object.go b/samples/client/petstore/go/go-petstore/model_additional_properties_object.go index 1c7d80d2293..69fb5e31044 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_object.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_object.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesObject struct for AdditionalPropertiesObject type AdditionalPropertiesObject struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesObject instantiates a new AdditionalPropertiesObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesObject() *AdditionalPropertiesObject { + this := AdditionalPropertiesObject{} + return &this +} + +// NewAdditionalPropertiesObjectWithDefaults instantiates a new AdditionalPropertiesObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesObjectWithDefaults() *AdditionalPropertiesObject { + this := AdditionalPropertiesObject{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesObject) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesObject) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesObject) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesObject) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesObject struct { + value *AdditionalPropertiesObject + isSet bool +} + +func (v NullableAdditionalPropertiesObject) Get() *AdditionalPropertiesObject { + return v.value +} + +func (v *NullableAdditionalPropertiesObject) Set(val *AdditionalPropertiesObject) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesObject) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesObject(val *AdditionalPropertiesObject) *NullableAdditionalPropertiesObject { + return &NullableAdditionalPropertiesObject{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_additional_properties_string.go b/samples/client/petstore/go/go-petstore/model_additional_properties_string.go index 460dfd78bb3..54928c3a1c9 100644 --- a/samples/client/petstore/go/go-petstore/model_additional_properties_string.go +++ b/samples/client/petstore/go/go-petstore/model_additional_properties_string.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesString struct for AdditionalPropertiesString type AdditionalPropertiesString struct { - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewAdditionalPropertiesString instantiates a new AdditionalPropertiesString object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesString() *AdditionalPropertiesString { + this := AdditionalPropertiesString{} + return &this +} + +// NewAdditionalPropertiesStringWithDefaults instantiates a new AdditionalPropertiesString object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesStringWithDefaults() *AdditionalPropertiesString { + this := AdditionalPropertiesString{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AdditionalPropertiesString) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesString) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AdditionalPropertiesString) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AdditionalPropertiesString) SetName(v string) { + o.Name = &v +} + +func (o AdditionalPropertiesString) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableAdditionalPropertiesString struct { + value *AdditionalPropertiesString + isSet bool +} + +func (v NullableAdditionalPropertiesString) Get() *AdditionalPropertiesString { + return v.value +} + +func (v *NullableAdditionalPropertiesString) Set(val *AdditionalPropertiesString) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesString) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesString(val *AdditionalPropertiesString) *NullableAdditionalPropertiesString { + return &NullableAdditionalPropertiesString{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_animal.go b/samples/client/petstore/go/go-petstore/model_animal.go index 1c09a9ddb7f..5aa1f60f02f 100644 --- a/samples/client/petstore/go/go-petstore/model_animal.go +++ b/samples/client/petstore/go/go-petstore/model_animal.go @@ -8,8 +8,140 @@ */ package petstore + +import ( + "encoding/json" +) + // Animal struct for Animal type Animal struct { ClassName string `json:"className"` - Color string `json:"color,omitempty"` + Color *string `json:"color,omitempty"` } + +// NewAnimal instantiates a new Animal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAnimal(className string, ) *Animal { + this := Animal{} + this.ClassName = className + var color string = "red" + this.Color = &color + return &this +} + +// NewAnimalWithDefaults instantiates a new Animal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAnimalWithDefaults() *Animal { + this := Animal{} + var color string = "red" + this.Color = &color + return &this +} + +// GetClassName returns the ClassName field value +func (o *Animal) GetClassName() string { + if o == nil { + var ret string + return ret + } + + return o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field value +// and a boolean to check if the value has been set. +func (o *Animal) GetClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClassName, true +} + +// SetClassName sets field value +func (o *Animal) SetClassName(v string) { + o.ClassName = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *Animal) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Animal) GetColorOk() (*string, bool) { + if o == nil || o.Color == nil { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Animal) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Animal) SetColor(v string) { + o.Color = &v +} + +func (o Animal) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + return json.Marshal(toSerialize) +} + +type NullableAnimal struct { + value *Animal + isSet bool +} + +func (v NullableAnimal) Get() *Animal { + return v.value +} + +func (v *NullableAnimal) Set(val *Animal) { + v.value = val + v.isSet = true +} + +func (v NullableAnimal) IsSet() bool { + return v.isSet +} + +func (v *NullableAnimal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnimal(val *Animal) *NullableAnimal { + return &NullableAnimal{value: val, isSet: true} +} + +func (v NullableAnimal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnimal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_api_response.go b/samples/client/petstore/go/go-petstore/model_api_response.go index de022a0afac..17bf558d1c9 100644 --- a/samples/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/client/petstore/go/go-petstore/model_api_response.go @@ -8,9 +8,179 @@ */ package petstore + +import ( + "encoding/json" +) + // ApiResponse struct for ApiResponse type ApiResponse struct { - Code int32 `json:"code,omitempty"` - Type string `json:"type,omitempty"` - Message string `json:"message,omitempty"` + Code *int32 `json:"code,omitempty"` + Type *string `json:"type,omitempty"` + Message *string `json:"message,omitempty"` } + +// NewApiResponse instantiates a new ApiResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiResponse() *ApiResponse { + this := ApiResponse{} + return &this +} + +// NewApiResponseWithDefaults instantiates a new ApiResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiResponseWithDefaults() *ApiResponse { + this := ApiResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ApiResponse) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetCodeOk() (*int32, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiResponse) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiResponse) SetCode(v int32) { + o.Code = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ApiResponse) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ApiResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ApiResponse) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApiResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiResponse) SetMessage(v string) { + o.Message = &v +} + +func (o ApiResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + return json.Marshal(toSerialize) +} + +type NullableApiResponse struct { + value *ApiResponse + isSet bool +} + +func (v NullableApiResponse) Get() *ApiResponse { + return v.value +} + +func (v *NullableApiResponse) Set(val *ApiResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiResponse(val *ApiResponse) *NullableApiResponse { + return &NullableApiResponse{value: val, isSet: true} +} + +func (v NullableApiResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index a0818c18147..6b81323ac4d 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` + ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` } + +// NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly { + this := ArrayOfArrayOfNumberOnly{} + return &this +} + +// NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly { + this := ArrayOfArrayOfNumberOnly{} + return &this +} + +// GetArrayArrayNumber returns the ArrayArrayNumber field value if set, zero value otherwise. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { + if o == nil || o.ArrayArrayNumber == nil { + var ret [][]float32 + return ret + } + return *o.ArrayArrayNumber +} + +// GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool) { + if o == nil || o.ArrayArrayNumber == nil { + return nil, false + } + return o.ArrayArrayNumber, true +} + +// HasArrayArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { + if o != nil && o.ArrayArrayNumber != nil { + return true + } + + return false +} + +// SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. +func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { + o.ArrayArrayNumber = &v +} + +func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayArrayNumber != nil { + toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber + } + return json.Marshal(toSerialize) +} + +type NullableArrayOfArrayOfNumberOnly struct { + value *ArrayOfArrayOfNumberOnly + isSet bool +} + +func (v NullableArrayOfArrayOfNumberOnly) Get() *ArrayOfArrayOfNumberOnly { + return v.value +} + +func (v *NullableArrayOfArrayOfNumberOnly) Set(val *ArrayOfArrayOfNumberOnly) { + v.value = val + v.isSet = true +} + +func (v NullableArrayOfArrayOfNumberOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayOfArrayOfNumberOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayOfArrayOfNumberOnly(val *ArrayOfArrayOfNumberOnly) *NullableArrayOfArrayOfNumberOnly { + return &NullableArrayOfArrayOfNumberOnly{value: val, isSet: true} +} + +func (v NullableArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayOfArrayOfNumberOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go index 521dd4a778c..f43bffc1c87 100644 --- a/samples/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { - ArrayNumber []float32 `json:"ArrayNumber,omitempty"` + ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` } + +// NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArrayOfNumberOnly() *ArrayOfNumberOnly { + this := ArrayOfNumberOnly{} + return &this +} + +// NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly { + this := ArrayOfNumberOnly{} + return &this +} + +// GetArrayNumber returns the ArrayNumber field value if set, zero value otherwise. +func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { + if o == nil || o.ArrayNumber == nil { + var ret []float32 + return ret + } + return *o.ArrayNumber +} + +// GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool) { + if o == nil || o.ArrayNumber == nil { + return nil, false + } + return o.ArrayNumber, true +} + +// HasArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfNumberOnly) HasArrayNumber() bool { + if o != nil && o.ArrayNumber != nil { + return true + } + + return false +} + +// SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. +func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { + o.ArrayNumber = &v +} + +func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayNumber != nil { + toSerialize["ArrayNumber"] = o.ArrayNumber + } + return json.Marshal(toSerialize) +} + +type NullableArrayOfNumberOnly struct { + value *ArrayOfNumberOnly + isSet bool +} + +func (v NullableArrayOfNumberOnly) Get() *ArrayOfNumberOnly { + return v.value +} + +func (v *NullableArrayOfNumberOnly) Set(val *ArrayOfNumberOnly) { + v.value = val + v.isSet = true +} + +func (v NullableArrayOfNumberOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayOfNumberOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayOfNumberOnly(val *ArrayOfNumberOnly) *NullableArrayOfNumberOnly { + return &NullableArrayOfNumberOnly{value: val, isSet: true} +} + +func (v NullableArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayOfNumberOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_array_test_.go b/samples/client/petstore/go/go-petstore/model_array_test_.go index 2ea7b84212b..42e2be66d62 100644 --- a/samples/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore/model_array_test_.go @@ -8,9 +8,179 @@ */ package petstore + +import ( + "encoding/json" +) + // ArrayTest struct for ArrayTest type ArrayTest struct { - ArrayOfString []string `json:"array_of_string,omitempty"` - ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` - ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + ArrayOfString *[]string `json:"array_of_string,omitempty"` + ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` + ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` } + +// NewArrayTest instantiates a new ArrayTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArrayTest() *ArrayTest { + this := ArrayTest{} + return &this +} + +// NewArrayTestWithDefaults instantiates a new ArrayTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArrayTestWithDefaults() *ArrayTest { + this := ArrayTest{} + return &this +} + +// GetArrayOfString returns the ArrayOfString field value if set, zero value otherwise. +func (o *ArrayTest) GetArrayOfString() []string { + if o == nil || o.ArrayOfString == nil { + var ret []string + return ret + } + return *o.ArrayOfString +} + +// GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool) { + if o == nil || o.ArrayOfString == nil { + return nil, false + } + return o.ArrayOfString, true +} + +// HasArrayOfString returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayOfString() bool { + if o != nil && o.ArrayOfString != nil { + return true + } + + return false +} + +// SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. +func (o *ArrayTest) SetArrayOfString(v []string) { + o.ArrayOfString = &v +} + +// GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { + if o == nil || o.ArrayArrayOfInteger == nil { + var ret [][]int64 + return ret + } + return *o.ArrayArrayOfInteger +} + +// GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool) { + if o == nil || o.ArrayArrayOfInteger == nil { + return nil, false + } + return o.ArrayArrayOfInteger, true +} + +// HasArrayArrayOfInteger returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfInteger() bool { + if o != nil && o.ArrayArrayOfInteger != nil { + return true + } + + return false +} + +// SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. +func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { + o.ArrayArrayOfInteger = &v +} + +// GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { + if o == nil || o.ArrayArrayOfModel == nil { + var ret [][]ReadOnlyFirst + return ret + } + return *o.ArrayArrayOfModel +} + +// GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool) { + if o == nil || o.ArrayArrayOfModel == nil { + return nil, false + } + return o.ArrayArrayOfModel, true +} + +// HasArrayArrayOfModel returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfModel() bool { + if o != nil && o.ArrayArrayOfModel != nil { + return true + } + + return false +} + +// SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. +func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { + o.ArrayArrayOfModel = &v +} + +func (o ArrayTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayOfString != nil { + toSerialize["array_of_string"] = o.ArrayOfString + } + if o.ArrayArrayOfInteger != nil { + toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger + } + if o.ArrayArrayOfModel != nil { + toSerialize["array_array_of_model"] = o.ArrayArrayOfModel + } + return json.Marshal(toSerialize) +} + +type NullableArrayTest struct { + value *ArrayTest + isSet bool +} + +func (v NullableArrayTest) Get() *ArrayTest { + return v.value +} + +func (v *NullableArrayTest) Set(val *ArrayTest) { + v.value = val + v.isSet = true +} + +func (v NullableArrayTest) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayTest(val *ArrayTest) *NullableArrayTest { + return &NullableArrayTest{value: val, isSet: true} +} + +func (v NullableArrayTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_big_cat.go b/samples/client/petstore/go/go-petstore/model_big_cat.go index 70d790c6542..27b8085b241 100644 --- a/samples/client/petstore/go/go-petstore/model_big_cat.go +++ b/samples/client/petstore/go/go-petstore/model_big_cat.go @@ -8,10 +8,116 @@ */ package petstore + +import ( + "encoding/json" +) + // BigCat struct for BigCat type BigCat struct { - ClassName string `json:"className"` - Color string `json:"color,omitempty"` - Declawed bool `json:"declawed,omitempty"` - Kind string `json:"kind,omitempty"` + Cat + Kind *string `json:"kind,omitempty"` } + +// NewBigCat instantiates a new BigCat object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBigCat() *BigCat { + this := BigCat{} + return &this +} + +// NewBigCatWithDefaults instantiates a new BigCat object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBigCatWithDefaults() *BigCat { + this := BigCat{} + return &this +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *BigCat) GetKind() string { + if o == nil || o.Kind == nil { + var ret string + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BigCat) GetKindOk() (*string, bool) { + if o == nil || o.Kind == nil { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *BigCat) HasKind() bool { + if o != nil && o.Kind != nil { + return true + } + + return false +} + +// SetKind gets a reference to the given string and assigns it to the Kind field. +func (o *BigCat) SetKind(v string) { + o.Kind = &v +} + +func (o BigCat) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + serializedCat, errCat := json.Marshal(o.Cat) + if errCat != nil { + return []byte{}, errCat + } + errCat = json.Unmarshal([]byte(serializedCat), &toSerialize) + if errCat != nil { + return []byte{}, errCat + } + if o.Kind != nil { + toSerialize["kind"] = o.Kind + } + return json.Marshal(toSerialize) +} + +type NullableBigCat struct { + value *BigCat + isSet bool +} + +func (v NullableBigCat) Get() *BigCat { + return v.value +} + +func (v *NullableBigCat) Set(val *BigCat) { + v.value = val + v.isSet = true +} + +func (v NullableBigCat) IsSet() bool { + return v.isSet +} + +func (v *NullableBigCat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBigCat(val *BigCat) *NullableBigCat { + return &NullableBigCat{value: val, isSet: true} +} + +func (v NullableBigCat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBigCat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go index 93e796483ac..6434cd11d7c 100644 --- a/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_big_cat_all_of.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // BigCatAllOf struct for BigCatAllOf type BigCatAllOf struct { - Kind string `json:"kind,omitempty"` + Kind *string `json:"kind,omitempty"` } + +// NewBigCatAllOf instantiates a new BigCatAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBigCatAllOf() *BigCatAllOf { + this := BigCatAllOf{} + return &this +} + +// NewBigCatAllOfWithDefaults instantiates a new BigCatAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBigCatAllOfWithDefaults() *BigCatAllOf { + this := BigCatAllOf{} + return &this +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *BigCatAllOf) GetKind() string { + if o == nil || o.Kind == nil { + var ret string + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BigCatAllOf) GetKindOk() (*string, bool) { + if o == nil || o.Kind == nil { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *BigCatAllOf) HasKind() bool { + if o != nil && o.Kind != nil { + return true + } + + return false +} + +// SetKind gets a reference to the given string and assigns it to the Kind field. +func (o *BigCatAllOf) SetKind(v string) { + o.Kind = &v +} + +func (o BigCatAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Kind != nil { + toSerialize["kind"] = o.Kind + } + return json.Marshal(toSerialize) +} + +type NullableBigCatAllOf struct { + value *BigCatAllOf + isSet bool +} + +func (v NullableBigCatAllOf) Get() *BigCatAllOf { + return v.value +} + +func (v *NullableBigCatAllOf) Set(val *BigCatAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableBigCatAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableBigCatAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBigCatAllOf(val *BigCatAllOf) *NullableBigCatAllOf { + return &NullableBigCatAllOf{value: val, isSet: true} +} + +func (v NullableBigCatAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBigCatAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_capitalization.go b/samples/client/petstore/go/go-petstore/model_capitalization.go index 97d5a4733f2..7f2c90863e0 100644 --- a/samples/client/petstore/go/go-petstore/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore/model_capitalization.go @@ -8,13 +8,288 @@ */ package petstore + +import ( + "encoding/json" +) + // Capitalization struct for Capitalization type Capitalization struct { - SmallCamel string `json:"smallCamel,omitempty"` - CapitalCamel string `json:"CapitalCamel,omitempty"` - SmallSnake string `json:"small_Snake,omitempty"` - CapitalSnake string `json:"Capital_Snake,omitempty"` - SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"` + SmallCamel *string `json:"smallCamel,omitempty"` + CapitalCamel *string `json:"CapitalCamel,omitempty"` + SmallSnake *string `json:"small_Snake,omitempty"` + CapitalSnake *string `json:"Capital_Snake,omitempty"` + SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` // Name of the pet - ATT_NAME string `json:"ATT_NAME,omitempty"` + ATT_NAME *string `json:"ATT_NAME,omitempty"` } + +// NewCapitalization instantiates a new Capitalization object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapitalization() *Capitalization { + this := Capitalization{} + return &this +} + +// NewCapitalizationWithDefaults instantiates a new Capitalization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapitalizationWithDefaults() *Capitalization { + this := Capitalization{} + return &this +} + +// GetSmallCamel returns the SmallCamel field value if set, zero value otherwise. +func (o *Capitalization) GetSmallCamel() string { + if o == nil || o.SmallCamel == nil { + var ret string + return ret + } + return *o.SmallCamel +} + +// GetSmallCamelOk returns a tuple with the SmallCamel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallCamelOk() (*string, bool) { + if o == nil || o.SmallCamel == nil { + return nil, false + } + return o.SmallCamel, true +} + +// HasSmallCamel returns a boolean if a field has been set. +func (o *Capitalization) HasSmallCamel() bool { + if o != nil && o.SmallCamel != nil { + return true + } + + return false +} + +// SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. +func (o *Capitalization) SetSmallCamel(v string) { + o.SmallCamel = &v +} + +// GetCapitalCamel returns the CapitalCamel field value if set, zero value otherwise. +func (o *Capitalization) GetCapitalCamel() string { + if o == nil || o.CapitalCamel == nil { + var ret string + return ret + } + return *o.CapitalCamel +} + +// GetCapitalCamelOk returns a tuple with the CapitalCamel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalCamelOk() (*string, bool) { + if o == nil || o.CapitalCamel == nil { + return nil, false + } + return o.CapitalCamel, true +} + +// HasCapitalCamel returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalCamel() bool { + if o != nil && o.CapitalCamel != nil { + return true + } + + return false +} + +// SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. +func (o *Capitalization) SetCapitalCamel(v string) { + o.CapitalCamel = &v +} + +// GetSmallSnake returns the SmallSnake field value if set, zero value otherwise. +func (o *Capitalization) GetSmallSnake() string { + if o == nil || o.SmallSnake == nil { + var ret string + return ret + } + return *o.SmallSnake +} + +// GetSmallSnakeOk returns a tuple with the SmallSnake field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallSnakeOk() (*string, bool) { + if o == nil || o.SmallSnake == nil { + return nil, false + } + return o.SmallSnake, true +} + +// HasSmallSnake returns a boolean if a field has been set. +func (o *Capitalization) HasSmallSnake() bool { + if o != nil && o.SmallSnake != nil { + return true + } + + return false +} + +// SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. +func (o *Capitalization) SetSmallSnake(v string) { + o.SmallSnake = &v +} + +// GetCapitalSnake returns the CapitalSnake field value if set, zero value otherwise. +func (o *Capitalization) GetCapitalSnake() string { + if o == nil || o.CapitalSnake == nil { + var ret string + return ret + } + return *o.CapitalSnake +} + +// GetCapitalSnakeOk returns a tuple with the CapitalSnake field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalSnakeOk() (*string, bool) { + if o == nil || o.CapitalSnake == nil { + return nil, false + } + return o.CapitalSnake, true +} + +// HasCapitalSnake returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalSnake() bool { + if o != nil && o.CapitalSnake != nil { + return true + } + + return false +} + +// SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. +func (o *Capitalization) SetCapitalSnake(v string) { + o.CapitalSnake = &v +} + +// GetSCAETHFlowPoints returns the SCAETHFlowPoints field value if set, zero value otherwise. +func (o *Capitalization) GetSCAETHFlowPoints() string { + if o == nil || o.SCAETHFlowPoints == nil { + var ret string + return ret + } + return *o.SCAETHFlowPoints +} + +// GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool) { + if o == nil || o.SCAETHFlowPoints == nil { + return nil, false + } + return o.SCAETHFlowPoints, true +} + +// HasSCAETHFlowPoints returns a boolean if a field has been set. +func (o *Capitalization) HasSCAETHFlowPoints() bool { + if o != nil && o.SCAETHFlowPoints != nil { + return true + } + + return false +} + +// SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. +func (o *Capitalization) SetSCAETHFlowPoints(v string) { + o.SCAETHFlowPoints = &v +} + +// GetATT_NAME returns the ATT_NAME field value if set, zero value otherwise. +func (o *Capitalization) GetATT_NAME() string { + if o == nil || o.ATT_NAME == nil { + var ret string + return ret + } + return *o.ATT_NAME +} + +// GetATT_NAMEOk returns a tuple with the ATT_NAME field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetATT_NAMEOk() (*string, bool) { + if o == nil || o.ATT_NAME == nil { + return nil, false + } + return o.ATT_NAME, true +} + +// HasATT_NAME returns a boolean if a field has been set. +func (o *Capitalization) HasATT_NAME() bool { + if o != nil && o.ATT_NAME != nil { + return true + } + + return false +} + +// SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. +func (o *Capitalization) SetATT_NAME(v string) { + o.ATT_NAME = &v +} + +func (o Capitalization) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SmallCamel != nil { + toSerialize["smallCamel"] = o.SmallCamel + } + if o.CapitalCamel != nil { + toSerialize["CapitalCamel"] = o.CapitalCamel + } + if o.SmallSnake != nil { + toSerialize["small_Snake"] = o.SmallSnake + } + if o.CapitalSnake != nil { + toSerialize["Capital_Snake"] = o.CapitalSnake + } + if o.SCAETHFlowPoints != nil { + toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints + } + if o.ATT_NAME != nil { + toSerialize["ATT_NAME"] = o.ATT_NAME + } + return json.Marshal(toSerialize) +} + +type NullableCapitalization struct { + value *Capitalization + isSet bool +} + +func (v NullableCapitalization) Get() *Capitalization { + return v.value +} + +func (v *NullableCapitalization) Set(val *Capitalization) { + v.value = val + v.isSet = true +} + +func (v NullableCapitalization) IsSet() bool { + return v.isSet +} + +func (v *NullableCapitalization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapitalization(val *Capitalization) *NullableCapitalization { + return &NullableCapitalization{value: val, isSet: true} +} + +func (v NullableCapitalization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapitalization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_cat.go b/samples/client/petstore/go/go-petstore/model_cat.go index 54374bcfebb..d6573c99bac 100644 --- a/samples/client/petstore/go/go-petstore/model_cat.go +++ b/samples/client/petstore/go/go-petstore/model_cat.go @@ -8,9 +8,116 @@ */ package petstore + +import ( + "encoding/json" +) + // Cat struct for Cat type Cat struct { - ClassName string `json:"className"` - Color string `json:"color,omitempty"` - Declawed bool `json:"declawed,omitempty"` + Animal + Declawed *bool `json:"declawed,omitempty"` } + +// NewCat instantiates a new Cat object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCat() *Cat { + this := Cat{} + return &this +} + +// NewCatWithDefaults instantiates a new Cat object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCatWithDefaults() *Cat { + this := Cat{} + return &this +} + +// GetDeclawed returns the Declawed field value if set, zero value otherwise. +func (o *Cat) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetDeclawedOk() (*bool, bool) { + if o == nil || o.Declawed == nil { + return nil, false + } + return o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *Cat) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *Cat) SetDeclawed(v bool) { + o.Declawed = &v +} + +func (o Cat) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + serializedAnimal, errAnimal := json.Marshal(o.Animal) + if errAnimal != nil { + return []byte{}, errAnimal + } + errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) + if errAnimal != nil { + return []byte{}, errAnimal + } + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + return json.Marshal(toSerialize) +} + +type NullableCat struct { + value *Cat + isSet bool +} + +func (v NullableCat) Get() *Cat { + return v.value +} + +func (v *NullableCat) Set(val *Cat) { + v.value = val + v.isSet = true +} + +func (v NullableCat) IsSet() bool { + return v.isSet +} + +func (v *NullableCat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCat(val *Cat) *NullableCat { + return &NullableCat{value: val, isSet: true} +} + +func (v NullableCat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_cat_all_of.go b/samples/client/petstore/go/go-petstore/model_cat_all_of.go index b7550adb91a..643ba03973f 100644 --- a/samples/client/petstore/go/go-petstore/model_cat_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_cat_all_of.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // CatAllOf struct for CatAllOf type CatAllOf struct { - Declawed bool `json:"declawed,omitempty"` + Declawed *bool `json:"declawed,omitempty"` } + +// NewCatAllOf instantiates a new CatAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCatAllOf() *CatAllOf { + this := CatAllOf{} + return &this +} + +// NewCatAllOfWithDefaults instantiates a new CatAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCatAllOfWithDefaults() *CatAllOf { + this := CatAllOf{} + return &this +} + +// GetDeclawed returns the Declawed field value if set, zero value otherwise. +func (o *CatAllOf) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatAllOf) GetDeclawedOk() (*bool, bool) { + if o == nil || o.Declawed == nil { + return nil, false + } + return o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *CatAllOf) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *CatAllOf) SetDeclawed(v bool) { + o.Declawed = &v +} + +func (o CatAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + return json.Marshal(toSerialize) +} + +type NullableCatAllOf struct { + value *CatAllOf + isSet bool +} + +func (v NullableCatAllOf) Get() *CatAllOf { + return v.value +} + +func (v *NullableCatAllOf) Set(val *CatAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableCatAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableCatAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatAllOf(val *CatAllOf) *NullableCatAllOf { + return &NullableCatAllOf{value: val, isSet: true} +} + +func (v NullableCatAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_category.go b/samples/client/petstore/go/go-petstore/model_category.go index 104410a316a..0c462889533 100644 --- a/samples/client/petstore/go/go-petstore/model_category.go +++ b/samples/client/petstore/go/go-petstore/model_category.go @@ -8,8 +8,138 @@ */ package petstore + +import ( + "encoding/json" +) + // Category struct for Category type Category struct { - Id int64 `json:"id,omitempty"` + Id *int64 `json:"id,omitempty"` Name string `json:"name"` } + +// NewCategory instantiates a new Category object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCategory(name string, ) *Category { + this := Category{} + this.Name = name + return &this +} + +// NewCategoryWithDefaults instantiates a new Category object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCategoryWithDefaults() *Category { + this := Category{} + var name string = "default-name" + this.Name = name + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Category) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Category) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Category) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Category) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *Category) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Category) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Category) SetName(v string) { + o.Name = v +} + +func (o Category) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableCategory struct { + value *Category + isSet bool +} + +func (v NullableCategory) Get() *Category { + return v.value +} + +func (v *NullableCategory) Set(val *Category) { + v.value = val + v.isSet = true +} + +func (v NullableCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCategory(val *Category) *NullableCategory { + return &NullableCategory{value: val, isSet: true} +} + +func (v NullableCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_class_model.go b/samples/client/petstore/go/go-petstore/model_class_model.go index c87910e3dc6..7236de0ee07 100644 --- a/samples/client/petstore/go/go-petstore/model_class_model.go +++ b/samples/client/petstore/go/go-petstore/model_class_model.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // ClassModel Model for testing model with \"_class\" property type ClassModel struct { - Class string `json:"_class,omitempty"` + Class *string `json:"_class,omitempty"` } + +// NewClassModel instantiates a new ClassModel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClassModel() *ClassModel { + this := ClassModel{} + return &this +} + +// NewClassModelWithDefaults instantiates a new ClassModel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClassModelWithDefaults() *ClassModel { + this := ClassModel{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *ClassModel) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClassModel) GetClassOk() (*string, bool) { + if o == nil || o.Class == nil { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *ClassModel) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *ClassModel) SetClass(v string) { + o.Class = &v +} + +func (o ClassModel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Class != nil { + toSerialize["_class"] = o.Class + } + return json.Marshal(toSerialize) +} + +type NullableClassModel struct { + value *ClassModel + isSet bool +} + +func (v NullableClassModel) Get() *ClassModel { + return v.value +} + +func (v *NullableClassModel) Set(val *ClassModel) { + v.value = val + v.isSet = true +} + +func (v NullableClassModel) IsSet() bool { + return v.isSet +} + +func (v *NullableClassModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClassModel(val *ClassModel) *NullableClassModel { + return &NullableClassModel{value: val, isSet: true} +} + +func (v NullableClassModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClassModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_client.go b/samples/client/petstore/go/go-petstore/model_client.go index f7c449d2bc6..edfdde067ef 100644 --- a/samples/client/petstore/go/go-petstore/model_client.go +++ b/samples/client/petstore/go/go-petstore/model_client.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // Client struct for Client type Client struct { - Client string `json:"client,omitempty"` + Client *string `json:"client,omitempty"` } + +// NewClient instantiates a new Client object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClient() *Client { + this := Client{} + return &this +} + +// NewClientWithDefaults instantiates a new Client object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientWithDefaults() *Client { + this := Client{} + return &this +} + +// GetClient returns the Client field value if set, zero value otherwise. +func (o *Client) GetClient() string { + if o == nil || o.Client == nil { + var ret string + return ret + } + return *o.Client +} + +// GetClientOk returns a tuple with the Client field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Client) GetClientOk() (*string, bool) { + if o == nil || o.Client == nil { + return nil, false + } + return o.Client, true +} + +// HasClient returns a boolean if a field has been set. +func (o *Client) HasClient() bool { + if o != nil && o.Client != nil { + return true + } + + return false +} + +// SetClient gets a reference to the given string and assigns it to the Client field. +func (o *Client) SetClient(v string) { + o.Client = &v +} + +func (o Client) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Client != nil { + toSerialize["client"] = o.Client + } + return json.Marshal(toSerialize) +} + +type NullableClient struct { + value *Client + isSet bool +} + +func (v NullableClient) Get() *Client { + return v.value +} + +func (v *NullableClient) Set(val *Client) { + v.value = val + v.isSet = true +} + +func (v NullableClient) IsSet() bool { + return v.isSet +} + +func (v *NullableClient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClient(val *Client) *NullableClient { + return &NullableClient{value: val, isSet: true} +} + +func (v NullableClient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_dog.go b/samples/client/petstore/go/go-petstore/model_dog.go index 6bc685afe29..ebbedeec53e 100644 --- a/samples/client/petstore/go/go-petstore/model_dog.go +++ b/samples/client/petstore/go/go-petstore/model_dog.go @@ -8,9 +8,116 @@ */ package petstore + +import ( + "encoding/json" +) + // Dog struct for Dog type Dog struct { - ClassName string `json:"className"` - Color string `json:"color,omitempty"` - Breed string `json:"breed,omitempty"` + Animal + Breed *string `json:"breed,omitempty"` } + +// NewDog instantiates a new Dog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDog() *Dog { + this := Dog{} + return &this +} + +// NewDogWithDefaults instantiates a new Dog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDogWithDefaults() *Dog { + this := Dog{} + return &this +} + +// GetBreed returns the Breed field value if set, zero value otherwise. +func (o *Dog) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetBreedOk() (*string, bool) { + if o == nil || o.Breed == nil { + return nil, false + } + return o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *Dog) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *Dog) SetBreed(v string) { + o.Breed = &v +} + +func (o Dog) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + serializedAnimal, errAnimal := json.Marshal(o.Animal) + if errAnimal != nil { + return []byte{}, errAnimal + } + errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) + if errAnimal != nil { + return []byte{}, errAnimal + } + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + return json.Marshal(toSerialize) +} + +type NullableDog struct { + value *Dog + isSet bool +} + +func (v NullableDog) Get() *Dog { + return v.value +} + +func (v *NullableDog) Set(val *Dog) { + v.value = val + v.isSet = true +} + +func (v NullableDog) IsSet() bool { + return v.isSet +} + +func (v *NullableDog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDog(val *Dog) *NullableDog { + return &NullableDog{value: val, isSet: true} +} + +func (v NullableDog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_dog_all_of.go b/samples/client/petstore/go/go-petstore/model_dog_all_of.go index 758c5cc45f7..c13aa2b2cd5 100644 --- a/samples/client/petstore/go/go-petstore/model_dog_all_of.go +++ b/samples/client/petstore/go/go-petstore/model_dog_all_of.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // DogAllOf struct for DogAllOf type DogAllOf struct { - Breed string `json:"breed,omitempty"` + Breed *string `json:"breed,omitempty"` } + +// NewDogAllOf instantiates a new DogAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDogAllOf() *DogAllOf { + this := DogAllOf{} + return &this +} + +// NewDogAllOfWithDefaults instantiates a new DogAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDogAllOfWithDefaults() *DogAllOf { + this := DogAllOf{} + return &this +} + +// GetBreed returns the Breed field value if set, zero value otherwise. +func (o *DogAllOf) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DogAllOf) GetBreedOk() (*string, bool) { + if o == nil || o.Breed == nil { + return nil, false + } + return o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *DogAllOf) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *DogAllOf) SetBreed(v string) { + o.Breed = &v +} + +func (o DogAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + return json.Marshal(toSerialize) +} + +type NullableDogAllOf struct { + value *DogAllOf + isSet bool +} + +func (v NullableDogAllOf) Get() *DogAllOf { + return v.value +} + +func (v *NullableDogAllOf) Set(val *DogAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableDogAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableDogAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDogAllOf(val *DogAllOf) *NullableDogAllOf { + return &NullableDogAllOf{value: val, isSet: true} +} + +func (v NullableDogAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDogAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/client/petstore/go/go-petstore/model_enum_arrays.go index 64df54568b4..b18984ce730 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore/model_enum_arrays.go @@ -8,8 +8,143 @@ */ package petstore + +import ( + "encoding/json" +) + // EnumArrays struct for EnumArrays type EnumArrays struct { - JustSymbol string `json:"just_symbol,omitempty"` - ArrayEnum []string `json:"array_enum,omitempty"` + JustSymbol *string `json:"just_symbol,omitempty"` + ArrayEnum *[]string `json:"array_enum,omitempty"` } + +// NewEnumArrays instantiates a new EnumArrays object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnumArrays() *EnumArrays { + this := EnumArrays{} + return &this +} + +// NewEnumArraysWithDefaults instantiates a new EnumArrays object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnumArraysWithDefaults() *EnumArrays { + this := EnumArrays{} + return &this +} + +// GetJustSymbol returns the JustSymbol field value if set, zero value otherwise. +func (o *EnumArrays) GetJustSymbol() string { + if o == nil || o.JustSymbol == nil { + var ret string + return ret + } + return *o.JustSymbol +} + +// GetJustSymbolOk returns a tuple with the JustSymbol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetJustSymbolOk() (*string, bool) { + if o == nil || o.JustSymbol == nil { + return nil, false + } + return o.JustSymbol, true +} + +// HasJustSymbol returns a boolean if a field has been set. +func (o *EnumArrays) HasJustSymbol() bool { + if o != nil && o.JustSymbol != nil { + return true + } + + return false +} + +// SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. +func (o *EnumArrays) SetJustSymbol(v string) { + o.JustSymbol = &v +} + +// GetArrayEnum returns the ArrayEnum field value if set, zero value otherwise. +func (o *EnumArrays) GetArrayEnum() []string { + if o == nil || o.ArrayEnum == nil { + var ret []string + return ret + } + return *o.ArrayEnum +} + +// GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool) { + if o == nil || o.ArrayEnum == nil { + return nil, false + } + return o.ArrayEnum, true +} + +// HasArrayEnum returns a boolean if a field has been set. +func (o *EnumArrays) HasArrayEnum() bool { + if o != nil && o.ArrayEnum != nil { + return true + } + + return false +} + +// SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. +func (o *EnumArrays) SetArrayEnum(v []string) { + o.ArrayEnum = &v +} + +func (o EnumArrays) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustSymbol != nil { + toSerialize["just_symbol"] = o.JustSymbol + } + if o.ArrayEnum != nil { + toSerialize["array_enum"] = o.ArrayEnum + } + return json.Marshal(toSerialize) +} + +type NullableEnumArrays struct { + value *EnumArrays + isSet bool +} + +func (v NullableEnumArrays) Get() *EnumArrays { + return v.value +} + +func (v *NullableEnumArrays) Set(val *EnumArrays) { + v.value = val + v.isSet = true +} + +func (v NullableEnumArrays) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumArrays) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumArrays(val *EnumArrays) *NullableEnumArrays { + return &NullableEnumArrays{value: val, isSet: true} +} + +func (v NullableEnumArrays) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumArrays) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_enum_class.go b/samples/client/petstore/go/go-petstore/model_enum_class.go index 8b7e1ee8959..d64ca138f85 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore/model_enum_class.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // EnumClass the model 'EnumClass' type EnumClass string @@ -17,3 +23,62 @@ const ( EFG EnumClass = "-efg" XYZ EnumClass = "(xyz)" ) + +func (v *EnumClass) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumClass(value) + for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumClass", value) +} + +// Ptr returns reference to EnumClass value +func (v EnumClass) Ptr() *EnumClass { + return &v +} + +type NullableEnumClass struct { + value *EnumClass + isSet bool +} + +func (v NullableEnumClass) Get() *EnumClass { + return v.value +} + +func (v *NullableEnumClass) Set(val *EnumClass) { + v.value = val + v.isSet = true +} + +func (v NullableEnumClass) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumClass(val *EnumClass) *NullableEnumClass { + return &NullableEnumClass{value: val, isSet: true} +} + +func (v NullableEnumClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/client/petstore/go/go-petstore/model_enum_test_.go b/samples/client/petstore/go/go-petstore/model_enum_test_.go index f8eb2967b9e..c39d045e5a6 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore/model_enum_test_.go @@ -8,11 +8,244 @@ */ package petstore + +import ( + "encoding/json" +) + // EnumTest struct for EnumTest type EnumTest struct { - EnumString string `json:"enum_string,omitempty"` + EnumString *string `json:"enum_string,omitempty"` EnumStringRequired string `json:"enum_string_required"` - EnumInteger int32 `json:"enum_integer,omitempty"` - EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + EnumInteger *int32 `json:"enum_integer,omitempty"` + EnumNumber *float64 `json:"enum_number,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` } + +// NewEnumTest instantiates a new EnumTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnumTest(enumStringRequired string, ) *EnumTest { + this := EnumTest{} + this.EnumStringRequired = enumStringRequired + return &this +} + +// NewEnumTestWithDefaults instantiates a new EnumTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnumTestWithDefaults() *EnumTest { + this := EnumTest{} + return &this +} + +// GetEnumString returns the EnumString field value if set, zero value otherwise. +func (o *EnumTest) GetEnumString() string { + if o == nil || o.EnumString == nil { + var ret string + return ret + } + return *o.EnumString +} + +// GetEnumStringOk returns a tuple with the EnumString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringOk() (*string, bool) { + if o == nil || o.EnumString == nil { + return nil, false + } + return o.EnumString, true +} + +// HasEnumString returns a boolean if a field has been set. +func (o *EnumTest) HasEnumString() bool { + if o != nil && o.EnumString != nil { + return true + } + + return false +} + +// SetEnumString gets a reference to the given string and assigns it to the EnumString field. +func (o *EnumTest) SetEnumString(v string) { + o.EnumString = &v +} + +// GetEnumStringRequired returns the EnumStringRequired field value +func (o *EnumTest) GetEnumStringRequired() string { + if o == nil { + var ret string + return ret + } + + return o.EnumStringRequired +} + +// GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field value +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EnumStringRequired, true +} + +// SetEnumStringRequired sets field value +func (o *EnumTest) SetEnumStringRequired(v string) { + o.EnumStringRequired = v +} + +// GetEnumInteger returns the EnumInteger field value if set, zero value otherwise. +func (o *EnumTest) GetEnumInteger() int32 { + if o == nil || o.EnumInteger == nil { + var ret int32 + return ret + } + return *o.EnumInteger +} + +// GetEnumIntegerOk returns a tuple with the EnumInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumIntegerOk() (*int32, bool) { + if o == nil || o.EnumInteger == nil { + return nil, false + } + return o.EnumInteger, true +} + +// HasEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasEnumInteger() bool { + if o != nil && o.EnumInteger != nil { + return true + } + + return false +} + +// SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. +func (o *EnumTest) SetEnumInteger(v int32) { + o.EnumInteger = &v +} + +// GetEnumNumber returns the EnumNumber field value if set, zero value otherwise. +func (o *EnumTest) GetEnumNumber() float64 { + if o == nil || o.EnumNumber == nil { + var ret float64 + return ret + } + return *o.EnumNumber +} + +// GetEnumNumberOk returns a tuple with the EnumNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumNumberOk() (*float64, bool) { + if o == nil || o.EnumNumber == nil { + return nil, false + } + return o.EnumNumber, true +} + +// HasEnumNumber returns a boolean if a field has been set. +func (o *EnumTest) HasEnumNumber() bool { + if o != nil && o.EnumNumber != nil { + return true + } + + return false +} + +// SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. +func (o *EnumTest) SetEnumNumber(v float64) { + o.EnumNumber = &v +} + +// GetOuterEnum returns the OuterEnum field value if set, zero value otherwise. +func (o *EnumTest) GetOuterEnum() OuterEnum { + if o == nil || o.OuterEnum == nil { + var ret OuterEnum + return ret + } + return *o.OuterEnum +} + +// GetOuterEnumOk returns a tuple with the OuterEnum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { + if o == nil || o.OuterEnum == nil { + return nil, false + } + return o.OuterEnum, true +} + +// HasOuterEnum returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnum() bool { + if o != nil && o.OuterEnum != nil { + return true + } + + return false +} + +// SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field. +func (o *EnumTest) SetOuterEnum(v OuterEnum) { + o.OuterEnum = &v +} + +func (o EnumTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumString != nil { + toSerialize["enum_string"] = o.EnumString + } + if true { + toSerialize["enum_string_required"] = o.EnumStringRequired + } + if o.EnumInteger != nil { + toSerialize["enum_integer"] = o.EnumInteger + } + if o.EnumNumber != nil { + toSerialize["enum_number"] = o.EnumNumber + } + if o.OuterEnum != nil { + toSerialize["outerEnum"] = o.OuterEnum + } + return json.Marshal(toSerialize) +} + +type NullableEnumTest struct { + value *EnumTest + isSet bool +} + +func (v NullableEnumTest) Get() *EnumTest { + return v.value +} + +func (v *NullableEnumTest) Set(val *EnumTest) { + v.value = val + v.isSet = true +} + +func (v NullableEnumTest) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumTest(val *EnumTest) *NullableEnumTest { + return &NullableEnumTest{value: val, isSet: true} +} + +func (v NullableEnumTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_file.go b/samples/client/petstore/go/go-petstore/model_file.go index b07c65dcc42..43ec19f8638 100644 --- a/samples/client/petstore/go/go-petstore/model_file.go +++ b/samples/client/petstore/go/go-petstore/model_file.go @@ -8,8 +8,108 @@ */ package petstore + +import ( + "encoding/json" +) + // File Must be named `File` for test. type File struct { // Test capitalization - SourceURI string `json:"sourceURI,omitempty"` + SourceURI *string `json:"sourceURI,omitempty"` } + +// NewFile instantiates a new File object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFile() *File { + this := File{} + return &this +} + +// NewFileWithDefaults instantiates a new File object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileWithDefaults() *File { + this := File{} + return &this +} + +// GetSourceURI returns the SourceURI field value if set, zero value otherwise. +func (o *File) GetSourceURI() string { + if o == nil || o.SourceURI == nil { + var ret string + return ret + } + return *o.SourceURI +} + +// GetSourceURIOk returns a tuple with the SourceURI field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *File) GetSourceURIOk() (*string, bool) { + if o == nil || o.SourceURI == nil { + return nil, false + } + return o.SourceURI, true +} + +// HasSourceURI returns a boolean if a field has been set. +func (o *File) HasSourceURI() bool { + if o != nil && o.SourceURI != nil { + return true + } + + return false +} + +// SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. +func (o *File) SetSourceURI(v string) { + o.SourceURI = &v +} + +func (o File) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SourceURI != nil { + toSerialize["sourceURI"] = o.SourceURI + } + return json.Marshal(toSerialize) +} + +type NullableFile struct { + value *File + isSet bool +} + +func (v NullableFile) Get() *File { + return v.value +} + +func (v *NullableFile) Set(val *File) { + v.value = val + v.isSet = true +} + +func (v NullableFile) IsSet() bool { + return v.isSet +} + +func (v *NullableFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFile(val *File) *NullableFile { + return &NullableFile{value: val, isSet: true} +} + +func (v NullableFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go index 29b051e77a8..626a3765173 100644 --- a/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -8,8 +8,143 @@ */ package petstore + +import ( + "encoding/json" +) + // FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { - File File `json:"file,omitempty"` - Files []File `json:"files,omitempty"` + File *File `json:"file,omitempty"` + Files *[]File `json:"files,omitempty"` } + +// NewFileSchemaTestClass instantiates a new FileSchemaTestClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFileSchemaTestClass() *FileSchemaTestClass { + this := FileSchemaTestClass{} + return &this +} + +// NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass { + this := FileSchemaTestClass{} + return &this +} + +// GetFile returns the File field value if set, zero value otherwise. +func (o *FileSchemaTestClass) GetFile() File { + if o == nil || o.File == nil { + var ret File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFileOk() (*File, bool) { + if o == nil || o.File == nil { + return nil, false + } + return o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given File and assigns it to the File field. +func (o *FileSchemaTestClass) SetFile(v File) { + o.File = &v +} + +// GetFiles returns the Files field value if set, zero value otherwise. +func (o *FileSchemaTestClass) GetFiles() []File { + if o == nil || o.Files == nil { + var ret []File + return ret + } + return *o.Files +} + +// GetFilesOk returns a tuple with the Files field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool) { + if o == nil || o.Files == nil { + return nil, false + } + return o.Files, true +} + +// HasFiles returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFiles() bool { + if o != nil && o.Files != nil { + return true + } + + return false +} + +// SetFiles gets a reference to the given []File and assigns it to the Files field. +func (o *FileSchemaTestClass) SetFiles(v []File) { + o.Files = &v +} + +func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.File != nil { + toSerialize["file"] = o.File + } + if o.Files != nil { + toSerialize["files"] = o.Files + } + return json.Marshal(toSerialize) +} + +type NullableFileSchemaTestClass struct { + value *FileSchemaTestClass + isSet bool +} + +func (v NullableFileSchemaTestClass) Get() *FileSchemaTestClass { + return v.value +} + +func (v *NullableFileSchemaTestClass) Set(val *FileSchemaTestClass) { + v.value = val + v.isSet = true +} + +func (v NullableFileSchemaTestClass) IsSet() bool { + return v.isSet +} + +func (v *NullableFileSchemaTestClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFileSchemaTestClass(val *FileSchemaTestClass) *NullableFileSchemaTestClass { + return &NullableFileSchemaTestClass{value: val, isSet: true} +} + +func (v NullableFileSchemaTestClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFileSchemaTestClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_format_test_.go b/samples/client/petstore/go/go-petstore/model_format_test_.go index 1c714c2ccae..aa1889aedda 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore/model_format_test_.go @@ -8,24 +8,549 @@ */ package petstore + import ( + "encoding/json" "os" "time" ) + // FormatTest struct for FormatTest type FormatTest struct { - Integer int32 `json:"integer,omitempty"` - Int32 int32 `json:"int32,omitempty"` - Int64 int64 `json:"int64,omitempty"` + Integer *int32 `json:"integer,omitempty"` + Int32 *int32 `json:"int32,omitempty"` + Int64 *int64 `json:"int64,omitempty"` Number float32 `json:"number"` - Float float32 `json:"float,omitempty"` - Double float64 `json:"double,omitempty"` - String string `json:"string,omitempty"` + Float *float32 `json:"float,omitempty"` + Double *float64 `json:"double,omitempty"` + String *string `json:"string,omitempty"` Byte string `json:"byte"` - Binary *os.File `json:"binary,omitempty"` + Binary **os.File `json:"binary,omitempty"` Date string `json:"date"` - DateTime time.Time `json:"dateTime,omitempty"` - Uuid string `json:"uuid,omitempty"` + DateTime *time.Time `json:"dateTime,omitempty"` + Uuid *string `json:"uuid,omitempty"` Password string `json:"password"` - BigDecimal float64 `json:"BigDecimal,omitempty"` + BigDecimal *float64 `json:"BigDecimal,omitempty"` } + +// NewFormatTest instantiates a new FormatTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest { + this := FormatTest{} + this.Number = number + this.Byte = byte_ + this.Date = date + this.Password = password + return &this +} + +// NewFormatTestWithDefaults instantiates a new FormatTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFormatTestWithDefaults() *FormatTest { + this := FormatTest{} + return &this +} + +// GetInteger returns the Integer field value if set, zero value otherwise. +func (o *FormatTest) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetIntegerOk() (*int32, bool) { + if o == nil || o.Integer == nil { + return nil, false + } + return o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *FormatTest) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *FormatTest) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field value if set, zero value otherwise. +func (o *FormatTest) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt32Ok() (*int32, bool) { + if o == nil || o.Int32 == nil { + return nil, false + } + return o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *FormatTest) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *FormatTest) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field value if set, zero value otherwise. +func (o *FormatTest) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt64Ok() (*int64, bool) { + if o == nil || o.Int64 == nil { + return nil, false + } + return o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *FormatTest) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *FormatTest) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field value +func (o *FormatTest) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *FormatTest) SetNumber(v float32) { + o.Number = v +} + +// GetFloat returns the Float field value if set, zero value otherwise. +func (o *FormatTest) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetFloatOk() (*float32, bool) { + if o == nil || o.Float == nil { + return nil, false + } + return o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *FormatTest) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *FormatTest) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field value if set, zero value otherwise. +func (o *FormatTest) GetDouble() float64 { + if o == nil || o.Double == nil { + var ret float64 + return ret + } + return *o.Double +} + +// GetDoubleOk returns a tuple with the Double field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDoubleOk() (*float64, bool) { + if o == nil || o.Double == nil { + return nil, false + } + return o.Double, true +} + +// HasDouble returns a boolean if a field has been set. +func (o *FormatTest) HasDouble() bool { + if o != nil && o.Double != nil { + return true + } + + return false +} + +// SetDouble gets a reference to the given float64 and assigns it to the Double field. +func (o *FormatTest) SetDouble(v float64) { + o.Double = &v +} + +// GetString returns the String field value if set, zero value otherwise. +func (o *FormatTest) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetStringOk() (*string, bool) { + if o == nil || o.String == nil { + return nil, false + } + return o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *FormatTest) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *FormatTest) SetString(v string) { + o.String = &v +} + +// GetByte returns the Byte field value +func (o *FormatTest) GetByte() string { + if o == nil { + var ret string + return ret + } + + return o.Byte +} + +// GetByteOk returns a tuple with the Byte field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetByteOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Byte, true +} + +// SetByte sets field value +func (o *FormatTest) SetByte(v string) { + o.Byte = v +} + +// GetBinary returns the Binary field value if set, zero value otherwise. +func (o *FormatTest) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetBinaryOk() (**os.File, bool) { + if o == nil || o.Binary == nil { + return nil, false + } + return o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *FormatTest) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *FormatTest) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field value +func (o *FormatTest) GetDate() string { + if o == nil { + var ret string + return ret + } + + return o.Date +} + +// GetDateOk returns a tuple with the Date field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Date, true +} + +// SetDate sets field value +func (o *FormatTest) SetDate(v string) { + o.Date = v +} + +// GetDateTime returns the DateTime field value if set, zero value otherwise. +func (o *FormatTest) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateTimeOk() (*time.Time, bool) { + if o == nil || o.DateTime == nil { + return nil, false + } + return o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *FormatTest) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *FormatTest) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *FormatTest) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetUuidOk() (*string, bool) { + if o == nil || o.Uuid == nil { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *FormatTest) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *FormatTest) SetUuid(v string) { + o.Uuid = &v +} + +// GetPassword returns the Password field value +func (o *FormatTest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *FormatTest) SetPassword(v string) { + o.Password = v +} + +// GetBigDecimal returns the BigDecimal field value if set, zero value otherwise. +func (o *FormatTest) GetBigDecimal() float64 { + if o == nil || o.BigDecimal == nil { + var ret float64 + return ret + } + return *o.BigDecimal +} + +// GetBigDecimalOk returns a tuple with the BigDecimal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetBigDecimalOk() (*float64, bool) { + if o == nil || o.BigDecimal == nil { + return nil, false + } + return o.BigDecimal, true +} + +// HasBigDecimal returns a boolean if a field has been set. +func (o *FormatTest) HasBigDecimal() bool { + if o != nil && o.BigDecimal != nil { + return true + } + + return false +} + +// SetBigDecimal gets a reference to the given float64 and assigns it to the BigDecimal field. +func (o *FormatTest) SetBigDecimal(v float64) { + o.BigDecimal = &v +} + +func (o FormatTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if true { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if o.Double != nil { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if true { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if true { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if true { + toSerialize["password"] = o.Password + } + if o.BigDecimal != nil { + toSerialize["BigDecimal"] = o.BigDecimal + } + return json.Marshal(toSerialize) +} + +type NullableFormatTest struct { + value *FormatTest + isSet bool +} + +func (v NullableFormatTest) Get() *FormatTest { + return v.value +} + +func (v *NullableFormatTest) Set(val *FormatTest) { + v.value = val + v.isSet = true +} + +func (v NullableFormatTest) IsSet() bool { + return v.isSet +} + +func (v *NullableFormatTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFormatTest(val *FormatTest) *NullableFormatTest { + return &NullableFormatTest{value: val, isSet: true} +} + +func (v NullableFormatTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFormatTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go index c0b9818dcdd..3400c73dca6 100644 --- a/samples/client/petstore/go/go-petstore/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore/model_has_only_read_only.go @@ -8,8 +8,143 @@ */ package petstore + +import ( + "encoding/json" +) + // HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { - Bar string `json:"bar,omitempty"` - Foo string `json:"foo,omitempty"` + Bar *string `json:"bar,omitempty"` + Foo *string `json:"foo,omitempty"` } + +// NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasOnlyReadOnly() *HasOnlyReadOnly { + this := HasOnlyReadOnly{} + return &this +} + +// NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly { + this := HasOnlyReadOnly{} + return &this +} + +// GetBar returns the Bar field value if set, zero value otherwise. +func (o *HasOnlyReadOnly) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetBarOk() (*string, bool) { + if o == nil || o.Bar == nil { + return nil, false + } + return o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *HasOnlyReadOnly) SetBar(v string) { + o.Bar = &v +} + +// GetFoo returns the Foo field value if set, zero value otherwise. +func (o *HasOnlyReadOnly) GetFoo() string { + if o == nil || o.Foo == nil { + var ret string + return ret + } + return *o.Foo +} + +// GetFooOk returns a tuple with the Foo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetFooOk() (*string, bool) { + if o == nil || o.Foo == nil { + return nil, false + } + return o.Foo, true +} + +// HasFoo returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasFoo() bool { + if o != nil && o.Foo != nil { + return true + } + + return false +} + +// SetFoo gets a reference to the given string and assigns it to the Foo field. +func (o *HasOnlyReadOnly) SetFoo(v string) { + o.Foo = &v +} + +func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Foo != nil { + toSerialize["foo"] = o.Foo + } + return json.Marshal(toSerialize) +} + +type NullableHasOnlyReadOnly struct { + value *HasOnlyReadOnly + isSet bool +} + +func (v NullableHasOnlyReadOnly) Get() *HasOnlyReadOnly { + return v.value +} + +func (v *NullableHasOnlyReadOnly) Set(val *HasOnlyReadOnly) { + v.value = val + v.isSet = true +} + +func (v NullableHasOnlyReadOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableHasOnlyReadOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasOnlyReadOnly(val *HasOnlyReadOnly) *NullableHasOnlyReadOnly { + return &NullableHasOnlyReadOnly{value: val, isSet: true} +} + +func (v NullableHasOnlyReadOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasOnlyReadOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_list.go b/samples/client/petstore/go/go-petstore/model_list.go index 891ded476a4..f49afaa71f3 100644 --- a/samples/client/petstore/go/go-petstore/model_list.go +++ b/samples/client/petstore/go/go-petstore/model_list.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // List struct for List type List struct { - Var123List string `json:"123-list,omitempty"` + Var123List *string `json:"123-list,omitempty"` } + +// NewList instantiates a new List object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewList() *List { + this := List{} + return &this +} + +// NewListWithDefaults instantiates a new List object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListWithDefaults() *List { + this := List{} + return &this +} + +// GetVar123List returns the Var123List field value if set, zero value otherwise. +func (o *List) GetVar123List() string { + if o == nil || o.Var123List == nil { + var ret string + return ret + } + return *o.Var123List +} + +// GetVar123ListOk returns a tuple with the Var123List field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *List) GetVar123ListOk() (*string, bool) { + if o == nil || o.Var123List == nil { + return nil, false + } + return o.Var123List, true +} + +// HasVar123List returns a boolean if a field has been set. +func (o *List) HasVar123List() bool { + if o != nil && o.Var123List != nil { + return true + } + + return false +} + +// SetVar123List gets a reference to the given string and assigns it to the Var123List field. +func (o *List) SetVar123List(v string) { + o.Var123List = &v +} + +func (o List) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Var123List != nil { + toSerialize["123-list"] = o.Var123List + } + return json.Marshal(toSerialize) +} + +type NullableList struct { + value *List + isSet bool +} + +func (v NullableList) Get() *List { + return v.value +} + +func (v *NullableList) Set(val *List) { + v.value = val + v.isSet = true +} + +func (v NullableList) IsSet() bool { + return v.isSet +} + +func (v *NullableList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableList(val *List) *NullableList { + return &NullableList{value: val, isSet: true} +} + +func (v NullableList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_map_test_.go b/samples/client/petstore/go/go-petstore/model_map_test_.go index 5c03afe831c..4fc2c0b4799 100644 --- a/samples/client/petstore/go/go-petstore/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore/model_map_test_.go @@ -8,10 +8,215 @@ */ package petstore + +import ( + "encoding/json" +) + // MapTest struct for MapTest type MapTest struct { - MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` - MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` - DirectMap map[string]bool `json:"direct_map,omitempty"` - IndirectMap map[string]bool `json:"indirect_map,omitempty"` + MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` + MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` + DirectMap *map[string]bool `json:"direct_map,omitempty"` + IndirectMap *map[string]bool `json:"indirect_map,omitempty"` } + +// NewMapTest instantiates a new MapTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMapTest() *MapTest { + this := MapTest{} + return &this +} + +// NewMapTestWithDefaults instantiates a new MapTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMapTestWithDefaults() *MapTest { + this := MapTest{} + return &this +} + +// GetMapMapOfString returns the MapMapOfString field value if set, zero value otherwise. +func (o *MapTest) GetMapMapOfString() map[string]map[string]string { + if o == nil || o.MapMapOfString == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapMapOfString +} + +// GetMapMapOfStringOk returns a tuple with the MapMapOfString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool) { + if o == nil || o.MapMapOfString == nil { + return nil, false + } + return o.MapMapOfString, true +} + +// HasMapMapOfString returns a boolean if a field has been set. +func (o *MapTest) HasMapMapOfString() bool { + if o != nil && o.MapMapOfString != nil { + return true + } + + return false +} + +// SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. +func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { + o.MapMapOfString = &v +} + +// GetMapOfEnumString returns the MapOfEnumString field value if set, zero value otherwise. +func (o *MapTest) GetMapOfEnumString() map[string]string { + if o == nil || o.MapOfEnumString == nil { + var ret map[string]string + return ret + } + return *o.MapOfEnumString +} + +// GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool) { + if o == nil || o.MapOfEnumString == nil { + return nil, false + } + return o.MapOfEnumString, true +} + +// HasMapOfEnumString returns a boolean if a field has been set. +func (o *MapTest) HasMapOfEnumString() bool { + if o != nil && o.MapOfEnumString != nil { + return true + } + + return false +} + +// SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. +func (o *MapTest) SetMapOfEnumString(v map[string]string) { + o.MapOfEnumString = &v +} + +// GetDirectMap returns the DirectMap field value if set, zero value otherwise. +func (o *MapTest) GetDirectMap() map[string]bool { + if o == nil || o.DirectMap == nil { + var ret map[string]bool + return ret + } + return *o.DirectMap +} + +// GetDirectMapOk returns a tuple with the DirectMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool) { + if o == nil || o.DirectMap == nil { + return nil, false + } + return o.DirectMap, true +} + +// HasDirectMap returns a boolean if a field has been set. +func (o *MapTest) HasDirectMap() bool { + if o != nil && o.DirectMap != nil { + return true + } + + return false +} + +// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. +func (o *MapTest) SetDirectMap(v map[string]bool) { + o.DirectMap = &v +} + +// GetIndirectMap returns the IndirectMap field value if set, zero value otherwise. +func (o *MapTest) GetIndirectMap() map[string]bool { + if o == nil || o.IndirectMap == nil { + var ret map[string]bool + return ret + } + return *o.IndirectMap +} + +// GetIndirectMapOk returns a tuple with the IndirectMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool) { + if o == nil || o.IndirectMap == nil { + return nil, false + } + return o.IndirectMap, true +} + +// HasIndirectMap returns a boolean if a field has been set. +func (o *MapTest) HasIndirectMap() bool { + if o != nil && o.IndirectMap != nil { + return true + } + + return false +} + +// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. +func (o *MapTest) SetIndirectMap(v map[string]bool) { + o.IndirectMap = &v +} + +func (o MapTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapMapOfString != nil { + toSerialize["map_map_of_string"] = o.MapMapOfString + } + if o.MapOfEnumString != nil { + toSerialize["map_of_enum_string"] = o.MapOfEnumString + } + if o.DirectMap != nil { + toSerialize["direct_map"] = o.DirectMap + } + if o.IndirectMap != nil { + toSerialize["indirect_map"] = o.IndirectMap + } + return json.Marshal(toSerialize) +} + +type NullableMapTest struct { + value *MapTest + isSet bool +} + +func (v NullableMapTest) Get() *MapTest { + return v.value +} + +func (v *NullableMapTest) Set(val *MapTest) { + v.value = val + v.isSet = true +} + +func (v NullableMapTest) IsSet() bool { + return v.isSet +} + +func (v *NullableMapTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMapTest(val *MapTest) *NullableMapTest { + return &NullableMapTest{value: val, isSet: true} +} + +func (v NullableMapTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMapTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go index fcd0bc9bbdd..69cc134169e 100644 --- a/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -8,12 +8,180 @@ */ package petstore + import ( + "encoding/json" "time" ) + // MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass type MixedPropertiesAndAdditionalPropertiesClass struct { - Uuid string `json:"uuid,omitempty"` - DateTime time.Time `json:"dateTime,omitempty"` - Map map[string]Animal `json:"map,omitempty"` + Uuid *string `json:"uuid,omitempty"` + DateTime *time.Time `json:"dateTime,omitempty"` + Map *map[string]Animal `json:"map,omitempty"` } + +// NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass { + this := MixedPropertiesAndAdditionalPropertiesClass{} + return &this +} + +// NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass { + this := MixedPropertiesAndAdditionalPropertiesClass{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool) { + if o == nil || o.Uuid == nil { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { + o.Uuid = &v +} + +// GetDateTime returns the DateTime field value if set, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool) { + if o == nil || o.DateTime == nil { + return nil, false + } + return o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetMap returns the Map field value if set, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { + if o == nil || o.Map == nil { + var ret map[string]Animal + return ret + } + return *o.Map +} + +// GetMapOk returns a tuple with the Map field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool) { + if o == nil || o.Map == nil { + return nil, false + } + return o.Map, true +} + +// HasMap returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { + if o != nil && o.Map != nil { + return true + } + + return false +} + +// SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal) { + o.Map = &v +} + +func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Map != nil { + toSerialize["map"] = o.Map + } + return json.Marshal(toSerialize) +} + +type NullableMixedPropertiesAndAdditionalPropertiesClass struct { + value *MixedPropertiesAndAdditionalPropertiesClass + isSet bool +} + +func (v NullableMixedPropertiesAndAdditionalPropertiesClass) Get() *MixedPropertiesAndAdditionalPropertiesClass { + return v.value +} + +func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Set(val *MixedPropertiesAndAdditionalPropertiesClass) { + v.value = val + v.isSet = true +} + +func (v NullableMixedPropertiesAndAdditionalPropertiesClass) IsSet() bool { + return v.isSet +} + +func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMixedPropertiesAndAdditionalPropertiesClass(val *MixedPropertiesAndAdditionalPropertiesClass) *NullableMixedPropertiesAndAdditionalPropertiesClass { + return &NullableMixedPropertiesAndAdditionalPropertiesClass{value: val, isSet: true} +} + +func (v NullableMixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_name.go b/samples/client/petstore/go/go-petstore/model_name.go index 0043908483d..82e49591874 100644 --- a/samples/client/petstore/go/go-petstore/model_name.go +++ b/samples/client/petstore/go/go-petstore/model_name.go @@ -8,10 +8,208 @@ */ package petstore + +import ( + "encoding/json" +) + // Name Model for testing model name same as property name type Name struct { Name int32 `json:"name"` - SnakeCase int32 `json:"snake_case,omitempty"` - Property string `json:"property,omitempty"` - Var123Number int32 `json:"123Number,omitempty"` + SnakeCase *int32 `json:"snake_case,omitempty"` + Property *string `json:"property,omitempty"` + Var123Number *int32 `json:"123Number,omitempty"` } + +// NewName instantiates a new Name object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewName(name int32, ) *Name { + this := Name{} + this.Name = name + return &this +} + +// NewNameWithDefaults instantiates a new Name object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNameWithDefaults() *Name { + this := Name{} + return &this +} + +// GetName returns the Name field value +func (o *Name) GetName() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Name) GetNameOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Name) SetName(v int32) { + o.Name = v +} + +// GetSnakeCase returns the SnakeCase field value if set, zero value otherwise. +func (o *Name) GetSnakeCase() int32 { + if o == nil || o.SnakeCase == nil { + var ret int32 + return ret + } + return *o.SnakeCase +} + +// GetSnakeCaseOk returns a tuple with the SnakeCase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetSnakeCaseOk() (*int32, bool) { + if o == nil || o.SnakeCase == nil { + return nil, false + } + return o.SnakeCase, true +} + +// HasSnakeCase returns a boolean if a field has been set. +func (o *Name) HasSnakeCase() bool { + if o != nil && o.SnakeCase != nil { + return true + } + + return false +} + +// SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. +func (o *Name) SetSnakeCase(v int32) { + o.SnakeCase = &v +} + +// GetProperty returns the Property field value if set, zero value otherwise. +func (o *Name) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetPropertyOk() (*string, bool) { + if o == nil || o.Property == nil { + return nil, false + } + return o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *Name) HasProperty() bool { + if o != nil && o.Property != nil { + return true + } + + return false +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *Name) SetProperty(v string) { + o.Property = &v +} + +// GetVar123Number returns the Var123Number field value if set, zero value otherwise. +func (o *Name) GetVar123Number() int32 { + if o == nil || o.Var123Number == nil { + var ret int32 + return ret + } + return *o.Var123Number +} + +// GetVar123NumberOk returns a tuple with the Var123Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetVar123NumberOk() (*int32, bool) { + if o == nil || o.Var123Number == nil { + return nil, false + } + return o.Var123Number, true +} + +// HasVar123Number returns a boolean if a field has been set. +func (o *Name) HasVar123Number() bool { + if o != nil && o.Var123Number != nil { + return true + } + + return false +} + +// SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. +func (o *Name) SetVar123Number(v int32) { + o.Var123Number = &v +} + +func (o Name) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if o.SnakeCase != nil { + toSerialize["snake_case"] = o.SnakeCase + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Var123Number != nil { + toSerialize["123Number"] = o.Var123Number + } + return json.Marshal(toSerialize) +} + +type NullableName struct { + value *Name + isSet bool +} + +func (v NullableName) Get() *Name { + return v.value +} + +func (v *NullableName) Set(val *Name) { + v.value = val + v.isSet = true +} + +func (v NullableName) IsSet() bool { + return v.isSet +} + +func (v *NullableName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableName(val *Name) *NullableName { + return &NullableName{value: val, isSet: true} +} + +func (v NullableName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_number_only.go b/samples/client/petstore/go/go-petstore/model_number_only.go index 7a3eccc1174..efa8b66a5bc 100644 --- a/samples/client/petstore/go/go-petstore/model_number_only.go +++ b/samples/client/petstore/go/go-petstore/model_number_only.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // NumberOnly struct for NumberOnly type NumberOnly struct { - JustNumber float32 `json:"JustNumber,omitempty"` + JustNumber *float32 `json:"JustNumber,omitempty"` } + +// NewNumberOnly instantiates a new NumberOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNumberOnly() *NumberOnly { + this := NumberOnly{} + return &this +} + +// NewNumberOnlyWithDefaults instantiates a new NumberOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNumberOnlyWithDefaults() *NumberOnly { + this := NumberOnly{} + return &this +} + +// GetJustNumber returns the JustNumber field value if set, zero value otherwise. +func (o *NumberOnly) GetJustNumber() float32 { + if o == nil || o.JustNumber == nil { + var ret float32 + return ret + } + return *o.JustNumber +} + +// GetJustNumberOk returns a tuple with the JustNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NumberOnly) GetJustNumberOk() (*float32, bool) { + if o == nil || o.JustNumber == nil { + return nil, false + } + return o.JustNumber, true +} + +// HasJustNumber returns a boolean if a field has been set. +func (o *NumberOnly) HasJustNumber() bool { + if o != nil && o.JustNumber != nil { + return true + } + + return false +} + +// SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. +func (o *NumberOnly) SetJustNumber(v float32) { + o.JustNumber = &v +} + +func (o NumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustNumber != nil { + toSerialize["JustNumber"] = o.JustNumber + } + return json.Marshal(toSerialize) +} + +type NullableNumberOnly struct { + value *NumberOnly + isSet bool +} + +func (v NullableNumberOnly) Get() *NumberOnly { + return v.value +} + +func (v *NullableNumberOnly) Set(val *NumberOnly) { + v.value = val + v.isSet = true +} + +func (v NullableNumberOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableNumberOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNumberOnly(val *NumberOnly) *NullableNumberOnly { + return &NullableNumberOnly{value: val, isSet: true} +} + +func (v NullableNumberOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNumberOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_order.go b/samples/client/petstore/go/go-petstore/model_order.go index f8bae432ae7..b20a1429848 100644 --- a/samples/client/petstore/go/go-petstore/model_order.go +++ b/samples/client/petstore/go/go-petstore/model_order.go @@ -8,16 +8,293 @@ */ package petstore + import ( + "encoding/json" "time" ) + // Order struct for Order type Order struct { - Id int64 `json:"id,omitempty"` - PetId int64 `json:"petId,omitempty"` - Quantity int32 `json:"quantity,omitempty"` - ShipDate time.Time `json:"shipDate,omitempty"` + Id *int64 `json:"id,omitempty"` + PetId *int64 `json:"petId,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + ShipDate *time.Time `json:"shipDate,omitempty"` // Order Status - Status string `json:"status,omitempty"` - Complete bool `json:"complete,omitempty"` + Status *string `json:"status,omitempty"` + Complete *bool `json:"complete,omitempty"` } + +// NewOrder instantiates a new Order object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrder() *Order { + this := Order{} + var complete bool = false + this.Complete = &complete + return &this +} + +// NewOrderWithDefaults instantiates a new Order object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderWithDefaults() *Order { + this := Order{} + var complete bool = false + this.Complete = &complete + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Order) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Order) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Order) SetId(v int64) { + o.Id = &v +} + +// GetPetId returns the PetId field value if set, zero value otherwise. +func (o *Order) GetPetId() int64 { + if o == nil || o.PetId == nil { + var ret int64 + return ret + } + return *o.PetId +} + +// GetPetIdOk returns a tuple with the PetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetPetIdOk() (*int64, bool) { + if o == nil || o.PetId == nil { + return nil, false + } + return o.PetId, true +} + +// HasPetId returns a boolean if a field has been set. +func (o *Order) HasPetId() bool { + if o != nil && o.PetId != nil { + return true + } + + return false +} + +// SetPetId gets a reference to the given int64 and assigns it to the PetId field. +func (o *Order) SetPetId(v int64) { + o.PetId = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *Order) GetQuantity() int32 { + if o == nil || o.Quantity == nil { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetQuantityOk() (*int32, bool) { + if o == nil || o.Quantity == nil { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *Order) HasQuantity() bool { + if o != nil && o.Quantity != nil { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *Order) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetShipDate returns the ShipDate field value if set, zero value otherwise. +func (o *Order) GetShipDate() time.Time { + if o == nil || o.ShipDate == nil { + var ret time.Time + return ret + } + return *o.ShipDate +} + +// GetShipDateOk returns a tuple with the ShipDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetShipDateOk() (*time.Time, bool) { + if o == nil || o.ShipDate == nil { + return nil, false + } + return o.ShipDate, true +} + +// HasShipDate returns a boolean if a field has been set. +func (o *Order) HasShipDate() bool { + if o != nil && o.ShipDate != nil { + return true + } + + return false +} + +// SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. +func (o *Order) SetShipDate(v time.Time) { + o.ShipDate = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Order) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Order) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Order) SetStatus(v string) { + o.Status = &v +} + +// GetComplete returns the Complete field value if set, zero value otherwise. +func (o *Order) GetComplete() bool { + if o == nil || o.Complete == nil { + var ret bool + return ret + } + return *o.Complete +} + +// GetCompleteOk returns a tuple with the Complete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetCompleteOk() (*bool, bool) { + if o == nil || o.Complete == nil { + return nil, false + } + return o.Complete, true +} + +// HasComplete returns a boolean if a field has been set. +func (o *Order) HasComplete() bool { + if o != nil && o.Complete != nil { + return true + } + + return false +} + +// SetComplete gets a reference to the given bool and assigns it to the Complete field. +func (o *Order) SetComplete(v bool) { + o.Complete = &v +} + +func (o Order) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.PetId != nil { + toSerialize["petId"] = o.PetId + } + if o.Quantity != nil { + toSerialize["quantity"] = o.Quantity + } + if o.ShipDate != nil { + toSerialize["shipDate"] = o.ShipDate + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Complete != nil { + toSerialize["complete"] = o.Complete + } + return json.Marshal(toSerialize) +} + +type NullableOrder struct { + value *Order + isSet bool +} + +func (v NullableOrder) Get() *Order { + return v.value +} + +func (v *NullableOrder) Set(val *Order) { + v.value = val + v.isSet = true +} + +func (v NullableOrder) IsSet() bool { + return v.isSet +} + +func (v *NullableOrder) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrder(val *Order) *NullableOrder { + return &NullableOrder{value: val, isSet: true} +} + +func (v NullableOrder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_outer_composite.go b/samples/client/petstore/go/go-petstore/model_outer_composite.go index 78ce40e6734..9a76c753b64 100644 --- a/samples/client/petstore/go/go-petstore/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore/model_outer_composite.go @@ -8,9 +8,179 @@ */ package petstore + +import ( + "encoding/json" +) + // OuterComposite struct for OuterComposite type OuterComposite struct { - MyNumber float32 `json:"my_number,omitempty"` - MyString string `json:"my_string,omitempty"` - MyBoolean bool `json:"my_boolean,omitempty"` + MyNumber *float32 `json:"my_number,omitempty"` + MyString *string `json:"my_string,omitempty"` + MyBoolean *bool `json:"my_boolean,omitempty"` } + +// NewOuterComposite instantiates a new OuterComposite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOuterComposite() *OuterComposite { + this := OuterComposite{} + return &this +} + +// NewOuterCompositeWithDefaults instantiates a new OuterComposite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOuterCompositeWithDefaults() *OuterComposite { + this := OuterComposite{} + return &this +} + +// GetMyNumber returns the MyNumber field value if set, zero value otherwise. +func (o *OuterComposite) GetMyNumber() float32 { + if o == nil || o.MyNumber == nil { + var ret float32 + return ret + } + return *o.MyNumber +} + +// GetMyNumberOk returns a tuple with the MyNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyNumberOk() (*float32, bool) { + if o == nil || o.MyNumber == nil { + return nil, false + } + return o.MyNumber, true +} + +// HasMyNumber returns a boolean if a field has been set. +func (o *OuterComposite) HasMyNumber() bool { + if o != nil && o.MyNumber != nil { + return true + } + + return false +} + +// SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. +func (o *OuterComposite) SetMyNumber(v float32) { + o.MyNumber = &v +} + +// GetMyString returns the MyString field value if set, zero value otherwise. +func (o *OuterComposite) GetMyString() string { + if o == nil || o.MyString == nil { + var ret string + return ret + } + return *o.MyString +} + +// GetMyStringOk returns a tuple with the MyString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyStringOk() (*string, bool) { + if o == nil || o.MyString == nil { + return nil, false + } + return o.MyString, true +} + +// HasMyString returns a boolean if a field has been set. +func (o *OuterComposite) HasMyString() bool { + if o != nil && o.MyString != nil { + return true + } + + return false +} + +// SetMyString gets a reference to the given string and assigns it to the MyString field. +func (o *OuterComposite) SetMyString(v string) { + o.MyString = &v +} + +// GetMyBoolean returns the MyBoolean field value if set, zero value otherwise. +func (o *OuterComposite) GetMyBoolean() bool { + if o == nil || o.MyBoolean == nil { + var ret bool + return ret + } + return *o.MyBoolean +} + +// GetMyBooleanOk returns a tuple with the MyBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyBooleanOk() (*bool, bool) { + if o == nil || o.MyBoolean == nil { + return nil, false + } + return o.MyBoolean, true +} + +// HasMyBoolean returns a boolean if a field has been set. +func (o *OuterComposite) HasMyBoolean() bool { + if o != nil && o.MyBoolean != nil { + return true + } + + return false +} + +// SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. +func (o *OuterComposite) SetMyBoolean(v bool) { + o.MyBoolean = &v +} + +func (o OuterComposite) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MyNumber != nil { + toSerialize["my_number"] = o.MyNumber + } + if o.MyString != nil { + toSerialize["my_string"] = o.MyString + } + if o.MyBoolean != nil { + toSerialize["my_boolean"] = o.MyBoolean + } + return json.Marshal(toSerialize) +} + +type NullableOuterComposite struct { + value *OuterComposite + isSet bool +} + +func (v NullableOuterComposite) Get() *OuterComposite { + return v.value +} + +func (v *NullableOuterComposite) Set(val *OuterComposite) { + v.value = val + v.isSet = true +} + +func (v NullableOuterComposite) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterComposite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterComposite(val *OuterComposite) *NullableOuterComposite { + return &NullableOuterComposite{value: val, isSet: true} +} + +func (v NullableOuterComposite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterComposite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_outer_enum.go b/samples/client/petstore/go/go-petstore/model_outer_enum.go index efefaf1b784..8160a2d09fc 100644 --- a/samples/client/petstore/go/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore/model_outer_enum.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // OuterEnum the model 'OuterEnum' type OuterEnum string @@ -17,3 +23,62 @@ const ( APPROVED OuterEnum = "approved" DELIVERED OuterEnum = "delivered" ) + +func (v *OuterEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnum(value) + for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnum", value) +} + +// Ptr returns reference to OuterEnum value +func (v OuterEnum) Ptr() *OuterEnum { + return &v +} + +type NullableOuterEnum struct { + value *OuterEnum + isSet bool +} + +func (v NullableOuterEnum) Get() *OuterEnum { + return v.value +} + +func (v *NullableOuterEnum) Set(val *OuterEnum) { + v.value = val + v.isSet = true +} + +func (v NullableOuterEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterEnum(val *OuterEnum) *NullableOuterEnum { + return &NullableOuterEnum{value: val, isSet: true} +} + +func (v NullableOuterEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index 2979b06b3ec..8bc4457fc37 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -8,13 +8,274 @@ */ package petstore + +import ( + "encoding/json" +) + // Pet struct for Pet type Pet struct { - Id int64 `json:"id,omitempty"` - Category Category `json:"category,omitempty"` + Id *int64 `json:"id,omitempty"` + Category *Category `json:"category,omitempty"` Name string `json:"name"` PhotoUrls []string `json:"photoUrls"` - Tags []Tag `json:"tags,omitempty"` + Tags *[]Tag `json:"tags,omitempty"` // pet status in the store - Status string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` } + +// NewPet instantiates a new Pet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPet(name string, photoUrls []string, ) *Pet { + this := Pet{} + this.Name = name + this.PhotoUrls = photoUrls + return &this +} + +// NewPetWithDefaults instantiates a new Pet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPetWithDefaults() *Pet { + this := Pet{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Pet) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Pet) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Pet) SetId(v int64) { + o.Id = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *Pet) GetCategory() Category { + if o == nil || o.Category == nil { + var ret Category + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetCategoryOk() (*Category, bool) { + if o == nil || o.Category == nil { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *Pet) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given Category and assigns it to the Category field. +func (o *Pet) SetCategory(v Category) { + o.Category = &v +} + +// GetName returns the Name field value +func (o *Pet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Pet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Pet) SetName(v string) { + o.Name = v +} + +// GetPhotoUrls returns the PhotoUrls field value +func (o *Pet) GetPhotoUrls() []string { + if o == nil { + var ret []string + return ret + } + + return o.PhotoUrls +} + +// GetPhotoUrlsOk returns a tuple with the PhotoUrls field value +// and a boolean to check if the value has been set. +func (o *Pet) GetPhotoUrlsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.PhotoUrls, true +} + +// SetPhotoUrls sets field value +func (o *Pet) SetPhotoUrls(v []string) { + o.PhotoUrls = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Pet) GetTags() []Tag { + if o == nil || o.Tags == nil { + var ret []Tag + return ret + } + return *o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetTagsOk() (*[]Tag, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Pet) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *Pet) SetTags(v []Tag) { + o.Tags = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Pet) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Pet) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Pet) SetStatus(v string) { + o.Status = &v +} + +func (o Pet) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Category != nil { + toSerialize["category"] = o.Category + } + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["photoUrls"] = o.PhotoUrls + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullablePet struct { + value *Pet + isSet bool +} + +func (v NullablePet) Get() *Pet { + return v.value +} + +func (v *NullablePet) Set(val *Pet) { + v.value = val + v.isSet = true +} + +func (v NullablePet) IsSet() bool { + return v.isSet +} + +func (v *NullablePet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePet(val *Pet) *NullablePet { + return &NullablePet{value: val, isSet: true} +} + +func (v NullablePet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_read_only_first.go b/samples/client/petstore/go/go-petstore/model_read_only_first.go index 7d1e521f4a4..dd00212c1d0 100644 --- a/samples/client/petstore/go/go-petstore/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore/model_read_only_first.go @@ -8,8 +8,143 @@ */ package petstore + +import ( + "encoding/json" +) + // ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { - Bar string `json:"bar,omitempty"` - Baz string `json:"baz,omitempty"` + Bar *string `json:"bar,omitempty"` + Baz *string `json:"baz,omitempty"` } + +// NewReadOnlyFirst instantiates a new ReadOnlyFirst object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReadOnlyFirst() *ReadOnlyFirst { + this := ReadOnlyFirst{} + return &this +} + +// NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst { + this := ReadOnlyFirst{} + return &this +} + +// GetBar returns the Bar field value if set, zero value otherwise. +func (o *ReadOnlyFirst) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBarOk() (*string, bool) { + if o == nil || o.Bar == nil { + return nil, false + } + return o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *ReadOnlyFirst) SetBar(v string) { + o.Bar = &v +} + +// GetBaz returns the Baz field value if set, zero value otherwise. +func (o *ReadOnlyFirst) GetBaz() string { + if o == nil || o.Baz == nil { + var ret string + return ret + } + return *o.Baz +} + +// GetBazOk returns a tuple with the Baz field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBazOk() (*string, bool) { + if o == nil || o.Baz == nil { + return nil, false + } + return o.Baz, true +} + +// HasBaz returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBaz() bool { + if o != nil && o.Baz != nil { + return true + } + + return false +} + +// SetBaz gets a reference to the given string and assigns it to the Baz field. +func (o *ReadOnlyFirst) SetBaz(v string) { + o.Baz = &v +} + +func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Baz != nil { + toSerialize["baz"] = o.Baz + } + return json.Marshal(toSerialize) +} + +type NullableReadOnlyFirst struct { + value *ReadOnlyFirst + isSet bool +} + +func (v NullableReadOnlyFirst) Get() *ReadOnlyFirst { + return v.value +} + +func (v *NullableReadOnlyFirst) Set(val *ReadOnlyFirst) { + v.value = val + v.isSet = true +} + +func (v NullableReadOnlyFirst) IsSet() bool { + return v.isSet +} + +func (v *NullableReadOnlyFirst) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReadOnlyFirst(val *ReadOnlyFirst) *NullableReadOnlyFirst { + return &NullableReadOnlyFirst{value: val, isSet: true} +} + +func (v NullableReadOnlyFirst) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReadOnlyFirst) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_return.go b/samples/client/petstore/go/go-petstore/model_return.go index 9a029c4f8c0..2ed729e12ec 100644 --- a/samples/client/petstore/go/go-petstore/model_return.go +++ b/samples/client/petstore/go/go-petstore/model_return.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // Return Model for testing reserved words type Return struct { - Return int32 `json:"return,omitempty"` + Return *int32 `json:"return,omitempty"` } + +// NewReturn instantiates a new Return object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReturn() *Return { + this := Return{} + return &this +} + +// NewReturnWithDefaults instantiates a new Return object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReturnWithDefaults() *Return { + this := Return{} + return &this +} + +// GetReturn returns the Return field value if set, zero value otherwise. +func (o *Return) GetReturn() int32 { + if o == nil || o.Return == nil { + var ret int32 + return ret + } + return *o.Return +} + +// GetReturnOk returns a tuple with the Return field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Return) GetReturnOk() (*int32, bool) { + if o == nil || o.Return == nil { + return nil, false + } + return o.Return, true +} + +// HasReturn returns a boolean if a field has been set. +func (o *Return) HasReturn() bool { + if o != nil && o.Return != nil { + return true + } + + return false +} + +// SetReturn gets a reference to the given int32 and assigns it to the Return field. +func (o *Return) SetReturn(v int32) { + o.Return = &v +} + +func (o Return) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Return != nil { + toSerialize["return"] = o.Return + } + return json.Marshal(toSerialize) +} + +type NullableReturn struct { + value *Return + isSet bool +} + +func (v NullableReturn) Get() *Return { + return v.value +} + +func (v *NullableReturn) Set(val *Return) { + v.value = val + v.isSet = true +} + +func (v NullableReturn) IsSet() bool { + return v.isSet +} + +func (v *NullableReturn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReturn(val *Return) *NullableReturn { + return &NullableReturn{value: val, isSet: true} +} + +func (v NullableReturn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReturn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_special_model_name.go b/samples/client/petstore/go/go-petstore/model_special_model_name.go index e36ceb38e5f..bbef383b796 100644 --- a/samples/client/petstore/go/go-petstore/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore/model_special_model_name.go @@ -8,7 +8,107 @@ */ package petstore + +import ( + "encoding/json" +) + // SpecialModelName struct for SpecialModelName type SpecialModelName struct { - SpecialPropertyName int64 `json:"$special[property.name],omitempty"` + SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` } + +// NewSpecialModelName instantiates a new SpecialModelName object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpecialModelName() *SpecialModelName { + this := SpecialModelName{} + return &this +} + +// NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpecialModelNameWithDefaults() *SpecialModelName { + this := SpecialModelName{} + return &this +} + +// GetSpecialPropertyName returns the SpecialPropertyName field value if set, zero value otherwise. +func (o *SpecialModelName) GetSpecialPropertyName() int64 { + if o == nil || o.SpecialPropertyName == nil { + var ret int64 + return ret + } + return *o.SpecialPropertyName +} + +// GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool) { + if o == nil || o.SpecialPropertyName == nil { + return nil, false + } + return o.SpecialPropertyName, true +} + +// HasSpecialPropertyName returns a boolean if a field has been set. +func (o *SpecialModelName) HasSpecialPropertyName() bool { + if o != nil && o.SpecialPropertyName != nil { + return true + } + + return false +} + +// SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. +func (o *SpecialModelName) SetSpecialPropertyName(v int64) { + o.SpecialPropertyName = &v +} + +func (o SpecialModelName) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SpecialPropertyName != nil { + toSerialize["$special[property.name]"] = o.SpecialPropertyName + } + return json.Marshal(toSerialize) +} + +type NullableSpecialModelName struct { + value *SpecialModelName + isSet bool +} + +func (v NullableSpecialModelName) Get() *SpecialModelName { + return v.value +} + +func (v *NullableSpecialModelName) Set(val *SpecialModelName) { + v.value = val + v.isSet = true +} + +func (v NullableSpecialModelName) IsSet() bool { + return v.isSet +} + +func (v *NullableSpecialModelName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpecialModelName(val *SpecialModelName) *NullableSpecialModelName { + return &NullableSpecialModelName{value: val, isSet: true} +} + +func (v NullableSpecialModelName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpecialModelName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_tag.go b/samples/client/petstore/go/go-petstore/model_tag.go index 968bd8798a3..99135ba946b 100644 --- a/samples/client/petstore/go/go-petstore/model_tag.go +++ b/samples/client/petstore/go/go-petstore/model_tag.go @@ -8,8 +8,143 @@ */ package petstore + +import ( + "encoding/json" +) + // Tag struct for Tag type Tag struct { - Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Id *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` } + +// NewTag instantiates a new Tag object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTag() *Tag { + this := Tag{} + return &this +} + +// NewTagWithDefaults instantiates a new Tag object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTagWithDefaults() *Tag { + this := Tag{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Tag) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Tag) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Tag) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Tag) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Tag) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Tag) SetName(v string) { + o.Name = &v +} + +func (o Tag) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + +type NullableTag struct { + value *Tag + isSet bool +} + +func (v NullableTag) Get() *Tag { + return v.value +} + +func (v *NullableTag) Set(val *Tag) { + v.value = val + v.isSet = true +} + +func (v NullableTag) IsSet() bool { + return v.isSet +} + +func (v *NullableTag) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTag(val *Tag) *NullableTag { + return &NullableTag{value: val, isSet: true} +} + +func (v NullableTag) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTag) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_default.go b/samples/client/petstore/go/go-petstore/model_type_holder_default.go index 3e75daf7151..d45748bf769 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_default.go @@ -8,6 +8,11 @@ */ package petstore + +import ( + "encoding/json" +) + // TypeHolderDefault struct for TypeHolderDefault type TypeHolderDefault struct { StringItem string `json:"string_item"` @@ -16,3 +21,207 @@ type TypeHolderDefault struct { BoolItem bool `json:"bool_item"` ArrayItem []int32 `json:"array_item"` } + +// NewTypeHolderDefault instantiates a new TypeHolderDefault object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTypeHolderDefault(stringItem string, numberItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderDefault { + this := TypeHolderDefault{} + this.StringItem = stringItem + this.NumberItem = numberItem + this.IntegerItem = integerItem + this.BoolItem = boolItem + this.ArrayItem = arrayItem + return &this +} + +// NewTypeHolderDefaultWithDefaults instantiates a new TypeHolderDefault object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTypeHolderDefaultWithDefaults() *TypeHolderDefault { + this := TypeHolderDefault{} + var stringItem string = "what" + this.StringItem = stringItem + var boolItem bool = true + this.BoolItem = boolItem + return &this +} + +// GetStringItem returns the StringItem field value +func (o *TypeHolderDefault) GetStringItem() string { + if o == nil { + var ret string + return ret + } + + return o.StringItem +} + +// GetStringItemOk returns a tuple with the StringItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderDefault) GetStringItemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StringItem, true +} + +// SetStringItem sets field value +func (o *TypeHolderDefault) SetStringItem(v string) { + o.StringItem = v +} + +// GetNumberItem returns the NumberItem field value +func (o *TypeHolderDefault) GetNumberItem() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.NumberItem +} + +// GetNumberItemOk returns a tuple with the NumberItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderDefault) GetNumberItemOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.NumberItem, true +} + +// SetNumberItem sets field value +func (o *TypeHolderDefault) SetNumberItem(v float32) { + o.NumberItem = v +} + +// GetIntegerItem returns the IntegerItem field value +func (o *TypeHolderDefault) GetIntegerItem() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.IntegerItem +} + +// GetIntegerItemOk returns a tuple with the IntegerItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderDefault) GetIntegerItemOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.IntegerItem, true +} + +// SetIntegerItem sets field value +func (o *TypeHolderDefault) SetIntegerItem(v int32) { + o.IntegerItem = v +} + +// GetBoolItem returns the BoolItem field value +func (o *TypeHolderDefault) GetBoolItem() bool { + if o == nil { + var ret bool + return ret + } + + return o.BoolItem +} + +// GetBoolItemOk returns a tuple with the BoolItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderDefault) GetBoolItemOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.BoolItem, true +} + +// SetBoolItem sets field value +func (o *TypeHolderDefault) SetBoolItem(v bool) { + o.BoolItem = v +} + +// GetArrayItem returns the ArrayItem field value +func (o *TypeHolderDefault) GetArrayItem() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.ArrayItem +} + +// GetArrayItemOk returns a tuple with the ArrayItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderDefault) GetArrayItemOk() (*[]int32, bool) { + if o == nil { + return nil, false + } + return &o.ArrayItem, true +} + +// SetArrayItem sets field value +func (o *TypeHolderDefault) SetArrayItem(v []int32) { + o.ArrayItem = v +} + +func (o TypeHolderDefault) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["string_item"] = o.StringItem + } + if true { + toSerialize["number_item"] = o.NumberItem + } + if true { + toSerialize["integer_item"] = o.IntegerItem + } + if true { + toSerialize["bool_item"] = o.BoolItem + } + if true { + toSerialize["array_item"] = o.ArrayItem + } + return json.Marshal(toSerialize) +} + +type NullableTypeHolderDefault struct { + value *TypeHolderDefault + isSet bool +} + +func (v NullableTypeHolderDefault) Get() *TypeHolderDefault { + return v.value +} + +func (v *NullableTypeHolderDefault) Set(val *TypeHolderDefault) { + v.value = val + v.isSet = true +} + +func (v NullableTypeHolderDefault) IsSet() bool { + return v.isSet +} + +func (v *NullableTypeHolderDefault) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTypeHolderDefault(val *TypeHolderDefault) *NullableTypeHolderDefault { + return &NullableTypeHolderDefault{value: val, isSet: true} +} + +func (v NullableTypeHolderDefault) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTypeHolderDefault) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_example.go b/samples/client/petstore/go/go-petstore/model_type_holder_example.go index 3d1d53f3d75..3f74c433f71 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_example.go @@ -8,6 +8,11 @@ */ package petstore + +import ( + "encoding/json" +) + // TypeHolderExample struct for TypeHolderExample type TypeHolderExample struct { StringItem string `json:"string_item"` @@ -17,3 +22,231 @@ type TypeHolderExample struct { BoolItem bool `json:"bool_item"` ArrayItem []int32 `json:"array_item"` } + +// NewTypeHolderExample instantiates a new TypeHolderExample object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTypeHolderExample(stringItem string, numberItem float32, floatItem float32, integerItem int32, boolItem bool, arrayItem []int32, ) *TypeHolderExample { + this := TypeHolderExample{} + this.StringItem = stringItem + this.NumberItem = numberItem + this.FloatItem = floatItem + this.IntegerItem = integerItem + this.BoolItem = boolItem + this.ArrayItem = arrayItem + return &this +} + +// NewTypeHolderExampleWithDefaults instantiates a new TypeHolderExample object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTypeHolderExampleWithDefaults() *TypeHolderExample { + this := TypeHolderExample{} + return &this +} + +// GetStringItem returns the StringItem field value +func (o *TypeHolderExample) GetStringItem() string { + if o == nil { + var ret string + return ret + } + + return o.StringItem +} + +// GetStringItemOk returns a tuple with the StringItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderExample) GetStringItemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StringItem, true +} + +// SetStringItem sets field value +func (o *TypeHolderExample) SetStringItem(v string) { + o.StringItem = v +} + +// GetNumberItem returns the NumberItem field value +func (o *TypeHolderExample) GetNumberItem() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.NumberItem +} + +// GetNumberItemOk returns a tuple with the NumberItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderExample) GetNumberItemOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.NumberItem, true +} + +// SetNumberItem sets field value +func (o *TypeHolderExample) SetNumberItem(v float32) { + o.NumberItem = v +} + +// GetFloatItem returns the FloatItem field value +func (o *TypeHolderExample) GetFloatItem() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.FloatItem +} + +// GetFloatItemOk returns a tuple with the FloatItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderExample) GetFloatItemOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.FloatItem, true +} + +// SetFloatItem sets field value +func (o *TypeHolderExample) SetFloatItem(v float32) { + o.FloatItem = v +} + +// GetIntegerItem returns the IntegerItem field value +func (o *TypeHolderExample) GetIntegerItem() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.IntegerItem +} + +// GetIntegerItemOk returns a tuple with the IntegerItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderExample) GetIntegerItemOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.IntegerItem, true +} + +// SetIntegerItem sets field value +func (o *TypeHolderExample) SetIntegerItem(v int32) { + o.IntegerItem = v +} + +// GetBoolItem returns the BoolItem field value +func (o *TypeHolderExample) GetBoolItem() bool { + if o == nil { + var ret bool + return ret + } + + return o.BoolItem +} + +// GetBoolItemOk returns a tuple with the BoolItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderExample) GetBoolItemOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.BoolItem, true +} + +// SetBoolItem sets field value +func (o *TypeHolderExample) SetBoolItem(v bool) { + o.BoolItem = v +} + +// GetArrayItem returns the ArrayItem field value +func (o *TypeHolderExample) GetArrayItem() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.ArrayItem +} + +// GetArrayItemOk returns a tuple with the ArrayItem field value +// and a boolean to check if the value has been set. +func (o *TypeHolderExample) GetArrayItemOk() (*[]int32, bool) { + if o == nil { + return nil, false + } + return &o.ArrayItem, true +} + +// SetArrayItem sets field value +func (o *TypeHolderExample) SetArrayItem(v []int32) { + o.ArrayItem = v +} + +func (o TypeHolderExample) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["string_item"] = o.StringItem + } + if true { + toSerialize["number_item"] = o.NumberItem + } + if true { + toSerialize["float_item"] = o.FloatItem + } + if true { + toSerialize["integer_item"] = o.IntegerItem + } + if true { + toSerialize["bool_item"] = o.BoolItem + } + if true { + toSerialize["array_item"] = o.ArrayItem + } + return json.Marshal(toSerialize) +} + +type NullableTypeHolderExample struct { + value *TypeHolderExample + isSet bool +} + +func (v NullableTypeHolderExample) Get() *TypeHolderExample { + return v.value +} + +func (v *NullableTypeHolderExample) Set(val *TypeHolderExample) { + v.value = val + v.isSet = true +} + +func (v NullableTypeHolderExample) IsSet() bool { + return v.isSet +} + +func (v *NullableTypeHolderExample) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTypeHolderExample(val *TypeHolderExample) *NullableTypeHolderExample { + return &NullableTypeHolderExample{value: val, isSet: true} +} + +func (v NullableTypeHolderExample) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTypeHolderExample) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_user.go b/samples/client/petstore/go/go-petstore/model_user.go index a6da6f9a87f..7dff4e8b36b 100644 --- a/samples/client/petstore/go/go-petstore/model_user.go +++ b/samples/client/petstore/go/go-petstore/model_user.go @@ -8,15 +8,360 @@ */ package petstore + +import ( + "encoding/json" +) + // User struct for User type User struct { - Id int64 `json:"id,omitempty"` - Username string `json:"username,omitempty"` - FirstName string `json:"firstName,omitempty"` - LastName string `json:"lastName,omitempty"` - Email string `json:"email,omitempty"` - Password string `json:"password,omitempty"` - Phone string `json:"phone,omitempty"` + Id *int64 `json:"id,omitempty"` + Username *string `json:"username,omitempty"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + Email *string `json:"email,omitempty"` + Password *string `json:"password,omitempty"` + Phone *string `json:"phone,omitempty"` // User Status - UserStatus int32 `json:"userStatus,omitempty"` + UserStatus *int32 `json:"userStatus,omitempty"` } + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *User) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *User) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *User) SetId(v int64) { + o.Id = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || o.Username == nil { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || o.Username == nil { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && o.Username != nil { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || o.FirstName == nil { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (*string, bool) { + if o == nil || o.FirstName == nil { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && o.FirstName != nil { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || o.LastName == nil { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (*string, bool) { + if o == nil || o.LastName == nil { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && o.LastName != nil { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil || o.Email == nil { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (*string, bool) { + if o == nil || o.Password == nil { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *User) GetPhone() string { + if o == nil || o.Phone == nil { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPhoneOk() (*string, bool) { + if o == nil || o.Phone == nil { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *User) HasPhone() bool { + if o != nil && o.Phone != nil { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *User) SetPhone(v string) { + o.Phone = &v +} + +// GetUserStatus returns the UserStatus field value if set, zero value otherwise. +func (o *User) GetUserStatus() int32 { + if o == nil || o.UserStatus == nil { + var ret int32 + return ret + } + return *o.UserStatus +} + +// GetUserStatusOk returns a tuple with the UserStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUserStatusOk() (*int32, bool) { + if o == nil || o.UserStatus == nil { + return nil, false + } + return o.UserStatus, true +} + +// HasUserStatus returns a boolean if a field has been set. +func (o *User) HasUserStatus() bool { + if o != nil && o.UserStatus != nil { + return true + } + + return false +} + +// SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. +func (o *User) SetUserStatus(v int32) { + o.UserStatus = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Username != nil { + toSerialize["username"] = o.Username + } + if o.FirstName != nil { + toSerialize["firstName"] = o.FirstName + } + if o.LastName != nil { + toSerialize["lastName"] = o.LastName + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Phone != nil { + toSerialize["phone"] = o.Phone + } + if o.UserStatus != nil { + toSerialize["userStatus"] = o.UserStatus + } + return json.Marshal(toSerialize) +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go/go-petstore/model_xml_item.go b/samples/client/petstore/go/go-petstore/model_xml_item.go index 8d74417af78..8bf7f3ef707 100644 --- a/samples/client/petstore/go/go-petstore/model_xml_item.go +++ b/samples/client/petstore/go/go-petstore/model_xml_item.go @@ -8,35 +8,1115 @@ */ package petstore + +import ( + "encoding/json" +) + // XmlItem struct for XmlItem type XmlItem struct { - AttributeString string `json:"attribute_string,omitempty"` - AttributeNumber float32 `json:"attribute_number,omitempty"` - AttributeInteger int32 `json:"attribute_integer,omitempty"` - AttributeBoolean bool `json:"attribute_boolean,omitempty"` - WrappedArray []int32 `json:"wrapped_array,omitempty"` - NameString string `json:"name_string,omitempty"` - NameNumber float32 `json:"name_number,omitempty"` - NameInteger int32 `json:"name_integer,omitempty"` - NameBoolean bool `json:"name_boolean,omitempty"` - NameArray []int32 `json:"name_array,omitempty"` - NameWrappedArray []int32 `json:"name_wrapped_array,omitempty"` - PrefixString string `json:"prefix_string,omitempty"` - PrefixNumber float32 `json:"prefix_number,omitempty"` - PrefixInteger int32 `json:"prefix_integer,omitempty"` - PrefixBoolean bool `json:"prefix_boolean,omitempty"` - PrefixArray []int32 `json:"prefix_array,omitempty"` - PrefixWrappedArray []int32 `json:"prefix_wrapped_array,omitempty"` - NamespaceString string `json:"namespace_string,omitempty"` - NamespaceNumber float32 `json:"namespace_number,omitempty"` - NamespaceInteger int32 `json:"namespace_integer,omitempty"` - NamespaceBoolean bool `json:"namespace_boolean,omitempty"` - NamespaceArray []int32 `json:"namespace_array,omitempty"` - NamespaceWrappedArray []int32 `json:"namespace_wrapped_array,omitempty"` - PrefixNsString string `json:"prefix_ns_string,omitempty"` - PrefixNsNumber float32 `json:"prefix_ns_number,omitempty"` - PrefixNsInteger int32 `json:"prefix_ns_integer,omitempty"` - PrefixNsBoolean bool `json:"prefix_ns_boolean,omitempty"` - PrefixNsArray []int32 `json:"prefix_ns_array,omitempty"` - PrefixNsWrappedArray []int32 `json:"prefix_ns_wrapped_array,omitempty"` + AttributeString *string `json:"attribute_string,omitempty"` + AttributeNumber *float32 `json:"attribute_number,omitempty"` + AttributeInteger *int32 `json:"attribute_integer,omitempty"` + AttributeBoolean *bool `json:"attribute_boolean,omitempty"` + WrappedArray *[]int32 `json:"wrapped_array,omitempty"` + NameString *string `json:"name_string,omitempty"` + NameNumber *float32 `json:"name_number,omitempty"` + NameInteger *int32 `json:"name_integer,omitempty"` + NameBoolean *bool `json:"name_boolean,omitempty"` + NameArray *[]int32 `json:"name_array,omitempty"` + NameWrappedArray *[]int32 `json:"name_wrapped_array,omitempty"` + PrefixString *string `json:"prefix_string,omitempty"` + PrefixNumber *float32 `json:"prefix_number,omitempty"` + PrefixInteger *int32 `json:"prefix_integer,omitempty"` + PrefixBoolean *bool `json:"prefix_boolean,omitempty"` + PrefixArray *[]int32 `json:"prefix_array,omitempty"` + PrefixWrappedArray *[]int32 `json:"prefix_wrapped_array,omitempty"` + NamespaceString *string `json:"namespace_string,omitempty"` + NamespaceNumber *float32 `json:"namespace_number,omitempty"` + NamespaceInteger *int32 `json:"namespace_integer,omitempty"` + NamespaceBoolean *bool `json:"namespace_boolean,omitempty"` + NamespaceArray *[]int32 `json:"namespace_array,omitempty"` + NamespaceWrappedArray *[]int32 `json:"namespace_wrapped_array,omitempty"` + PrefixNsString *string `json:"prefix_ns_string,omitempty"` + PrefixNsNumber *float32 `json:"prefix_ns_number,omitempty"` + PrefixNsInteger *int32 `json:"prefix_ns_integer,omitempty"` + PrefixNsBoolean *bool `json:"prefix_ns_boolean,omitempty"` + PrefixNsArray *[]int32 `json:"prefix_ns_array,omitempty"` + PrefixNsWrappedArray *[]int32 `json:"prefix_ns_wrapped_array,omitempty"` } + +// NewXmlItem instantiates a new XmlItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewXmlItem() *XmlItem { + this := XmlItem{} + return &this +} + +// NewXmlItemWithDefaults instantiates a new XmlItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewXmlItemWithDefaults() *XmlItem { + this := XmlItem{} + return &this +} + +// GetAttributeString returns the AttributeString field value if set, zero value otherwise. +func (o *XmlItem) GetAttributeString() string { + if o == nil || o.AttributeString == nil { + var ret string + return ret + } + return *o.AttributeString +} + +// GetAttributeStringOk returns a tuple with the AttributeString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetAttributeStringOk() (*string, bool) { + if o == nil || o.AttributeString == nil { + return nil, false + } + return o.AttributeString, true +} + +// HasAttributeString returns a boolean if a field has been set. +func (o *XmlItem) HasAttributeString() bool { + if o != nil && o.AttributeString != nil { + return true + } + + return false +} + +// SetAttributeString gets a reference to the given string and assigns it to the AttributeString field. +func (o *XmlItem) SetAttributeString(v string) { + o.AttributeString = &v +} + +// GetAttributeNumber returns the AttributeNumber field value if set, zero value otherwise. +func (o *XmlItem) GetAttributeNumber() float32 { + if o == nil || o.AttributeNumber == nil { + var ret float32 + return ret + } + return *o.AttributeNumber +} + +// GetAttributeNumberOk returns a tuple with the AttributeNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetAttributeNumberOk() (*float32, bool) { + if o == nil || o.AttributeNumber == nil { + return nil, false + } + return o.AttributeNumber, true +} + +// HasAttributeNumber returns a boolean if a field has been set. +func (o *XmlItem) HasAttributeNumber() bool { + if o != nil && o.AttributeNumber != nil { + return true + } + + return false +} + +// SetAttributeNumber gets a reference to the given float32 and assigns it to the AttributeNumber field. +func (o *XmlItem) SetAttributeNumber(v float32) { + o.AttributeNumber = &v +} + +// GetAttributeInteger returns the AttributeInteger field value if set, zero value otherwise. +func (o *XmlItem) GetAttributeInteger() int32 { + if o == nil || o.AttributeInteger == nil { + var ret int32 + return ret + } + return *o.AttributeInteger +} + +// GetAttributeIntegerOk returns a tuple with the AttributeInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetAttributeIntegerOk() (*int32, bool) { + if o == nil || o.AttributeInteger == nil { + return nil, false + } + return o.AttributeInteger, true +} + +// HasAttributeInteger returns a boolean if a field has been set. +func (o *XmlItem) HasAttributeInteger() bool { + if o != nil && o.AttributeInteger != nil { + return true + } + + return false +} + +// SetAttributeInteger gets a reference to the given int32 and assigns it to the AttributeInteger field. +func (o *XmlItem) SetAttributeInteger(v int32) { + o.AttributeInteger = &v +} + +// GetAttributeBoolean returns the AttributeBoolean field value if set, zero value otherwise. +func (o *XmlItem) GetAttributeBoolean() bool { + if o == nil || o.AttributeBoolean == nil { + var ret bool + return ret + } + return *o.AttributeBoolean +} + +// GetAttributeBooleanOk returns a tuple with the AttributeBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetAttributeBooleanOk() (*bool, bool) { + if o == nil || o.AttributeBoolean == nil { + return nil, false + } + return o.AttributeBoolean, true +} + +// HasAttributeBoolean returns a boolean if a field has been set. +func (o *XmlItem) HasAttributeBoolean() bool { + if o != nil && o.AttributeBoolean != nil { + return true + } + + return false +} + +// SetAttributeBoolean gets a reference to the given bool and assigns it to the AttributeBoolean field. +func (o *XmlItem) SetAttributeBoolean(v bool) { + o.AttributeBoolean = &v +} + +// GetWrappedArray returns the WrappedArray field value if set, zero value otherwise. +func (o *XmlItem) GetWrappedArray() []int32 { + if o == nil || o.WrappedArray == nil { + var ret []int32 + return ret + } + return *o.WrappedArray +} + +// GetWrappedArrayOk returns a tuple with the WrappedArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetWrappedArrayOk() (*[]int32, bool) { + if o == nil || o.WrappedArray == nil { + return nil, false + } + return o.WrappedArray, true +} + +// HasWrappedArray returns a boolean if a field has been set. +func (o *XmlItem) HasWrappedArray() bool { + if o != nil && o.WrappedArray != nil { + return true + } + + return false +} + +// SetWrappedArray gets a reference to the given []int32 and assigns it to the WrappedArray field. +func (o *XmlItem) SetWrappedArray(v []int32) { + o.WrappedArray = &v +} + +// GetNameString returns the NameString field value if set, zero value otherwise. +func (o *XmlItem) GetNameString() string { + if o == nil || o.NameString == nil { + var ret string + return ret + } + return *o.NameString +} + +// GetNameStringOk returns a tuple with the NameString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNameStringOk() (*string, bool) { + if o == nil || o.NameString == nil { + return nil, false + } + return o.NameString, true +} + +// HasNameString returns a boolean if a field has been set. +func (o *XmlItem) HasNameString() bool { + if o != nil && o.NameString != nil { + return true + } + + return false +} + +// SetNameString gets a reference to the given string and assigns it to the NameString field. +func (o *XmlItem) SetNameString(v string) { + o.NameString = &v +} + +// GetNameNumber returns the NameNumber field value if set, zero value otherwise. +func (o *XmlItem) GetNameNumber() float32 { + if o == nil || o.NameNumber == nil { + var ret float32 + return ret + } + return *o.NameNumber +} + +// GetNameNumberOk returns a tuple with the NameNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNameNumberOk() (*float32, bool) { + if o == nil || o.NameNumber == nil { + return nil, false + } + return o.NameNumber, true +} + +// HasNameNumber returns a boolean if a field has been set. +func (o *XmlItem) HasNameNumber() bool { + if o != nil && o.NameNumber != nil { + return true + } + + return false +} + +// SetNameNumber gets a reference to the given float32 and assigns it to the NameNumber field. +func (o *XmlItem) SetNameNumber(v float32) { + o.NameNumber = &v +} + +// GetNameInteger returns the NameInteger field value if set, zero value otherwise. +func (o *XmlItem) GetNameInteger() int32 { + if o == nil || o.NameInteger == nil { + var ret int32 + return ret + } + return *o.NameInteger +} + +// GetNameIntegerOk returns a tuple with the NameInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNameIntegerOk() (*int32, bool) { + if o == nil || o.NameInteger == nil { + return nil, false + } + return o.NameInteger, true +} + +// HasNameInteger returns a boolean if a field has been set. +func (o *XmlItem) HasNameInteger() bool { + if o != nil && o.NameInteger != nil { + return true + } + + return false +} + +// SetNameInteger gets a reference to the given int32 and assigns it to the NameInteger field. +func (o *XmlItem) SetNameInteger(v int32) { + o.NameInteger = &v +} + +// GetNameBoolean returns the NameBoolean field value if set, zero value otherwise. +func (o *XmlItem) GetNameBoolean() bool { + if o == nil || o.NameBoolean == nil { + var ret bool + return ret + } + return *o.NameBoolean +} + +// GetNameBooleanOk returns a tuple with the NameBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNameBooleanOk() (*bool, bool) { + if o == nil || o.NameBoolean == nil { + return nil, false + } + return o.NameBoolean, true +} + +// HasNameBoolean returns a boolean if a field has been set. +func (o *XmlItem) HasNameBoolean() bool { + if o != nil && o.NameBoolean != nil { + return true + } + + return false +} + +// SetNameBoolean gets a reference to the given bool and assigns it to the NameBoolean field. +func (o *XmlItem) SetNameBoolean(v bool) { + o.NameBoolean = &v +} + +// GetNameArray returns the NameArray field value if set, zero value otherwise. +func (o *XmlItem) GetNameArray() []int32 { + if o == nil || o.NameArray == nil { + var ret []int32 + return ret + } + return *o.NameArray +} + +// GetNameArrayOk returns a tuple with the NameArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNameArrayOk() (*[]int32, bool) { + if o == nil || o.NameArray == nil { + return nil, false + } + return o.NameArray, true +} + +// HasNameArray returns a boolean if a field has been set. +func (o *XmlItem) HasNameArray() bool { + if o != nil && o.NameArray != nil { + return true + } + + return false +} + +// SetNameArray gets a reference to the given []int32 and assigns it to the NameArray field. +func (o *XmlItem) SetNameArray(v []int32) { + o.NameArray = &v +} + +// GetNameWrappedArray returns the NameWrappedArray field value if set, zero value otherwise. +func (o *XmlItem) GetNameWrappedArray() []int32 { + if o == nil || o.NameWrappedArray == nil { + var ret []int32 + return ret + } + return *o.NameWrappedArray +} + +// GetNameWrappedArrayOk returns a tuple with the NameWrappedArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNameWrappedArrayOk() (*[]int32, bool) { + if o == nil || o.NameWrappedArray == nil { + return nil, false + } + return o.NameWrappedArray, true +} + +// HasNameWrappedArray returns a boolean if a field has been set. +func (o *XmlItem) HasNameWrappedArray() bool { + if o != nil && o.NameWrappedArray != nil { + return true + } + + return false +} + +// SetNameWrappedArray gets a reference to the given []int32 and assigns it to the NameWrappedArray field. +func (o *XmlItem) SetNameWrappedArray(v []int32) { + o.NameWrappedArray = &v +} + +// GetPrefixString returns the PrefixString field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixString() string { + if o == nil || o.PrefixString == nil { + var ret string + return ret + } + return *o.PrefixString +} + +// GetPrefixStringOk returns a tuple with the PrefixString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixStringOk() (*string, bool) { + if o == nil || o.PrefixString == nil { + return nil, false + } + return o.PrefixString, true +} + +// HasPrefixString returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixString() bool { + if o != nil && o.PrefixString != nil { + return true + } + + return false +} + +// SetPrefixString gets a reference to the given string and assigns it to the PrefixString field. +func (o *XmlItem) SetPrefixString(v string) { + o.PrefixString = &v +} + +// GetPrefixNumber returns the PrefixNumber field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNumber() float32 { + if o == nil || o.PrefixNumber == nil { + var ret float32 + return ret + } + return *o.PrefixNumber +} + +// GetPrefixNumberOk returns a tuple with the PrefixNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNumberOk() (*float32, bool) { + if o == nil || o.PrefixNumber == nil { + return nil, false + } + return o.PrefixNumber, true +} + +// HasPrefixNumber returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNumber() bool { + if o != nil && o.PrefixNumber != nil { + return true + } + + return false +} + +// SetPrefixNumber gets a reference to the given float32 and assigns it to the PrefixNumber field. +func (o *XmlItem) SetPrefixNumber(v float32) { + o.PrefixNumber = &v +} + +// GetPrefixInteger returns the PrefixInteger field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixInteger() int32 { + if o == nil || o.PrefixInteger == nil { + var ret int32 + return ret + } + return *o.PrefixInteger +} + +// GetPrefixIntegerOk returns a tuple with the PrefixInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixIntegerOk() (*int32, bool) { + if o == nil || o.PrefixInteger == nil { + return nil, false + } + return o.PrefixInteger, true +} + +// HasPrefixInteger returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixInteger() bool { + if o != nil && o.PrefixInteger != nil { + return true + } + + return false +} + +// SetPrefixInteger gets a reference to the given int32 and assigns it to the PrefixInteger field. +func (o *XmlItem) SetPrefixInteger(v int32) { + o.PrefixInteger = &v +} + +// GetPrefixBoolean returns the PrefixBoolean field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixBoolean() bool { + if o == nil || o.PrefixBoolean == nil { + var ret bool + return ret + } + return *o.PrefixBoolean +} + +// GetPrefixBooleanOk returns a tuple with the PrefixBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixBooleanOk() (*bool, bool) { + if o == nil || o.PrefixBoolean == nil { + return nil, false + } + return o.PrefixBoolean, true +} + +// HasPrefixBoolean returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixBoolean() bool { + if o != nil && o.PrefixBoolean != nil { + return true + } + + return false +} + +// SetPrefixBoolean gets a reference to the given bool and assigns it to the PrefixBoolean field. +func (o *XmlItem) SetPrefixBoolean(v bool) { + o.PrefixBoolean = &v +} + +// GetPrefixArray returns the PrefixArray field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixArray() []int32 { + if o == nil || o.PrefixArray == nil { + var ret []int32 + return ret + } + return *o.PrefixArray +} + +// GetPrefixArrayOk returns a tuple with the PrefixArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixArrayOk() (*[]int32, bool) { + if o == nil || o.PrefixArray == nil { + return nil, false + } + return o.PrefixArray, true +} + +// HasPrefixArray returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixArray() bool { + if o != nil && o.PrefixArray != nil { + return true + } + + return false +} + +// SetPrefixArray gets a reference to the given []int32 and assigns it to the PrefixArray field. +func (o *XmlItem) SetPrefixArray(v []int32) { + o.PrefixArray = &v +} + +// GetPrefixWrappedArray returns the PrefixWrappedArray field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixWrappedArray() []int32 { + if o == nil || o.PrefixWrappedArray == nil { + var ret []int32 + return ret + } + return *o.PrefixWrappedArray +} + +// GetPrefixWrappedArrayOk returns a tuple with the PrefixWrappedArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixWrappedArrayOk() (*[]int32, bool) { + if o == nil || o.PrefixWrappedArray == nil { + return nil, false + } + return o.PrefixWrappedArray, true +} + +// HasPrefixWrappedArray returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixWrappedArray() bool { + if o != nil && o.PrefixWrappedArray != nil { + return true + } + + return false +} + +// SetPrefixWrappedArray gets a reference to the given []int32 and assigns it to the PrefixWrappedArray field. +func (o *XmlItem) SetPrefixWrappedArray(v []int32) { + o.PrefixWrappedArray = &v +} + +// GetNamespaceString returns the NamespaceString field value if set, zero value otherwise. +func (o *XmlItem) GetNamespaceString() string { + if o == nil || o.NamespaceString == nil { + var ret string + return ret + } + return *o.NamespaceString +} + +// GetNamespaceStringOk returns a tuple with the NamespaceString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNamespaceStringOk() (*string, bool) { + if o == nil || o.NamespaceString == nil { + return nil, false + } + return o.NamespaceString, true +} + +// HasNamespaceString returns a boolean if a field has been set. +func (o *XmlItem) HasNamespaceString() bool { + if o != nil && o.NamespaceString != nil { + return true + } + + return false +} + +// SetNamespaceString gets a reference to the given string and assigns it to the NamespaceString field. +func (o *XmlItem) SetNamespaceString(v string) { + o.NamespaceString = &v +} + +// GetNamespaceNumber returns the NamespaceNumber field value if set, zero value otherwise. +func (o *XmlItem) GetNamespaceNumber() float32 { + if o == nil || o.NamespaceNumber == nil { + var ret float32 + return ret + } + return *o.NamespaceNumber +} + +// GetNamespaceNumberOk returns a tuple with the NamespaceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNamespaceNumberOk() (*float32, bool) { + if o == nil || o.NamespaceNumber == nil { + return nil, false + } + return o.NamespaceNumber, true +} + +// HasNamespaceNumber returns a boolean if a field has been set. +func (o *XmlItem) HasNamespaceNumber() bool { + if o != nil && o.NamespaceNumber != nil { + return true + } + + return false +} + +// SetNamespaceNumber gets a reference to the given float32 and assigns it to the NamespaceNumber field. +func (o *XmlItem) SetNamespaceNumber(v float32) { + o.NamespaceNumber = &v +} + +// GetNamespaceInteger returns the NamespaceInteger field value if set, zero value otherwise. +func (o *XmlItem) GetNamespaceInteger() int32 { + if o == nil || o.NamespaceInteger == nil { + var ret int32 + return ret + } + return *o.NamespaceInteger +} + +// GetNamespaceIntegerOk returns a tuple with the NamespaceInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNamespaceIntegerOk() (*int32, bool) { + if o == nil || o.NamespaceInteger == nil { + return nil, false + } + return o.NamespaceInteger, true +} + +// HasNamespaceInteger returns a boolean if a field has been set. +func (o *XmlItem) HasNamespaceInteger() bool { + if o != nil && o.NamespaceInteger != nil { + return true + } + + return false +} + +// SetNamespaceInteger gets a reference to the given int32 and assigns it to the NamespaceInteger field. +func (o *XmlItem) SetNamespaceInteger(v int32) { + o.NamespaceInteger = &v +} + +// GetNamespaceBoolean returns the NamespaceBoolean field value if set, zero value otherwise. +func (o *XmlItem) GetNamespaceBoolean() bool { + if o == nil || o.NamespaceBoolean == nil { + var ret bool + return ret + } + return *o.NamespaceBoolean +} + +// GetNamespaceBooleanOk returns a tuple with the NamespaceBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNamespaceBooleanOk() (*bool, bool) { + if o == nil || o.NamespaceBoolean == nil { + return nil, false + } + return o.NamespaceBoolean, true +} + +// HasNamespaceBoolean returns a boolean if a field has been set. +func (o *XmlItem) HasNamespaceBoolean() bool { + if o != nil && o.NamespaceBoolean != nil { + return true + } + + return false +} + +// SetNamespaceBoolean gets a reference to the given bool and assigns it to the NamespaceBoolean field. +func (o *XmlItem) SetNamespaceBoolean(v bool) { + o.NamespaceBoolean = &v +} + +// GetNamespaceArray returns the NamespaceArray field value if set, zero value otherwise. +func (o *XmlItem) GetNamespaceArray() []int32 { + if o == nil || o.NamespaceArray == nil { + var ret []int32 + return ret + } + return *o.NamespaceArray +} + +// GetNamespaceArrayOk returns a tuple with the NamespaceArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNamespaceArrayOk() (*[]int32, bool) { + if o == nil || o.NamespaceArray == nil { + return nil, false + } + return o.NamespaceArray, true +} + +// HasNamespaceArray returns a boolean if a field has been set. +func (o *XmlItem) HasNamespaceArray() bool { + if o != nil && o.NamespaceArray != nil { + return true + } + + return false +} + +// SetNamespaceArray gets a reference to the given []int32 and assigns it to the NamespaceArray field. +func (o *XmlItem) SetNamespaceArray(v []int32) { + o.NamespaceArray = &v +} + +// GetNamespaceWrappedArray returns the NamespaceWrappedArray field value if set, zero value otherwise. +func (o *XmlItem) GetNamespaceWrappedArray() []int32 { + if o == nil || o.NamespaceWrappedArray == nil { + var ret []int32 + return ret + } + return *o.NamespaceWrappedArray +} + +// GetNamespaceWrappedArrayOk returns a tuple with the NamespaceWrappedArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetNamespaceWrappedArrayOk() (*[]int32, bool) { + if o == nil || o.NamespaceWrappedArray == nil { + return nil, false + } + return o.NamespaceWrappedArray, true +} + +// HasNamespaceWrappedArray returns a boolean if a field has been set. +func (o *XmlItem) HasNamespaceWrappedArray() bool { + if o != nil && o.NamespaceWrappedArray != nil { + return true + } + + return false +} + +// SetNamespaceWrappedArray gets a reference to the given []int32 and assigns it to the NamespaceWrappedArray field. +func (o *XmlItem) SetNamespaceWrappedArray(v []int32) { + o.NamespaceWrappedArray = &v +} + +// GetPrefixNsString returns the PrefixNsString field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNsString() string { + if o == nil || o.PrefixNsString == nil { + var ret string + return ret + } + return *o.PrefixNsString +} + +// GetPrefixNsStringOk returns a tuple with the PrefixNsString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNsStringOk() (*string, bool) { + if o == nil || o.PrefixNsString == nil { + return nil, false + } + return o.PrefixNsString, true +} + +// HasPrefixNsString returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNsString() bool { + if o != nil && o.PrefixNsString != nil { + return true + } + + return false +} + +// SetPrefixNsString gets a reference to the given string and assigns it to the PrefixNsString field. +func (o *XmlItem) SetPrefixNsString(v string) { + o.PrefixNsString = &v +} + +// GetPrefixNsNumber returns the PrefixNsNumber field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNsNumber() float32 { + if o == nil || o.PrefixNsNumber == nil { + var ret float32 + return ret + } + return *o.PrefixNsNumber +} + +// GetPrefixNsNumberOk returns a tuple with the PrefixNsNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNsNumberOk() (*float32, bool) { + if o == nil || o.PrefixNsNumber == nil { + return nil, false + } + return o.PrefixNsNumber, true +} + +// HasPrefixNsNumber returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNsNumber() bool { + if o != nil && o.PrefixNsNumber != nil { + return true + } + + return false +} + +// SetPrefixNsNumber gets a reference to the given float32 and assigns it to the PrefixNsNumber field. +func (o *XmlItem) SetPrefixNsNumber(v float32) { + o.PrefixNsNumber = &v +} + +// GetPrefixNsInteger returns the PrefixNsInteger field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNsInteger() int32 { + if o == nil || o.PrefixNsInteger == nil { + var ret int32 + return ret + } + return *o.PrefixNsInteger +} + +// GetPrefixNsIntegerOk returns a tuple with the PrefixNsInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNsIntegerOk() (*int32, bool) { + if o == nil || o.PrefixNsInteger == nil { + return nil, false + } + return o.PrefixNsInteger, true +} + +// HasPrefixNsInteger returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNsInteger() bool { + if o != nil && o.PrefixNsInteger != nil { + return true + } + + return false +} + +// SetPrefixNsInteger gets a reference to the given int32 and assigns it to the PrefixNsInteger field. +func (o *XmlItem) SetPrefixNsInteger(v int32) { + o.PrefixNsInteger = &v +} + +// GetPrefixNsBoolean returns the PrefixNsBoolean field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNsBoolean() bool { + if o == nil || o.PrefixNsBoolean == nil { + var ret bool + return ret + } + return *o.PrefixNsBoolean +} + +// GetPrefixNsBooleanOk returns a tuple with the PrefixNsBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNsBooleanOk() (*bool, bool) { + if o == nil || o.PrefixNsBoolean == nil { + return nil, false + } + return o.PrefixNsBoolean, true +} + +// HasPrefixNsBoolean returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNsBoolean() bool { + if o != nil && o.PrefixNsBoolean != nil { + return true + } + + return false +} + +// SetPrefixNsBoolean gets a reference to the given bool and assigns it to the PrefixNsBoolean field. +func (o *XmlItem) SetPrefixNsBoolean(v bool) { + o.PrefixNsBoolean = &v +} + +// GetPrefixNsArray returns the PrefixNsArray field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNsArray() []int32 { + if o == nil || o.PrefixNsArray == nil { + var ret []int32 + return ret + } + return *o.PrefixNsArray +} + +// GetPrefixNsArrayOk returns a tuple with the PrefixNsArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNsArrayOk() (*[]int32, bool) { + if o == nil || o.PrefixNsArray == nil { + return nil, false + } + return o.PrefixNsArray, true +} + +// HasPrefixNsArray returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNsArray() bool { + if o != nil && o.PrefixNsArray != nil { + return true + } + + return false +} + +// SetPrefixNsArray gets a reference to the given []int32 and assigns it to the PrefixNsArray field. +func (o *XmlItem) SetPrefixNsArray(v []int32) { + o.PrefixNsArray = &v +} + +// GetPrefixNsWrappedArray returns the PrefixNsWrappedArray field value if set, zero value otherwise. +func (o *XmlItem) GetPrefixNsWrappedArray() []int32 { + if o == nil || o.PrefixNsWrappedArray == nil { + var ret []int32 + return ret + } + return *o.PrefixNsWrappedArray +} + +// GetPrefixNsWrappedArrayOk returns a tuple with the PrefixNsWrappedArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XmlItem) GetPrefixNsWrappedArrayOk() (*[]int32, bool) { + if o == nil || o.PrefixNsWrappedArray == nil { + return nil, false + } + return o.PrefixNsWrappedArray, true +} + +// HasPrefixNsWrappedArray returns a boolean if a field has been set. +func (o *XmlItem) HasPrefixNsWrappedArray() bool { + if o != nil && o.PrefixNsWrappedArray != nil { + return true + } + + return false +} + +// SetPrefixNsWrappedArray gets a reference to the given []int32 and assigns it to the PrefixNsWrappedArray field. +func (o *XmlItem) SetPrefixNsWrappedArray(v []int32) { + o.PrefixNsWrappedArray = &v +} + +func (o XmlItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AttributeString != nil { + toSerialize["attribute_string"] = o.AttributeString + } + if o.AttributeNumber != nil { + toSerialize["attribute_number"] = o.AttributeNumber + } + if o.AttributeInteger != nil { + toSerialize["attribute_integer"] = o.AttributeInteger + } + if o.AttributeBoolean != nil { + toSerialize["attribute_boolean"] = o.AttributeBoolean + } + if o.WrappedArray != nil { + toSerialize["wrapped_array"] = o.WrappedArray + } + if o.NameString != nil { + toSerialize["name_string"] = o.NameString + } + if o.NameNumber != nil { + toSerialize["name_number"] = o.NameNumber + } + if o.NameInteger != nil { + toSerialize["name_integer"] = o.NameInteger + } + if o.NameBoolean != nil { + toSerialize["name_boolean"] = o.NameBoolean + } + if o.NameArray != nil { + toSerialize["name_array"] = o.NameArray + } + if o.NameWrappedArray != nil { + toSerialize["name_wrapped_array"] = o.NameWrappedArray + } + if o.PrefixString != nil { + toSerialize["prefix_string"] = o.PrefixString + } + if o.PrefixNumber != nil { + toSerialize["prefix_number"] = o.PrefixNumber + } + if o.PrefixInteger != nil { + toSerialize["prefix_integer"] = o.PrefixInteger + } + if o.PrefixBoolean != nil { + toSerialize["prefix_boolean"] = o.PrefixBoolean + } + if o.PrefixArray != nil { + toSerialize["prefix_array"] = o.PrefixArray + } + if o.PrefixWrappedArray != nil { + toSerialize["prefix_wrapped_array"] = o.PrefixWrappedArray + } + if o.NamespaceString != nil { + toSerialize["namespace_string"] = o.NamespaceString + } + if o.NamespaceNumber != nil { + toSerialize["namespace_number"] = o.NamespaceNumber + } + if o.NamespaceInteger != nil { + toSerialize["namespace_integer"] = o.NamespaceInteger + } + if o.NamespaceBoolean != nil { + toSerialize["namespace_boolean"] = o.NamespaceBoolean + } + if o.NamespaceArray != nil { + toSerialize["namespace_array"] = o.NamespaceArray + } + if o.NamespaceWrappedArray != nil { + toSerialize["namespace_wrapped_array"] = o.NamespaceWrappedArray + } + if o.PrefixNsString != nil { + toSerialize["prefix_ns_string"] = o.PrefixNsString + } + if o.PrefixNsNumber != nil { + toSerialize["prefix_ns_number"] = o.PrefixNsNumber + } + if o.PrefixNsInteger != nil { + toSerialize["prefix_ns_integer"] = o.PrefixNsInteger + } + if o.PrefixNsBoolean != nil { + toSerialize["prefix_ns_boolean"] = o.PrefixNsBoolean + } + if o.PrefixNsArray != nil { + toSerialize["prefix_ns_array"] = o.PrefixNsArray + } + if o.PrefixNsWrappedArray != nil { + toSerialize["prefix_ns_wrapped_array"] = o.PrefixNsWrappedArray + } + return json.Marshal(toSerialize) +} + +type NullableXmlItem struct { + value *XmlItem + isSet bool +} + +func (v NullableXmlItem) Get() *XmlItem { + return v.value +} + +func (v *NullableXmlItem) Set(val *XmlItem) { + v.value = val + v.isSet = true +} + +func (v NullableXmlItem) IsSet() bool { + return v.isSet +} + +func (v *NullableXmlItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableXmlItem(val *XmlItem) *NullableXmlItem { + return &NullableXmlItem{value: val, isSet: true} +} + +func (v NullableXmlItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableXmlItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/client/petstore/go-experimental/go-petstore/utils.go b/samples/client/petstore/go/go-petstore/utils.go similarity index 100% rename from samples/client/petstore/go-experimental/go-petstore/utils.go rename to samples/client/petstore/go/go-petstore/utils.go diff --git a/samples/client/petstore/go-experimental/mock/mock_api_pet.go b/samples/client/petstore/go/mock/mock_api_pet.go similarity index 100% rename from samples/client/petstore/go-experimental/mock/mock_api_pet.go rename to samples/client/petstore/go/mock/mock_api_pet.go diff --git a/samples/client/petstore/go/pet_api_test.go b/samples/client/petstore/go/pet_api_test.go index cda4f457855..0868c4b96cc 100644 --- a/samples/client/petstore/go/pet_api_test.go +++ b/samples/client/petstore/go/pet_api_test.go @@ -6,10 +6,10 @@ import ( "os" "testing" - "github.com/antihax/optional" "github.com/stretchr/testify/assert" sw "./go-petstore" + mock "./mock" ) var client *sw.APIClient @@ -28,10 +28,11 @@ func TestMain(m *testing.M) { } func TestAddPet(t *testing.T) { - newPet := (sw.Pet{Id: 12830, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Body(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -41,8 +42,17 @@ func TestAddPet(t *testing.T) { } } +func TestAddPetMock(t *testing.T) { + actualApi := client.PetApi + + mockApi := mock.NewMockPetApi() + client.PetApi = mockApi + TestAddPet(t) + client.PetApi = actualApi +} + func TestFindPetsByStatusWithMissingParam(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() if err != nil { t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) @@ -57,7 +67,7 @@ func TestGetPetById(t *testing.T) { } func TestGetPetByIdWithInvalidID(t *testing.T) { - resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999) + resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() if r != nil && r.StatusCode == 404 { assertedError, ok := err.(sw.GenericOpenAPIError) a := assert.New(t) @@ -74,10 +84,7 @@ func TestGetPetByIdWithInvalidID(t *testing.T) { } func TestUpdatePetWithForm(t *testing.T) { - r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.UpdatePetWithFormOpts{ - Name: optional.NewString("golang"), - Status: optional.NewString("available"), - }) + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() if err != nil { t.Fatalf("Error while updating pet by id: %v", err) t.Log(r) @@ -86,13 +93,13 @@ func TestUpdatePetWithForm(t *testing.T) { t.Log(r) } - // get the pet with id 12830 from server to verify the update - isPetCorrect(t, 12830, "golang", "available") + // get the pet with id 12830 from server to verify the update + isPetCorrect(t, 12830, "golang", "available") } func TestFindPetsByTag(t *testing.T) { var found = false - resp, r, err := client.PetApi.FindPetsByTags(context.Background(), []string{"tag2"}) + resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() if err != nil { t.Fatalf("Error while getting pet by tag: %v", err) t.Log(r) @@ -103,8 +110,8 @@ func TestFindPetsByTag(t *testing.T) { assert := assert.New(t) for i := 0; i < len(resp); i++ { - if resp[i].Id == 12830 { - assert.Equal(resp[i].Status, "available", "Pet status should be `pending`") + if *resp[i].Id == 12830 { + assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`") found = true } } @@ -121,7 +128,7 @@ func TestFindPetsByTag(t *testing.T) { } func TestFindPetsByStatus(t *testing.T) { - resp, r, err := client.PetApi.FindPetsByStatus(context.Background(), []string{"available"}) + resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() if err != nil { t.Fatalf("Error while getting pet by id: %v", err) t.Log(r) @@ -131,7 +138,7 @@ func TestFindPetsByStatus(t *testing.T) { } else { assert := assert.New(t) for i := 0; i < len(resp); i++ { - assert.Equal(resp[i].Status, "available", "Pet status should be `available`") + assert.Equal(*resp[i].Status, "available", "Pet status should be `available`") } } @@ -147,10 +154,7 @@ func TestUploadFile(t *testing.T) { t.Fatalf("Error opening file: %v", err1) } - _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ - AdditionalMetadata: optional.NewString("golang"), - File: optional.NewInterface(file), - }) + _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() if err != nil { t.Fatalf("Error while uploading file: %v", err) @@ -168,11 +172,7 @@ func TestUploadFileRequired(t *testing.T) { t.Fatalf("Error opening file: %v", err1) } - _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830, - file, - &sw.UploadFileWithRequiredFileOpts{ - AdditionalMetadata: optional.NewString("golang"), - }) + _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() if err != nil { t.Fatalf("Error while uploading file: %v", err) @@ -184,7 +184,7 @@ func TestUploadFileRequired(t *testing.T) { } func TestDeletePet(t *testing.T) { - r, err := client.PetApi.DeletePet(context.Background(), 12830, nil) + r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -274,7 +274,7 @@ func waitOnFunctions(t *testing.T, errc chan error, n int) { } func deletePet(t *testing.T, id int64) { - r, err := client.PetApi.DeletePet(context.Background(), id, nil) + r, err := client.PetApi.DeletePet(context.Background(), id).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -286,13 +286,13 @@ func deletePet(t *testing.T, id int64) { func isPetCorrect(t *testing.T, id int64, name string, status string) { assert := assert.New(t) - resp, r, err := client.PetApi.GetPetById(context.Background(), id) + resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() if err != nil { t.Fatalf("Error while getting pet by id: %v", err) } else { - assert.Equal(resp.Id, int64(id), "Pet id should be equal") + assert.Equal(*resp.Id, int64(id), "Pet id should be equal") assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) - assert.Equal(resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) + assert.Equal(*resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) //t.Log(resp) } @@ -300,4 +300,3 @@ func isPetCorrect(t *testing.T, id int64, name string, status string) { t.Log(r) } } - diff --git a/samples/client/petstore/go/pom.xml b/samples/client/petstore/go/pom.xml index 7b3edeff64d..568f8e25a56 100644 --- a/samples/client/petstore/go/pom.xml +++ b/samples/client/petstore/go/pom.xml @@ -68,20 +68,6 @@ - - go-get-optional - pre-integration-test - - exec - - - go - - get - github.com/antihax/optional - - - go-test integration-test diff --git a/samples/client/petstore/go/store_api_test.go b/samples/client/petstore/go/store_api_test.go index 3088adf7b40..f9f55273eb9 100644 --- a/samples/client/petstore/go/store_api_test.go +++ b/samples/client/petstore/go/store_api_test.go @@ -11,14 +11,14 @@ import ( func TestPlaceOrder(t *testing.T) { newOrder := sw.Order{ - Id: 0, - PetId: 0, - Quantity: 0, - ShipDate: time.Now().UTC(), - Status: "placed", - Complete: false} + Id: sw.PtrInt64(0), + PetId: sw.PtrInt64(0), + Quantity: sw.PtrInt32(0), + ShipDate: sw.PtrTime(time.Now().UTC()), + Status: sw.PtrString("placed"), + Complete: sw.PtrBool(false)} - _, r, err := client.StoreApi.PlaceOrder(context.Background(), newOrder) + _, r, err := client.StoreApi.PlaceOrder(context.Background()).Body(newOrder).Execute() if err != nil { // Skip parsing time error due to error in Petstore Test Server diff --git a/samples/client/petstore/go/user_api_test.go b/samples/client/petstore/go/user_api_test.go index d260fc70e3f..361e77ac9aa 100644 --- a/samples/client/petstore/go/user_api_test.go +++ b/samples/client/petstore/go/user_api_test.go @@ -11,16 +11,16 @@ import ( func TestCreateUser(t *testing.T) { newUser := sw.User{ - Id: 1000, - FirstName: "gopher", - LastName: "lang", - Username: "gopher", - Password: "lang", - Email: "lang@test.com", - Phone: "5101112222", - UserStatus: 1} + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher"), + LastName: sw.PtrString("lang"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} - apiResponse, err := client.UserApi.CreateUser(context.Background(), newUser) + apiResponse, err := client.UserApi.CreateUser(context.Background()).Body(newUser).Execute() if err != nil { t.Fatalf("Error while adding user: %v", err) @@ -34,44 +34,43 @@ func TestCreateUser(t *testing.T) { func TestCreateUsersWithArrayInput(t *testing.T) { newUsers := []sw.User{ sw.User{ - Id: int64(1001), - FirstName: "gopher1", - LastName: "lang1", - Username: "gopher1", - Password: "lang1", - Email: "lang1@test.com", - Phone: "5101112222", - UserStatus: int32(1), + Id: sw.PtrInt64(1001), + FirstName: sw.PtrString("gopher1"), + LastName: sw.PtrString("lang1"), + Username: sw.PtrString("gopher1"), + Password: sw.PtrString("lang1"), + Email: sw.PtrString("lang1@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), }, sw.User{ - Id: int64(1002), - FirstName: "gopher2", - LastName: "lang2", - Username: "gopher2", - Password: "lang2", - Email: "lang2@test.com", - Phone: "5101112222", - UserStatus: int32(1), + Id: sw.PtrInt64(1002), + FirstName: sw.PtrString("gopher2"), + LastName: sw.PtrString("lang2"), + Username: sw.PtrString("gopher2"), + Password: sw.PtrString("lang2"), + Email: sw.PtrString("lang2@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), }, } - apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background(), newUsers) + apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).Body(newUsers).Execute() if err != nil { t.Fatalf("Error while adding users: %v", err) } if apiResponse.StatusCode != 200 { t.Log(apiResponse) } - -/* issue with deleting users in the server side (500). commented out below for the time being +/* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down - _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") + _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() if err1 != nil { t.Errorf("Error while deleting user") t.Log(err1) } - _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2") + _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2").Execute() if err2 != nil { t.Errorf("Error while deleting user") t.Log(err2) @@ -82,13 +81,13 @@ func TestCreateUsersWithArrayInput(t *testing.T) { func TestGetUserByName(t *testing.T) { assert := assert.New(t) - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() if err != nil { t.Fatalf("Error while getting user by id: %v", err) } else { - assert.Equal(resp.Id, int64(1000), "User id should be equal") - assert.Equal(resp.Username, "gopher", "User name should be gopher") - assert.Equal(resp.LastName, "lang", "Last name should be lang") + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.Username, "gopher", "User name should be gopher") + assert.Equal(*resp.LastName, "lang", "Last name should be lang") //t.Log(resp) } if apiResponse.StatusCode != 200 { @@ -97,7 +96,7 @@ func TestGetUserByName(t *testing.T) { } func TestGetUserByNameWithInvalidID(t *testing.T) { - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999") + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() if apiResponse != nil && apiResponse.StatusCode == 404 { return // This is a pass condition. API will return with a 404 error. } else if err != nil { @@ -115,16 +114,16 @@ func TestUpdateUser(t *testing.T) { assert := assert.New(t) newUser := sw.User{ - Id: 1000, - FirstName: "gopher20", - LastName: "lang20", - Username: "gopher", - Password: "lang", - Email: "lang@test.com", - Phone: "5101112222", - UserStatus: 1} + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher20"), + LastName: sw.PtrString("lang20"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} - apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher", newUser) + apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").Body(newUser).Execute() if err != nil { t.Fatalf("Error while deleting user by id: %v", err) } @@ -133,20 +132,19 @@ func TestUpdateUser(t *testing.T) { } //verify changings are correct - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() if err != nil { t.Fatalf("Error while getting user by id: %v", err) } else { - assert.Equal(resp.Id, int64(1000), "User id should be equal") - assert.Equal(resp.FirstName, "gopher20", "User name should be gopher") - assert.Equal(resp.Password, "lang", "User name should be the same") + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(*resp.Password, "lang", "User name should be the same") } } -/* issue in the server side as deleting user no longer works (returning 500) - we may uncomment the following test when the server's issue is addressed +/* issue deleting users due to issue in the server side (500). commented out below for the time being func TestDeleteUser(t *testing.T) { - apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") + apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() if err != nil { t.Fatalf("Error while deleting user: %v", err) @@ -154,4 +152,5 @@ func TestDeleteUser(t *testing.T) { if apiResponse.StatusCode != 200 { t.Log(apiResponse) } -}*/ +} +*/ diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md index 6d017a13cd4..1b2f257e0aa 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md @@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat - API version: 1.0.0 - Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen +- Build package: org.openapitools.codegen.languages.GoClientCodegen ## Installation diff --git a/samples/openapi3/client/petstore/go-experimental/auth_test.go b/samples/openapi3/client/petstore/go-experimental/auth_test.go deleted file mode 100644 index aec544c2f26..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/auth_test.go +++ /dev/null @@ -1,259 +0,0 @@ -package main - -import ( - "context" - "net/http" - "net/http/httputil" - "strings" - "testing" - "time" - - "golang.org/x/oauth2" - - sw "./go-petstore" -) - -func TestOAuth2(t *testing.T) { - // Setup some fake oauth2 configuration - cfg := &oauth2.Config{ - ClientID: "1234567", - ClientSecret: "SuperSecret", - Endpoint: oauth2.Endpoint{ - AuthURL: "https://devnull", - TokenURL: "https://devnull", - }, - RedirectURL: "https://devnull", - } - - // and a fake token - tok := oauth2.Token{ - AccessToken: "FAKE", - RefreshToken: "So Fake", - Expiry: time.Now().Add(time.Hour * 100000), - TokenType: "Bearer", - } - - // then a fake tokenSource - tokenSource := cfg.TokenSource(createContext(nil), &tok) - auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - - if !strings.Contains((string)(reqb), "Authorization: Bearer FAKE") { - t.Errorf("OAuth2 Authentication is missing") - } -} - -func TestBasicAuth(t *testing.T) { - - auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "fakeUser", - Password: "f4k3p455", - }) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(auth).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Authorization: Basic ZmFrZVVzZXI6ZjRrM3A0NTU") { - t.Errorf("Basic Authentication is missing") - } -} - -func TestAccessToken(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Authorization: Bearer TESTFAKEACCESSTOKENISFAKE") { - t.Errorf("AccessToken Authentication is missing") - } -} - -func TestAPIKeyNoPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: TEST123") { - t.Errorf("APIKey Authentication is missing") - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestAPIKeyWithPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) - - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { - t.Errorf("APIKey Authentication is missing") - } - - r, err = client.PetApi.DeletePet(auth, 12992).Execute() - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestDefaultHeader(t *testing.T) { - newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - - r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } - reqb, _ := httputil.DumpRequest(r.Request, true) - if !strings.Contains((string)(reqb), "Testheader: testvalue") { - t.Errorf("Default Header is missing") - } -} - -func TestHostOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - - if err != nil { - t.Fatalf("Error while finding pets by status: %v", err) - } - - if r.Request.URL.Host != testHost { - t.Errorf("Request Host is %v, expected %v", r.Request.Host, testHost) - } -} - -func TestSchemeOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - - if err != nil { - t.Fatalf("Error while finding pets by status: %v", err) - } - - if r.Request.URL.Scheme != testScheme { - t.Errorf("Request Scheme is %v, expected %v", r.Request.URL.Scheme, testScheme) - } -} - -// Add custom clients to the context. -func createContext(httpClient *http.Client) context.Context { - parent := oauth2.NoContext - ctx := context.WithValue(parent, oauth2.HTTPClient, httpClient) - return ctx -} diff --git a/samples/openapi3/client/petstore/go-experimental/fake_api_test.go b/samples/openapi3/client/petstore/go-experimental/fake_api_test.go deleted file mode 100644 index 97910bf3cf7..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/fake_api_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "context" - "testing" - - sw "./go-petstore" -) - -// TestPutBodyWithFileSchema ensures a model with the name 'File' -// gets converted properly to the petstore.File struct vs. *os.File -// as specified in typeMapping for 'File'. -func TestPutBodyWithFileSchema(t *testing.T) { - return // early return to test compilation - - schema := sw.FileSchemaTestClass{ - File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, - Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} - - r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(schema).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore b/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore deleted file mode 100644 index daf913b1b34..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES deleted file mode 100644 index c90528f4b27..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES +++ /dev/null @@ -1,144 +0,0 @@ -.gitignore -.travis.yml -README.md -api/openapi.yaml -api_another_fake.go -api_default.go -api_fake.go -api_fake_classname_tags123.go -api_pet.go -api_store.go -api_user.go -client.go -configuration.go -docs/AdditionalPropertiesClass.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/ApiResponse.md -docs/Apple.md -docs/AppleReq.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Banana.md -docs/BananaReq.md -docs/Capitalization.md -docs/Cat.md -docs/CatAllOf.md -docs/Category.md -docs/ClassModel.md -docs/Client.md -docs/DefaultApi.md -docs/Dog.md -docs/DogAllOf.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/File.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FormatTest.md -docs/Fruit.md -docs/FruitReq.md -docs/GmFruit.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/InlineObject.md -docs/InlineObject1.md -docs/InlineObject2.md -docs/InlineObject3.md -docs/InlineObject4.md -docs/InlineObject5.md -docs/InlineResponseDefault.md -docs/List.md -docs/Mammal.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md -docs/Name.md -docs/NullableClass.md -docs/NumberOnly.md -docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/Pet.md -docs/PetApi.md -docs/ReadOnlyFirst.md -docs/Return.md -docs/SpecialModelName.md -docs/StoreApi.md -docs/Tag.md -docs/User.md -docs/UserApi.md -docs/Whale.md -docs/Zebra.md -git_push.sh -go.mod -go.sum -model_200_response.go -model__special_model_name_.go -model_additional_properties_class.go -model_animal.go -model_api_response.go -model_apple.go -model_apple_req.go -model_array_of_array_of_number_only.go -model_array_of_number_only.go -model_array_test_.go -model_banana.go -model_banana_req.go -model_capitalization.go -model_cat.go -model_cat_all_of.go -model_category.go -model_class_model.go -model_client.go -model_dog.go -model_dog_all_of.go -model_enum_arrays.go -model_enum_class.go -model_enum_test_.go -model_file.go -model_file_schema_test_class.go -model_foo.go -model_format_test_.go -model_fruit.go -model_fruit_req.go -model_gm_fruit.go -model_has_only_read_only.go -model_health_check_result.go -model_inline_object.go -model_inline_object_1.go -model_inline_object_2.go -model_inline_object_3.go -model_inline_object_4.go -model_inline_object_5.go -model_inline_response_default.go -model_list.go -model_mammal.go -model_map_test_.go -model_mixed_properties_and_additional_properties_class.go -model_name.go -model_nullable_class.go -model_number_only.go -model_order.go -model_outer_composite.go -model_outer_enum.go -model_outer_enum_default_value.go -model_outer_enum_integer.go -model_outer_enum_integer_default_value.go -model_pet.go -model_read_only_first.go -model_return.go -model_tag.go -model_user.go -model_whale.go -model_zebra.go -response.go -signing.go -utils.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml b/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml deleted file mode 100644 index f5cb2ce9a5a..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md deleted file mode 100644 index eccbd883677..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md +++ /dev/null @@ -1,308 +0,0 @@ -# Go API client for petstore - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -``` - -Put the package under your project folder and add the following in import: - -```golang -import sw "./petstore" -``` - -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. - -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags -*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **Get** /foo | -*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **Get** /fake/health | Health check endpoint -*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | -*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | -*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | -*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string | -*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **Put** /fake/body-with-file-schema | -*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **Put** /fake/body-with-query-params | -*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters -*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | -*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case -*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet -*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID -*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user -*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name -*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [Apple](docs/Apple.md) - - [AppleReq](docs/AppleReq.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Banana](docs/Banana.md) - - [BananaReq](docs/BananaReq.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - - [FormatTest](docs/FormatTest.md) - - [Fruit](docs/Fruit.md) - - [FruitReq](docs/FruitReq.md) - - [GmFruit](docs/GmFruit.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [InlineObject](docs/InlineObject.md) - - [InlineObject1](docs/InlineObject1.md) - - [InlineObject2](docs/InlineObject2.md) - - [InlineObject3](docs/InlineObject3.md) - - [InlineObject4](docs/InlineObject4.md) - - [InlineObject5](docs/InlineObject5.md) - - [InlineResponseDefault](docs/InlineResponseDefault.md) - - [List](docs/List.md) - - [Mammal](docs/Mammal.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [User](docs/User.md) - - [Whale](docs/Whale.md) - - [Zebra](docs/Zebra.md) - - -## Documentation For Authorization - - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request. - - -### api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request. - - -### bearer_test - -- **Type**: HTTP Bearer token authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - - -### http_basic_test - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - - -### http_signature_test - -- **Type**: HTTP signature authentication - -Example - -```golang - authConfig := sw.HttpSignatureAuth{ - KeyId: "my-key-id", - PrivateKeyPath: "rsa.pem", - Passphrase: "my-passphrase", - SigningScheme: sw.HttpSigningSchemeHs2019, - SignedHeaders: []string{ - sw.HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. - sw.HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. - "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. - "Date", // The date and time at which the message was originated. - "Content-Type", // The Media type of the body of the request. - "Digest", // A cryptographic digest of the request body. - }, - SigningAlgorithm: sw.HttpSigningAlgorithmRsaPSS, - SignatureMaxValidity: 5 * time.Minute, - } - var authCtx context.Context - var err error - if authCtx, err = authConfig.ContextWithValue(context.Background()); err != nil { - // Process error - } - r, err = client.Service.Operation(auth, args) - -``` - -### petstore_auth - - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") -r, err := client.Service.Operation(auth, args) -``` - -Or via OAuth2 module to automatically refresh tokens and perform user authentication. - -```golang -import "golang.org/x/oauth2" - -/* Perform OAuth2 round trip request and obtain a token */ - -tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) -r, err := client.Service.Operation(auth, args) -``` - - -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: - -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` - -## Author - - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml deleted file mode 100644 index 4bb7abdc392..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ /dev/null @@ -1,2174 +0,0 @@ -openapi: 3.0.0 -info: - description: 'This spec is mainly for testing Petstore server and contains fake - endpoints, models. Please do not use this for any other purpose. Special characters: - " \' - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- description: petstore server - url: http://{server}.swagger.io:{port}/v2 - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: https://localhost:8080/{version} - variables: - version: - default: v2 - enum: - - v1 - - v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_default' - description: response - /pet: - post: - operationId: addPet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "405": - description: Invalid input - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - put: - operationId: updatePet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "400": - description: Invalid ID supplied - "404": - description: Pet not found - "405": - description: Validation exception - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - description: Invalid status value - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - /pet/findByTags: - get: - deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - "400": - description: Invalid tag value - security: - - http_signature_test: [] - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - explode: false - in: header - name: api_key - required: false - schema: - type: string - style: simple - - description: Pet id to delete - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "400": - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - description: Invalid ID supplied - "404": - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object' - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - responses: - "405": - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_1' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - "200": - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - description: Invalid Order - summary: Place an order for a pet - tags: - - store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - explode: false - in: path - name: order_id - required: true - schema: - type: string - style: simple - responses: - "400": - description: Invalid ID supplied - "404": - description: Order not found - summary: Delete purchase order by ID - tags: - - store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - explode: false - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - description: Invalid ID supplied - "404": - description: Order not found - summary: Find purchase order by ID - tags: - - store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - description: successful operation - summary: Create user - tags: - - user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - explode: true - in: query - name: username - required: true - schema: - type: string - style: form - - description: The password for login in clear text - explode: true - in: query - name: password - required: true - schema: - type: string - style: form - responses: - "200": - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - explode: false - schema: - format: int32 - type: integer - style: simple - X-Expires-After: - description: date in UTC when token expires - explode: false - schema: - format: date-time - type: string - style: simple - "400": - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - /user/logout: - get: - operationId: logoutUser - responses: - default: - description: successful operation - summary: Logs out current logged in user session - tags: - - user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - summary: Delete user - tags: - - user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - description: Invalid username supplied - "404": - description: User not found - summary: Get user by user name - tags: - - user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - description: Invalid user supplied - "404": - description: User not found - summary: Updated user - tags: - - user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: - type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: - type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: - type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: - format: int64 - type: integer - style: form - responses: - "400": - description: Someting wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - requestBody: - $ref: '#/components/requestBodies/inline_object_2' - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - responses: - "400": - description: Invalid request - "404": - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - $ref: '#/components/requestBodies/inline_object_3' - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - $ref: '#/components/requestBodies/inline_object_4' - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - responses: - "200": - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline additionalProperties - tags: - - fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - description: Success - tags: - - fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - description: Success - tags: - - fake - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: true - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_5' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - /fake/health: - get: - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/HealthCheckResult' - description: The instance started successfully - summary: Health check endpoint - tags: - - fake -components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - Client: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' - schemas: - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - arbitraryTypeValue: "" - arbitraryNullableTypeValue: "" - phone: phone - id: 0 - arbitraryObject: '{}' - email: email - arbitraryNullableObject: '{}' - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - arbitraryObject: - description: test code generation for objects Value must be a map of strings - to values. It cannot be the 'null' value. - type: object - arbitraryNullableObject: - description: test code generation for nullable objects. Value must be a - map of strings to values or the 'null' value. - nullable: true - type: object - arbitraryTypeValue: - description: test code generation for any type Value can be any type - string, - number, boolean, array or object. - arbitraryNullableTypeValue: - description: test code generation for any type Value can be any type - string, - number, boolean, array, object or the 'null' value. - nullable: true - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Address' - - $ref: '#/components/schemas/Cat_allOf' - Address: - additionalProperties: - type: integer - type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' - outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' - outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - xml: - name: $special[model.name] - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. - example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - NullableClass: - additionalProperties: - nullable: true - type: object - properties: - integer_prop: - nullable: true - type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - fruit: - oneOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - properties: - color: - type: string - apple: - properties: - cultivar: - type: string - type: object - banana: - additionalProperties: true - properties: - lengthCm: - type: number - type: object - mammal: - discriminator: - mapping: - whale: '#/components/schemas/whale' - zebra: '#/components/schemas/zebra' - propertyName: className - oneOf: - - $ref: '#/components/schemas/whale' - - $ref: '#/components/schemas/zebra' - whale: - properties: - hasBaleen: - type: boolean - hasTeeth: - type: boolean - className: - type: string - required: - - className - type: object - zebra: - properties: - type: - enum: - - plains - - mountain - - grevys - type: string - className: - type: string - required: - - className - type: object - gmFruit: - anyOf: - - $ref: '#/components/schemas/apple' - - $ref: '#/components/schemas/banana' - properties: - color: - type: string - fruitReq: - oneOf: - - $ref: '#/components/schemas/appleReq' - - $ref: '#/components/schemas/bananaReq' - appleReq: - properties: - cultivar: - type: string - mealy: - type: boolean - required: - - cultivar - type: object - bananaReq: - properties: - lengthCm: - type: number - sweet: - type: boolean - required: - - lengthCm - type: object - inline_response_default: - example: - string: - bar: bar - properties: - string: - $ref: '#/components/schemas/Foo' - type: object - inline_object: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - inline_object_1: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - inline_object_2: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - inline_object_3: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - inline_object_4: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - inline_object_5: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - type: object - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go deleted file mode 100644 index 519084b8ce6..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ /dev/null @@ -1,153 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -) - -// Linger please -var ( - _ _context.Context -) - -type AnotherFakeApi interface { - - /* - * Call123TestSpecialTags To test special tags - * To test special tags and operation ID starting with number - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCall123TestSpecialTagsRequest - */ - Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest - - /* - * Call123TestSpecialTagsExecute executes the request - * @return Client - */ - Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) -} - -// AnotherFakeApiService AnotherFakeApi service -type AnotherFakeApiService service - -type ApiCall123TestSpecialTagsRequest struct { - ctx _context.Context - ApiService AnotherFakeApi - client *Client -} - -func (r ApiCall123TestSpecialTagsRequest) Client(client Client) ApiCall123TestSpecialTagsRequest { - r.client = &client - return r -} - -func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { - return r.ApiService.Call123TestSpecialTagsExecute(r) -} - -/* - * Call123TestSpecialTags To test special tags - * To test special tags and operation ID starting with number - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCall123TestSpecialTagsRequest - */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { - return ApiCall123TestSpecialTagsRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Client - */ -func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/another-fake/dummy" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.client == nil { - return localVarReturnValue, nil, reportError("client is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.client - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go deleted file mode 100644 index 10bcff6ac1c..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go +++ /dev/null @@ -1,148 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -) - -// Linger please -var ( - _ _context.Context -) - -type DefaultApi interface { - - /* - * FooGet Method for FooGet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFooGetRequest - */ - FooGet(ctx _context.Context) ApiFooGetRequest - - /* - * FooGetExecute executes the request - * @return InlineResponseDefault - */ - FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) -} - -// DefaultApiService DefaultApi service -type DefaultApiService service - -type ApiFooGetRequest struct { - ctx _context.Context - ApiService DefaultApi -} - - -func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) { - return r.ApiService.FooGetExecute(r) -} - -/* - * FooGet Method for FooGet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFooGetRequest - */ -func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest { - return ApiFooGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return InlineResponseDefault - */ -func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue InlineResponseDefault - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/foo" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - var v InlineResponseDefault - 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 - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go deleted file mode 100644 index a54ed2f73ce..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go +++ /dev/null @@ -1,1964 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "os" - "time" - "reflect" -) - -// Linger please -var ( - _ _context.Context -) - -type FakeApi interface { - - /* - * FakeHealthGet Health check endpoint - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeHealthGetRequest - */ - FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest - - /* - * FakeHealthGetExecute executes the request - * @return HealthCheckResult - */ - FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) - - /* - * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * Test serialization of outer boolean types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterBooleanSerializeRequest - */ - FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest - - /* - * FakeOuterBooleanSerializeExecute executes the request - * @return bool - */ - FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) - - /* - * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * Test serialization of object with outer number type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterCompositeSerializeRequest - */ - FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest - - /* - * FakeOuterCompositeSerializeExecute executes the request - * @return OuterComposite - */ - FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) - - /* - * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * Test serialization of outer number types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterNumberSerializeRequest - */ - FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest - - /* - * FakeOuterNumberSerializeExecute executes the request - * @return float32 - */ - FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) - - /* - * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * Test serialization of outer string types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterStringSerializeRequest - */ - FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest - - /* - * FakeOuterStringSerializeExecute executes the request - * @return string - */ - FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) - - /* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * For this test, the body for this request much reference a schema named `File`. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithFileSchemaRequest - */ - TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest - - /* - * TestBodyWithFileSchemaExecute executes the request - */ - TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) - - /* - * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithQueryParamsRequest - */ - TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest - - /* - * TestBodyWithQueryParamsExecute executes the request - */ - TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) - - /* - * TestClientModel To test \"client\" model - * To test "client" model - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClientModelRequest - */ - TestClientModel(ctx _context.Context) ApiTestClientModelRequest - - /* - * TestClientModelExecute executes the request - * @return Client - */ - TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) - - /* - * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트 - - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEndpointParametersRequest - */ - TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest - - /* - * TestEndpointParametersExecute executes the request - */ - TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) - - /* - * TestEnumParameters To test enum parameters - * To test enum parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEnumParametersRequest - */ - TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest - - /* - * TestEnumParametersExecute executes the request - */ - TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) - - /* - * TestGroupParameters Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestGroupParametersRequest - */ - TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest - - /* - * TestGroupParametersExecute executes the request - */ - TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) - - /* - * TestInlineAdditionalProperties test inline additionalProperties - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestInlineAdditionalPropertiesRequest - */ - TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest - - /* - * TestInlineAdditionalPropertiesExecute executes the request - */ - TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) - - /* - * TestJsonFormData test json serialization of form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestJsonFormDataRequest - */ - TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest - - /* - * TestJsonFormDataExecute executes the request - */ - TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) - - /* - * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * To test the collection format in query parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestQueryParameterCollectionFormatRequest - */ - TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest - - /* - * TestQueryParameterCollectionFormatExecute executes the request - */ - TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) -} - -// FakeApiService FakeApi service -type FakeApiService service - -type ApiFakeHealthGetRequest struct { - ctx _context.Context - ApiService FakeApi -} - - -func (r ApiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, error) { - return r.ApiService.FakeHealthGetExecute(r) -} - -/* - * FakeHealthGet Health check endpoint - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeHealthGetRequest - */ -func (a *FakeApiService) FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest { - return ApiFakeHealthGetRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return HealthCheckResult - */ -func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue HealthCheckResult - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/health" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterBooleanSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *bool -} - -func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBooleanSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { - return r.ApiService.FakeOuterBooleanSerializeExecute(r) -} - -/* - * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * Test serialization of outer boolean types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterBooleanSerializeRequest - */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { - return ApiFakeOuterBooleanSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return bool - */ -func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue bool - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/boolean" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterCompositeSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - outerComposite *OuterComposite -} - -func (r ApiFakeOuterCompositeSerializeRequest) OuterComposite(outerComposite OuterComposite) ApiFakeOuterCompositeSerializeRequest { - r.outerComposite = &outerComposite - return r -} - -func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { - return r.ApiService.FakeOuterCompositeSerializeExecute(r) -} - -/* - * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * Test serialization of object with outer number type - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterCompositeSerializeRequest - */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { - return ApiFakeOuterCompositeSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return OuterComposite - */ -func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue OuterComposite - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/composite" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.outerComposite - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterNumberSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *float32 -} - -func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumberSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { - return r.ApiService.FakeOuterNumberSerializeExecute(r) -} - -/* - * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * Test serialization of outer number types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterNumberSerializeRequest - */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { - return ApiFakeOuterNumberSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return float32 - */ -func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue float32 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/number" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFakeOuterStringSerializeRequest struct { - ctx _context.Context - ApiService FakeApi - body *string -} - -func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterStringSerializeRequest { - r.body = &body - return r -} - -func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { - return r.ApiService.FakeOuterStringSerializeExecute(r) -} - -/* - * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * Test serialization of outer string types - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFakeOuterStringSerializeRequest - */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { - return ApiFakeOuterStringSerializeRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return string - */ -func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/outer/string" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"*/*"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiTestBodyWithFileSchemaRequest struct { - ctx _context.Context - ApiService FakeApi - fileSchemaTestClass *FileSchemaTestClass -} - -func (r ApiTestBodyWithFileSchemaRequest) FileSchemaTestClass(fileSchemaTestClass FileSchemaTestClass) ApiTestBodyWithFileSchemaRequest { - r.fileSchemaTestClass = &fileSchemaTestClass - return r -} - -func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestBodyWithFileSchemaExecute(r) -} - -/* - * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * For this test, the body for this request much reference a schema named `File`. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithFileSchemaRequest - */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { - return ApiTestBodyWithFileSchemaRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/body-with-file-schema" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.fileSchemaTestClass == nil { - return nil, reportError("fileSchemaTestClass is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.fileSchemaTestClass - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestBodyWithQueryParamsRequest struct { - ctx _context.Context - ApiService FakeApi - query *string - user *User -} - -func (r ApiTestBodyWithQueryParamsRequest) Query(query string) ApiTestBodyWithQueryParamsRequest { - r.query = &query - return r -} -func (r ApiTestBodyWithQueryParamsRequest) User(user User) ApiTestBodyWithQueryParamsRequest { - r.user = &user - return r -} - -func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestBodyWithQueryParamsExecute(r) -} - -/* - * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestBodyWithQueryParamsRequest - */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { - return ApiTestBodyWithQueryParamsRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/body-with-query-params" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.query == nil { - return nil, reportError("query is required and must be specified") - } - if r.user == nil { - return nil, reportError("user is required and must be specified") - } - - localVarQueryParams.Add("query", parameterToString(*r.query, "")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestClientModelRequest struct { - ctx _context.Context - ApiService FakeApi - client *Client -} - -func (r ApiTestClientModelRequest) Client(client Client) ApiTestClientModelRequest { - r.client = &client - return r -} - -func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { - return r.ApiService.TestClientModelExecute(r) -} - -/* - * TestClientModel To test \"client\" model - * To test "client" model - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClientModelRequest - */ -func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { - return ApiTestClientModelRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Client - */ -func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.client == nil { - return localVarReturnValue, nil, reportError("client is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.client - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiTestEndpointParametersRequest struct { - ctx _context.Context - ApiService FakeApi - number *float32 - double *float64 - patternWithoutDelimiter *string - byte_ *string - integer *int32 - int32_ *int32 - int64_ *int64 - float *float32 - string_ *string - binary **os.File - date *string - dateTime *time.Time - password *string - callback *string -} - -func (r ApiTestEndpointParametersRequest) Number(number float32) ApiTestEndpointParametersRequest { - r.number = &number - return r -} -func (r ApiTestEndpointParametersRequest) Double(double float64) ApiTestEndpointParametersRequest { - r.double = &double - return r -} -func (r ApiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) ApiTestEndpointParametersRequest { - r.patternWithoutDelimiter = &patternWithoutDelimiter - return r -} -func (r ApiTestEndpointParametersRequest) Byte_(byte_ string) ApiTestEndpointParametersRequest { - r.byte_ = &byte_ - return r -} -func (r ApiTestEndpointParametersRequest) Integer(integer int32) ApiTestEndpointParametersRequest { - r.integer = &integer - return r -} -func (r ApiTestEndpointParametersRequest) Int32_(int32_ int32) ApiTestEndpointParametersRequest { - r.int32_ = &int32_ - return r -} -func (r ApiTestEndpointParametersRequest) Int64_(int64_ int64) ApiTestEndpointParametersRequest { - r.int64_ = &int64_ - return r -} -func (r ApiTestEndpointParametersRequest) Float(float float32) ApiTestEndpointParametersRequest { - r.float = &float - return r -} -func (r ApiTestEndpointParametersRequest) String_(string_ string) ApiTestEndpointParametersRequest { - r.string_ = &string_ - return r -} -func (r ApiTestEndpointParametersRequest) Binary(binary *os.File) ApiTestEndpointParametersRequest { - r.binary = &binary - return r -} -func (r ApiTestEndpointParametersRequest) Date(date string) ApiTestEndpointParametersRequest { - r.date = &date - return r -} -func (r ApiTestEndpointParametersRequest) DateTime(dateTime time.Time) ApiTestEndpointParametersRequest { - r.dateTime = &dateTime - return r -} -func (r ApiTestEndpointParametersRequest) Password(password string) ApiTestEndpointParametersRequest { - r.password = &password - return r -} -func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpointParametersRequest { - r.callback = &callback - return r -} - -func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestEndpointParametersExecute(r) -} - -/* - * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트 - - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEndpointParametersRequest - */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { - return ApiTestEndpointParametersRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.number == nil { - return nil, reportError("number is required and must be specified") - } - if *r.number < 32.1 { - return nil, reportError("number must be greater than 32.1") - } - if *r.number > 543.2 { - return nil, reportError("number must be less than 543.2") - } - if r.double == nil { - return nil, reportError("double is required and must be specified") - } - if *r.double < 67.8 { - return nil, reportError("double must be greater than 67.8") - } - if *r.double > 123.4 { - return nil, reportError("double must be less than 123.4") - } - if r.patternWithoutDelimiter == nil { - return nil, reportError("patternWithoutDelimiter is required and must be specified") - } - if r.byte_ == nil { - return nil, reportError("byte_ is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.integer != nil { - localVarFormParams.Add("integer", parameterToString(*r.integer, "")) - } - if r.int32_ != nil { - localVarFormParams.Add("int32", parameterToString(*r.int32_, "")) - } - if r.int64_ != nil { - localVarFormParams.Add("int64", parameterToString(*r.int64_, "")) - } - localVarFormParams.Add("number", parameterToString(*r.number, "")) - if r.float != nil { - localVarFormParams.Add("float", parameterToString(*r.float, "")) - } - localVarFormParams.Add("double", parameterToString(*r.double, "")) - if r.string_ != nil { - localVarFormParams.Add("string", parameterToString(*r.string_, "")) - } - localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, "")) - localVarFormParams.Add("byte", parameterToString(*r.byte_, "")) - localVarFormFileName = "binary" - var localVarFile *os.File - if r.binary != nil { - localVarFile = *r.binary - } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - if r.date != nil { - localVarFormParams.Add("date", parameterToString(*r.date, "")) - } - if r.dateTime != nil { - localVarFormParams.Add("dateTime", parameterToString(*r.dateTime, "")) - } - if r.password != nil { - localVarFormParams.Add("password", parameterToString(*r.password, "")) - } - if r.callback != nil { - localVarFormParams.Add("callback", parameterToString(*r.callback, "")) - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestEnumParametersRequest struct { - ctx _context.Context - ApiService FakeApi - enumHeaderStringArray *[]string - enumHeaderString *string - enumQueryStringArray *[]string - enumQueryString *string - enumQueryInteger *int32 - enumQueryDouble *float64 - enumFormStringArray *[]string - enumFormString *string -} - -func (r ApiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArray []string) ApiTestEnumParametersRequest { - r.enumHeaderStringArray = &enumHeaderStringArray - return r -} -func (r ApiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) ApiTestEnumParametersRequest { - r.enumHeaderString = &enumHeaderString - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) ApiTestEnumParametersRequest { - r.enumQueryStringArray = &enumQueryStringArray - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryString(enumQueryString string) ApiTestEnumParametersRequest { - r.enumQueryString = &enumQueryString - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) ApiTestEnumParametersRequest { - r.enumQueryInteger = &enumQueryInteger - return r -} -func (r ApiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) ApiTestEnumParametersRequest { - r.enumQueryDouble = &enumQueryDouble - return r -} -func (r ApiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) ApiTestEnumParametersRequest { - r.enumFormStringArray = &enumFormStringArray - return r -} -func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiTestEnumParametersRequest { - r.enumFormString = &enumFormString - return r -} - -func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestEnumParametersExecute(r) -} - -/* - * TestEnumParameters To test enum parameters - * To test enum parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestEnumParametersRequest - */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { - return ApiTestEnumParametersRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if r.enumQueryStringArray != nil { - t := *r.enumQueryStringArray - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("enum_query_string_array", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("enum_query_string_array", parameterToString(t, "multi")) - } - } - if r.enumQueryString != nil { - localVarQueryParams.Add("enum_query_string", parameterToString(*r.enumQueryString, "")) - } - if r.enumQueryInteger != nil { - localVarQueryParams.Add("enum_query_integer", parameterToString(*r.enumQueryInteger, "")) - } - if r.enumQueryDouble != nil { - localVarQueryParams.Add("enum_query_double", parameterToString(*r.enumQueryDouble, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.enumHeaderStringArray != nil { - localVarHeaderParams["enum_header_string_array"] = parameterToString(*r.enumHeaderStringArray, "csv") - } - if r.enumHeaderString != nil { - localVarHeaderParams["enum_header_string"] = parameterToString(*r.enumHeaderString, "") - } - if r.enumFormStringArray != nil { - localVarFormParams.Add("enum_form_string_array", parameterToString(*r.enumFormStringArray, "csv")) - } - if r.enumFormString != nil { - localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, "")) - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestGroupParametersRequest struct { - ctx _context.Context - ApiService FakeApi - requiredStringGroup *int32 - requiredBooleanGroup *bool - requiredInt64Group *int64 - stringGroup *int32 - booleanGroup *bool - int64Group *int64 -} - -func (r ApiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup int32) ApiTestGroupParametersRequest { - r.requiredStringGroup = &requiredStringGroup - return r -} -func (r ApiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) ApiTestGroupParametersRequest { - r.requiredBooleanGroup = &requiredBooleanGroup - return r -} -func (r ApiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) ApiTestGroupParametersRequest { - r.requiredInt64Group = &requiredInt64Group - return r -} -func (r ApiTestGroupParametersRequest) StringGroup(stringGroup int32) ApiTestGroupParametersRequest { - r.stringGroup = &stringGroup - return r -} -func (r ApiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) ApiTestGroupParametersRequest { - r.booleanGroup = &booleanGroup - return r -} -func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroupParametersRequest { - r.int64Group = &int64Group - return r -} - -func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestGroupParametersExecute(r) -} - -/* - * TestGroupParameters Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestGroupParametersRequest - */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { - return ApiTestGroupParametersRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.requiredStringGroup == nil { - return nil, reportError("requiredStringGroup is required and must be specified") - } - if r.requiredBooleanGroup == nil { - return nil, reportError("requiredBooleanGroup is required and must be specified") - } - if r.requiredInt64Group == nil { - return nil, reportError("requiredInt64Group is required and must be specified") - } - - localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) - localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, "")) - if r.stringGroup != nil { - localVarQueryParams.Add("string_group", parameterToString(*r.stringGroup, "")) - } - if r.int64Group != nil { - localVarQueryParams.Add("int64_group", parameterToString(*r.int64Group, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - localVarHeaderParams["required_boolean_group"] = parameterToString(*r.requiredBooleanGroup, "") - if r.booleanGroup != nil { - localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "") - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestInlineAdditionalPropertiesRequest struct { - ctx _context.Context - ApiService FakeApi - requestBody *map[string]string -} - -func (r ApiTestInlineAdditionalPropertiesRequest) RequestBody(requestBody map[string]string) ApiTestInlineAdditionalPropertiesRequest { - r.requestBody = &requestBody - return r -} - -func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestInlineAdditionalPropertiesExecute(r) -} - -/* - * TestInlineAdditionalProperties test inline additionalProperties - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestInlineAdditionalPropertiesRequest - */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { - return ApiTestInlineAdditionalPropertiesRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/inline-additionalProperties" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.requestBody == nil { - return nil, reportError("requestBody is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.requestBody - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestJsonFormDataRequest struct { - ctx _context.Context - ApiService FakeApi - param *string - param2 *string -} - -func (r ApiTestJsonFormDataRequest) Param(param string) ApiTestJsonFormDataRequest { - r.param = ¶m - return r -} -func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataRequest { - r.param2 = ¶m2 - return r -} - -func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestJsonFormDataExecute(r) -} - -/* - * TestJsonFormData test json serialization of form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestJsonFormDataRequest - */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { - return ApiTestJsonFormDataRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/jsonFormData" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.param == nil { - return nil, reportError("param is required and must be specified") - } - if r.param2 == nil { - return nil, reportError("param2 is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - localVarFormParams.Add("param", parameterToString(*r.param, "")) - localVarFormParams.Add("param2", parameterToString(*r.param2, "")) - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiTestQueryParameterCollectionFormatRequest struct { - ctx _context.Context - ApiService FakeApi - pipe *[]string - ioutil *[]string - http *[]string - url *[]string - context *[]string -} - -func (r ApiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) ApiTestQueryParameterCollectionFormatRequest { - r.pipe = &pipe - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) ApiTestQueryParameterCollectionFormatRequest { - r.ioutil = &ioutil - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Http(http []string) ApiTestQueryParameterCollectionFormatRequest { - r.http = &http - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Url(url []string) ApiTestQueryParameterCollectionFormatRequest { - r.url = &url - return r -} -func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) ApiTestQueryParameterCollectionFormatRequest { - r.context = &context - return r -} - -func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.TestQueryParameterCollectionFormatExecute(r) -} - -/* - * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * To test the collection format in query parameters - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestQueryParameterCollectionFormatRequest - */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { - return ApiTestQueryParameterCollectionFormatRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/test-query-paramters" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.pipe == nil { - return nil, reportError("pipe is required and must be specified") - } - if r.ioutil == nil { - return nil, reportError("ioutil is required and must be specified") - } - if r.http == nil { - return nil, reportError("http is required and must be specified") - } - if r.url == nil { - return nil, reportError("url is required and must be specified") - } - if r.context == nil { - return nil, reportError("context is required and must be specified") - } - - { - t := *r.pipe - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("pipe", parameterToString(t, "multi")) - } - } - localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(*r.http, "ssv")) - localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) - { - t := *r.context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) - } - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go deleted file mode 100644 index f3aba54e388..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ /dev/null @@ -1,167 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" -) - -// Linger please -var ( - _ _context.Context -) - -type FakeClassnameTags123Api interface { - - /* - * TestClassname To test class name in snake case - * To test class name in snake case - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClassnameRequest - */ - TestClassname(ctx _context.Context) ApiTestClassnameRequest - - /* - * TestClassnameExecute executes the request - * @return Client - */ - TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) -} - -// FakeClassnameTags123ApiService FakeClassnameTags123Api service -type FakeClassnameTags123ApiService service - -type ApiTestClassnameRequest struct { - ctx _context.Context - ApiService FakeClassnameTags123Api - client *Client -} - -func (r ApiTestClassnameRequest) Client(client Client) ApiTestClassnameRequest { - r.client = &client - return r -} - -func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { - return r.ApiService.TestClassnameExecute(r) -} - -/* - * TestClassname To test class name in snake case - * To test class name in snake case - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiTestClassnameRequest - */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { - return ApiTestClassnameRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Client - */ -func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Client - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake_classname_test" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.client == nil { - return localVarReturnValue, nil, reportError("client is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.client - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["api_key_query"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarQueryParams.Add("api_key_query", key) - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go deleted file mode 100644 index 092e48cda08..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go +++ /dev/null @@ -1,1154 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" - "os" -) - -// Linger please -var ( - _ _context.Context -) - -type PetApi interface { - - /* - * AddPet Add a new pet to the store - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiAddPetRequest - */ - AddPet(ctx _context.Context) ApiAddPetRequest - - /* - * AddPetExecute executes the request - */ - AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) - - /* - * DeletePet Deletes a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId Pet id to delete - * @return ApiDeletePetRequest - */ - DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest - - /* - * DeletePetExecute executes the request - */ - DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) - - /* - * FindPetsByStatus Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByStatusRequest - */ - FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest - - /* - * FindPetsByStatusExecute executes the request - * @return []Pet - */ - FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) - - /* - * FindPetsByTags Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByTagsRequest - */ - FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest - - /* - * FindPetsByTagsExecute executes the request - * @return []Pet - */ - FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) - - /* - * GetPetById Find pet by ID - * Returns a single pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to return - * @return ApiGetPetByIdRequest - */ - GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest - - /* - * GetPetByIdExecute executes the request - * @return Pet - */ - GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) - - /* - * UpdatePet Update an existing pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiUpdatePetRequest - */ - UpdatePet(ctx _context.Context) ApiUpdatePetRequest - - /* - * UpdatePetExecute executes the request - */ - UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) - - /* - * UpdatePetWithForm Updates a pet in the store with form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet that needs to be updated - * @return ApiUpdatePetWithFormRequest - */ - UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest - - /* - * UpdatePetWithFormExecute executes the request - */ - UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) - - /* - * UploadFile uploads an image - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileRequest - */ - UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest - - /* - * UploadFileExecute executes the request - * @return ApiResponse - */ - UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) - - /* - * UploadFileWithRequiredFile uploads an image (required) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileWithRequiredFileRequest - */ - UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest - - /* - * UploadFileWithRequiredFileExecute executes the request - * @return ApiResponse - */ - UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) -} - -// PetApiService PetApi service -type PetApiService service - -type ApiAddPetRequest struct { - ctx _context.Context - ApiService PetApi - pet *Pet -} - -func (r ApiAddPetRequest) Pet(pet Pet) ApiAddPetRequest { - r.pet = &pet - return r -} - -func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.AddPetExecute(r) -} - -/* - * AddPet Add a new pet to the store - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiAddPetRequest - */ -func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { - return ApiAddPetRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.pet == nil { - return nil, reportError("pet is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.pet - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeletePetRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - apiKey *string -} - -func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { - r.apiKey = &apiKey - return r -} - -func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.DeletePetExecute(r) -} - -/* - * DeletePet Deletes a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId Pet id to delete - * @return ApiDeletePetRequest - */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { - return ApiDeletePetRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.apiKey != nil { - localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "") - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiFindPetsByStatusRequest struct { - ctx _context.Context - ApiService PetApi - status *[]string -} - -func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusRequest { - r.status = &status - return r -} - -func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { - return r.ApiService.FindPetsByStatusExecute(r) -} - -/* - * FindPetsByStatus Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByStatusRequest - */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { - return ApiFindPetsByStatusRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return []Pet - */ -func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Pet - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/findByStatus" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.status == nil { - return localVarReturnValue, nil, reportError("status is required and must be specified") - } - - localVarQueryParams.Add("status", parameterToString(*r.status, "csv")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiFindPetsByTagsRequest struct { - ctx _context.Context - ApiService PetApi - tags *[]string -} - -func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { - r.tags = &tags - return r -} - -func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { - return r.ApiService.FindPetsByTagsExecute(r) -} - -/* - * FindPetsByTags Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiFindPetsByTagsRequest - */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { - return ApiFindPetsByTagsRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return []Pet - */ -func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue []Pet - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/findByTags" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.tags == nil { - return localVarReturnValue, nil, reportError("tags is required and must be specified") - } - - localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiGetPetByIdRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 -} - - -func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { - return r.ApiService.GetPetByIdExecute(r) -} - -/* - * GetPetById Find pet by ID - * Returns a single pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to return - * @return ApiGetPetByIdRequest - */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { - return ApiGetPetByIdRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - * @return Pet - */ -func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Pet - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["api_key"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["api_key"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUpdatePetRequest struct { - ctx _context.Context - ApiService PetApi - pet *Pet -} - -func (r ApiUpdatePetRequest) Pet(pet Pet) ApiUpdatePetRequest { - r.pet = &pet - return r -} - -func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.UpdatePetExecute(r) -} - -/* - * UpdatePet Update an existing pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiUpdatePetRequest - */ -func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { - return ApiUpdatePetRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.pet == nil { - return nil, reportError("pet is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.pet - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiUpdatePetWithFormRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - name *string - status *string -} - -func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormRequest { - r.name = &name - return r -} -func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest { - r.status = &status - return r -} - -func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.UpdatePetWithFormExecute(r) -} - -/* - * UpdatePetWithForm Updates a pet in the store with form data - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet that needs to be updated - * @return ApiUpdatePetWithFormRequest - */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { - return ApiUpdatePetWithFormRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - */ -func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.name != nil { - localVarFormParams.Add("name", parameterToString(*r.name, "")) - } - if r.status != nil { - localVarFormParams.Add("status", parameterToString(*r.status, "")) - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiUploadFileRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - additionalMetadata *string - file **os.File -} - -func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileRequest { - r.additionalMetadata = &additionalMetadata - return r -} -func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { - r.file = &file - return r -} - -func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { - return r.ApiService.UploadFileExecute(r) -} - -/* - * UploadFile uploads an image - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileRequest - */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { - return ApiUploadFileRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - * @return ApiResponse - */ -func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApiResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.additionalMetadata != nil { - localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) - } - localVarFormFileName = "file" - var localVarFile *os.File - if r.file != nil { - localVarFile = *r.file - } - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiUploadFileWithRequiredFileRequest struct { - ctx _context.Context - ApiService PetApi - petId int64 - requiredFile **os.File - additionalMetadata *string -} - -func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) ApiUploadFileWithRequiredFileRequest { - r.requiredFile = &requiredFile - return r -} -func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest { - r.additionalMetadata = &additionalMetadata - return r -} - -func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { - return r.ApiService.UploadFileWithRequiredFileExecute(r) -} - -/* - * UploadFileWithRequiredFile uploads an image (required) - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param petId ID of pet to update - * @return ApiUploadFileWithRequiredFileRequest - */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { - return ApiUploadFileWithRequiredFileRequest{ - ApiService: a, - ctx: ctx, - petId: petId, - } -} - -/* - * Execute executes the request - * @return ApiResponse - */ -func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ApiResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.requiredFile == nil { - return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.additionalMetadata != nil { - localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) - } - localVarFormFileName = "requiredFile" - localVarFile := *r.requiredFile - if localVarFile != nil { - fbs, _ := _ioutil.ReadAll(localVarFile) - localVarFileBytes = fbs - localVarFileName = localVarFile.Name() - localVarFile.Close() - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go deleted file mode 100644 index 021b6ca7dcb..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go +++ /dev/null @@ -1,515 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -type StoreApi interface { - - /* - * DeleteOrder Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of the order that needs to be deleted - * @return ApiDeleteOrderRequest - */ - DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest - - /* - * DeleteOrderExecute executes the request - */ - DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) - - /* - * GetInventory Returns pet inventories by status - * Returns a map of status codes to quantities - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetInventoryRequest - */ - GetInventory(ctx _context.Context) ApiGetInventoryRequest - - /* - * GetInventoryExecute executes the request - * @return map[string]int32 - */ - GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) - - /* - * GetOrderById Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of pet that needs to be fetched - * @return ApiGetOrderByIdRequest - */ - GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest - - /* - * GetOrderByIdExecute executes the request - * @return Order - */ - GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) - - /* - * PlaceOrder Place an order for a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPlaceOrderRequest - */ - PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest - - /* - * PlaceOrderExecute executes the request - * @return Order - */ - PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) -} - -// StoreApiService StoreApi service -type StoreApiService service - -type ApiDeleteOrderRequest struct { - ctx _context.Context - ApiService StoreApi - orderId string -} - - -func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.DeleteOrderExecute(r) -} - -/* - * DeleteOrder Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of the order that needs to be deleted - * @return ApiDeleteOrderRequest - */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { - return ApiDeleteOrderRequest{ - ApiService: a, - ctx: ctx, - orderId: orderId, - } -} - -/* - * Execute executes the request - */ -func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiGetInventoryRequest struct { - ctx _context.Context - ApiService StoreApi -} - - -func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { - return r.ApiService.GetInventoryExecute(r) -} - -/* - * GetInventory Returns pet inventories by status - * Returns a map of status codes to quantities - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiGetInventoryRequest - */ -func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { - return ApiGetInventoryRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return map[string]int32 - */ -func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue map[string]int32 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/inventory" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["api_key"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["api_key"] = key - } - } - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiGetOrderByIdRequest struct { - ctx _context.Context - ApiService StoreApi - orderId int64 -} - - -func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { - return r.ApiService.GetOrderByIdExecute(r) -} - -/* - * GetOrderById Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param orderId ID of pet that needs to be fetched - * @return ApiGetOrderByIdRequest - */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { - return ApiGetOrderByIdRequest{ - ApiService: a, - ctx: ctx, - orderId: orderId, - } -} - -/* - * Execute executes the request - * @return Order - */ -func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Order - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.orderId < 1 { - return localVarReturnValue, nil, reportError("orderId must be greater than 1") - } - if r.orderId > 5 { - return localVarReturnValue, nil, reportError("orderId must be less than 5") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiPlaceOrderRequest struct { - ctx _context.Context - ApiService StoreApi - order *Order -} - -func (r ApiPlaceOrderRequest) Order(order Order) ApiPlaceOrderRequest { - r.order = &order - return r -} - -func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { - return r.ApiService.PlaceOrderExecute(r) -} - -/* - * PlaceOrder Place an order for a pet - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiPlaceOrderRequest - */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { - return ApiPlaceOrderRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return Order - */ -func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Order - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/store/order" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.order == nil { - return localVarReturnValue, nil, reportError("order is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.order - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go deleted file mode 100644 index 4a6a8a991ec..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go +++ /dev/null @@ -1,940 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) - -// Linger please -var ( - _ _context.Context -) - -type UserApi interface { - - /* - * CreateUser Create user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUserRequest - */ - CreateUser(ctx _context.Context) ApiCreateUserRequest - - /* - * CreateUserExecute executes the request - */ - CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) - - /* - * CreateUsersWithArrayInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithArrayInputRequest - */ - CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest - - /* - * CreateUsersWithArrayInputExecute executes the request - */ - CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) - - /* - * CreateUsersWithListInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithListInputRequest - */ - CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest - - /* - * CreateUsersWithListInputExecute executes the request - */ - CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) - - /* - * DeleteUser Delete user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be deleted - * @return ApiDeleteUserRequest - */ - DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest - - /* - * DeleteUserExecute executes the request - */ - DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) - - /* - * GetUserByName Get user by user name - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiGetUserByNameRequest - */ - GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest - - /* - * GetUserByNameExecute executes the request - * @return User - */ - GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) - - /* - * LoginUser Logs user into the system - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLoginUserRequest - */ - LoginUser(ctx _context.Context) ApiLoginUserRequest - - /* - * LoginUserExecute executes the request - * @return string - */ - LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) - - /* - * LogoutUser Logs out current logged in user session - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLogoutUserRequest - */ - LogoutUser(ctx _context.Context) ApiLogoutUserRequest - - /* - * LogoutUserExecute executes the request - */ - LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) - - /* - * UpdateUser Updated user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username name that need to be deleted - * @return ApiUpdateUserRequest - */ - UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest - - /* - * UpdateUserExecute executes the request - */ - UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) -} - -// UserApiService UserApi service -type UserApiService service - -type ApiCreateUserRequest struct { - ctx _context.Context - ApiService UserApi - user *User -} - -func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest { - r.user = &user - return r -} - -func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateUserExecute(r) -} - -/* - * CreateUser Create user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUserRequest - */ -func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { - return ApiCreateUserRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.user == nil { - return nil, reportError("user is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiCreateUsersWithArrayInputRequest struct { - ctx _context.Context - ApiService UserApi - user *[]User -} - -func (r ApiCreateUsersWithArrayInputRequest) User(user []User) ApiCreateUsersWithArrayInputRequest { - r.user = &user - return r -} - -func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateUsersWithArrayInputExecute(r) -} - -/* - * CreateUsersWithArrayInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithArrayInputRequest - */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { - return ApiCreateUsersWithArrayInputRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/createWithArray" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.user == nil { - return nil, reportError("user is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiCreateUsersWithListInputRequest struct { - ctx _context.Context - ApiService UserApi - user *[]User -} - -func (r ApiCreateUsersWithListInputRequest) User(user []User) ApiCreateUsersWithListInputRequest { - r.user = &user - return r -} - -func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.CreateUsersWithListInputExecute(r) -} - -/* - * CreateUsersWithListInput Creates list of users with given input array - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiCreateUsersWithListInputRequest - */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { - return ApiCreateUsersWithListInputRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/createWithList" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.user == nil { - return nil, reportError("user is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteUserRequest struct { - ctx _context.Context - ApiService UserApi - username string -} - - -func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.DeleteUserExecute(r) -} - -/* - * DeleteUser Delete user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be deleted - * @return ApiDeleteUserRequest - */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { - return ApiDeleteUserRequest{ - ApiService: a, - ctx: ctx, - username: username, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiGetUserByNameRequest struct { - ctx _context.Context - ApiService UserApi - username string -} - - -func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { - return r.ApiService.GetUserByNameExecute(r) -} - -/* - * GetUserByName Get user by user name - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiGetUserByNameRequest - */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { - return ApiGetUserByNameRequest{ - ApiService: a, - ctx: ctx, - username: username, - } -} - -/* - * Execute executes the request - * @return User - */ -func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiLoginUserRequest struct { - ctx _context.Context - ApiService UserApi - username *string - password *string -} - -func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest { - r.username = &username - return r -} -func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { - r.password = &password - return r -} - -func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { - return r.ApiService.LoginUserExecute(r) -} - -/* - * LoginUser Logs user into the system - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLoginUserRequest - */ -func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { - return ApiLoginUserRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return string - */ -func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue string - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/login" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.username == nil { - return localVarReturnValue, nil, reportError("username is required and must be specified") - } - if r.password == nil { - return localVarReturnValue, nil, reportError("password is required and must be specified") - } - - localVarQueryParams.Add("username", parameterToString(*r.username, "")) - localVarQueryParams.Add("password", parameterToString(*r.password, "")) - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - 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 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ApiLogoutUserRequest struct { - ctx _context.Context - ApiService UserApi -} - - -func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.LogoutUserExecute(r) -} - -/* - * LogoutUser Logs out current logged in user session - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ApiLogoutUserRequest - */ -func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { - return ApiLogoutUserRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/logout" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiUpdateUserRequest struct { - ctx _context.Context - ApiService UserApi - username string - user *User -} - -func (r ApiUpdateUserRequest) User(user User) ApiUpdateUserRequest { - r.user = &user - return r -} - -func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { - return r.ApiService.UpdateUserExecute(r) -} - -/* - * UpdateUser Updated user - * This can only be done by the logged in user. - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username name that need to be deleted - * @return ApiUpdateUserRequest - */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { - return ApiUpdateUserRequest{ - ApiService: a, - ctx: ctx, - username: username, - } -} - -/* - * Execute executes the request - */ -func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") - if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.user == nil { - return nil, reportError("user is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go deleted file mode 100644 index a0833f77d79..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go +++ /dev/null @@ -1,561 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "golang.org/x/oauth2" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) -) - -// APIClient manages communication with the OpenAPI Petstore API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - AnotherFakeApi AnotherFakeApi - - DefaultApi DefaultApi - - FakeApi FakeApi - - FakeClassnameTags123Api FakeClassnameTags123Api - - PetApi PetApi - - StoreApi StoreApi - - UserApi UserApi -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) - c.DefaultApi = (*DefaultApiService)(&c.common) - c.FakeApi = (*FakeApiService)(&c.common) - c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) - c.PetApi = (*PetApiService)(&c.common) - c.StoreApi = (*StoreApiService)(&c.common) - c.UserApi = (*UserApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) - } - - return fmt.Sprintf("%v", obj) -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - if ctx != nil { - // HTTP Signature Authentication. All request headers must be set (including default headers) - // because the headers may be included in the signature. - if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { - err = SignRequest(ctx, localVarRequest, auth) - if err != nil { - return nil, err - } - } - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err!= nil { - return err - } - } else { - errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go deleted file mode 100644 index ddcea71eaf9..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go +++ /dev/null @@ -1,282 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: ServerConfigurations{ - { - URL: "http://{server}.swagger.io:{port}/v2", - Description: "petstore server", - Variables: map[string]ServerVariable{ - "server": ServerVariable{ - Description: "No description provided", - DefaultValue: "petstore", - EnumValues: []string{ - "petstore", - "qa-petstore", - "dev-petstore", - }, - }, - "port": ServerVariable{ - Description: "No description provided", - DefaultValue: "80", - EnumValues: []string{ - "80", - "8080", - }, - }, - }, - }, - { - URL: "https://localhost:8080/{version}", - Description: "The local server", - Variables: map[string]ServerVariable{ - "version": ServerVariable{ - Description: "No description provided", - DefaultValue: "v2", - EnumValues: []string{ - "v1", - "v2", - }, - }, - }, - }, - }, - OperationServers: map[string]ServerConfigurations{ - "PetApiService.AddPet": { - { - URL: "http://petstore.swagger.io/v2", - Description: "No description provided", - }, - { - URL: "http://path-server-test.petstore.local/v2", - Description: "No description provided", - }, - }, - "PetApiService.UpdatePet": { - { - URL: "http://petstore.swagger.io/v2", - Description: "No description provided", - }, - { - URL: "http://path-server-test.petstore.local/v2", - Description: "No description provided", - }, - }, - }, - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 19719e709f8..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,82 +0,0 @@ -# AdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MapProperty** | Pointer to **map[string]string** | | [optional] -**MapOfMapProperty** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] - -## Methods - -### NewAdditionalPropertiesClass - -`func NewAdditionalPropertiesClass() *AdditionalPropertiesClass` - -NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAdditionalPropertiesClassWithDefaults - -`func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass` - -NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMapProperty - -`func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string` - -GetMapProperty returns the MapProperty field if non-nil, zero value otherwise. - -### GetMapPropertyOk - -`func (o *AdditionalPropertiesClass) GetMapPropertyOk() (*map[string]string, bool)` - -GetMapPropertyOk returns a tuple with the MapProperty field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapProperty - -`func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string)` - -SetMapProperty sets MapProperty field to given value. - -### HasMapProperty - -`func (o *AdditionalPropertiesClass) HasMapProperty() bool` - -HasMapProperty returns a boolean if a field has been set. - -### GetMapOfMapProperty - -`func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string` - -GetMapOfMapProperty returns the MapOfMapProperty field if non-nil, zero value otherwise. - -### GetMapOfMapPropertyOk - -`func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (*map[string]map[string]string, bool)` - -GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapOfMapProperty - -`func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string)` - -SetMapOfMapProperty sets MapOfMapProperty field to given value. - -### HasMapOfMapProperty - -`func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool` - -HasMapOfMapProperty returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md deleted file mode 100644 index 293f75c5171..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md +++ /dev/null @@ -1,77 +0,0 @@ -# Animal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | Pointer to **string** | | [optional] [default to "red"] - -## Methods - -### NewAnimal - -`func NewAnimal(className string, ) *Animal` - -NewAnimal instantiates a new Animal object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewAnimalWithDefaults - -`func NewAnimalWithDefaults() *Animal` - -NewAnimalWithDefaults instantiates a new Animal object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetClassName - -`func (o *Animal) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *Animal) GetClassNameOk() (*string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClassName - -`func (o *Animal) SetClassName(v string)` - -SetClassName sets ClassName field to given value. - - -### GetColor - -`func (o *Animal) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *Animal) GetColorOk() (*string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetColor - -`func (o *Animal) SetColor(v string)` - -SetColor sets Color field to given value. - -### HasColor - -`func (o *Animal) HasColor() bool` - -HasColor returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md deleted file mode 100644 index 2c63feecd21..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md +++ /dev/null @@ -1,75 +0,0 @@ -# \AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**Call123TestSpecialTags**](AnotherFakeApi.md#Call123TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags - - - -## Call123TestSpecialTags - -> Client Call123TestSpecialTags(ctx).Client(client).Execute() - -To test special tags - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - client := openapiclient.Client{Client: "Client_example"} // Client | client model - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background(), client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `Call123TestSpecialTags`: Client - fmt.Fprintf(os.Stdout, "Response from `AnotherFakeApi.Call123TestSpecialTags`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCall123TestSpecialTagsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md deleted file mode 100644 index 877dacb4293..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md +++ /dev/null @@ -1,108 +0,0 @@ -# ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | Pointer to **int32** | | [optional] -**Type** | Pointer to **string** | | [optional] -**Message** | Pointer to **string** | | [optional] - -## Methods - -### NewApiResponse - -`func NewApiResponse() *ApiResponse` - -NewApiResponse instantiates a new ApiResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewApiResponseWithDefaults - -`func NewApiResponseWithDefaults() *ApiResponse` - -NewApiResponseWithDefaults instantiates a new ApiResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCode - -`func (o *ApiResponse) GetCode() int32` - -GetCode returns the Code field if non-nil, zero value otherwise. - -### GetCodeOk - -`func (o *ApiResponse) GetCodeOk() (*int32, bool)` - -GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCode - -`func (o *ApiResponse) SetCode(v int32)` - -SetCode sets Code field to given value. - -### HasCode - -`func (o *ApiResponse) HasCode() bool` - -HasCode returns a boolean if a field has been set. - -### GetType - -`func (o *ApiResponse) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ApiResponse) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ApiResponse) SetType(v string)` - -SetType sets Type field to given value. - -### HasType - -`func (o *ApiResponse) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetMessage - -`func (o *ApiResponse) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ApiResponse) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ApiResponse) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *ApiResponse) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index cb46da598b1..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,56 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] - -## Methods - -### NewArrayOfArrayOfNumberOnly - -`func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly` - -NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArrayOfArrayOfNumberOnlyWithDefaults - -`func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly` - -NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetArrayArrayNumber - -`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32` - -GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. - -### GetArrayArrayNumberOk - -`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool)` - -GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayArrayNumber - -`func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32)` - -SetArrayArrayNumber sets ArrayArrayNumber field to given value. - -### HasArrayArrayNumber - -`func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool` - -HasArrayArrayNumber returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f0aaaa443b3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,56 +0,0 @@ -# ArrayOfNumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayNumber** | Pointer to **[]float32** | | [optional] - -## Methods - -### NewArrayOfNumberOnly - -`func NewArrayOfNumberOnly() *ArrayOfNumberOnly` - -NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArrayOfNumberOnlyWithDefaults - -`func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly` - -NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetArrayNumber - -`func (o *ArrayOfNumberOnly) GetArrayNumber() []float32` - -GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. - -### GetArrayNumberOk - -`func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool)` - -GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayNumber - -`func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32)` - -SetArrayNumber sets ArrayNumber field to given value. - -### HasArrayNumber - -`func (o *ArrayOfNumberOnly) HasArrayNumber() bool` - -HasArrayNumber returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md deleted file mode 100644 index a0f8d7528c3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md +++ /dev/null @@ -1,108 +0,0 @@ -# ArrayTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ArrayOfString** | Pointer to **[]string** | | [optional] -**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] - -## Methods - -### NewArrayTest - -`func NewArrayTest() *ArrayTest` - -NewArrayTest instantiates a new ArrayTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewArrayTestWithDefaults - -`func NewArrayTestWithDefaults() *ArrayTest` - -NewArrayTestWithDefaults instantiates a new ArrayTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetArrayOfString - -`func (o *ArrayTest) GetArrayOfString() []string` - -GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. - -### GetArrayOfStringOk - -`func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool)` - -GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayOfString - -`func (o *ArrayTest) SetArrayOfString(v []string)` - -SetArrayOfString sets ArrayOfString field to given value. - -### HasArrayOfString - -`func (o *ArrayTest) HasArrayOfString() bool` - -HasArrayOfString returns a boolean if a field has been set. - -### GetArrayArrayOfInteger - -`func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64` - -GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. - -### GetArrayArrayOfIntegerOk - -`func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool)` - -GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayArrayOfInteger - -`func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64)` - -SetArrayArrayOfInteger sets ArrayArrayOfInteger field to given value. - -### HasArrayArrayOfInteger - -`func (o *ArrayTest) HasArrayArrayOfInteger() bool` - -HasArrayArrayOfInteger returns a boolean if a field has been set. - -### GetArrayArrayOfModel - -`func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst` - -GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. - -### GetArrayArrayOfModelOk - -`func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool)` - -GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayArrayOfModel - -`func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst)` - -SetArrayArrayOfModel sets ArrayArrayOfModel field to given value. - -### HasArrayArrayOfModel - -`func (o *ArrayTest) HasArrayArrayOfModel() bool` - -HasArrayArrayOfModel returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md deleted file mode 100644 index 3f37bb13e00..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md +++ /dev/null @@ -1,186 +0,0 @@ -# Capitalization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SmallCamel** | Pointer to **string** | | [optional] -**CapitalCamel** | Pointer to **string** | | [optional] -**SmallSnake** | Pointer to **string** | | [optional] -**CapitalSnake** | Pointer to **string** | | [optional] -**SCAETHFlowPoints** | Pointer to **string** | | [optional] -**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] - -## Methods - -### NewCapitalization - -`func NewCapitalization() *Capitalization` - -NewCapitalization instantiates a new Capitalization object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCapitalizationWithDefaults - -`func NewCapitalizationWithDefaults() *Capitalization` - -NewCapitalizationWithDefaults instantiates a new Capitalization object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSmallCamel - -`func (o *Capitalization) GetSmallCamel() string` - -GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. - -### GetSmallCamelOk - -`func (o *Capitalization) GetSmallCamelOk() (*string, bool)` - -GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSmallCamel - -`func (o *Capitalization) SetSmallCamel(v string)` - -SetSmallCamel sets SmallCamel field to given value. - -### HasSmallCamel - -`func (o *Capitalization) HasSmallCamel() bool` - -HasSmallCamel returns a boolean if a field has been set. - -### GetCapitalCamel - -`func (o *Capitalization) GetCapitalCamel() string` - -GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. - -### GetCapitalCamelOk - -`func (o *Capitalization) GetCapitalCamelOk() (*string, bool)` - -GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCapitalCamel - -`func (o *Capitalization) SetCapitalCamel(v string)` - -SetCapitalCamel sets CapitalCamel field to given value. - -### HasCapitalCamel - -`func (o *Capitalization) HasCapitalCamel() bool` - -HasCapitalCamel returns a boolean if a field has been set. - -### GetSmallSnake - -`func (o *Capitalization) GetSmallSnake() string` - -GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. - -### GetSmallSnakeOk - -`func (o *Capitalization) GetSmallSnakeOk() (*string, bool)` - -GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSmallSnake - -`func (o *Capitalization) SetSmallSnake(v string)` - -SetSmallSnake sets SmallSnake field to given value. - -### HasSmallSnake - -`func (o *Capitalization) HasSmallSnake() bool` - -HasSmallSnake returns a boolean if a field has been set. - -### GetCapitalSnake - -`func (o *Capitalization) GetCapitalSnake() string` - -GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. - -### GetCapitalSnakeOk - -`func (o *Capitalization) GetCapitalSnakeOk() (*string, bool)` - -GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCapitalSnake - -`func (o *Capitalization) SetCapitalSnake(v string)` - -SetCapitalSnake sets CapitalSnake field to given value. - -### HasCapitalSnake - -`func (o *Capitalization) HasCapitalSnake() bool` - -HasCapitalSnake returns a boolean if a field has been set. - -### GetSCAETHFlowPoints - -`func (o *Capitalization) GetSCAETHFlowPoints() string` - -GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. - -### GetSCAETHFlowPointsOk - -`func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool)` - -GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSCAETHFlowPoints - -`func (o *Capitalization) SetSCAETHFlowPoints(v string)` - -SetSCAETHFlowPoints sets SCAETHFlowPoints field to given value. - -### HasSCAETHFlowPoints - -`func (o *Capitalization) HasSCAETHFlowPoints() bool` - -HasSCAETHFlowPoints returns a boolean if a field has been set. - -### GetATT_NAME - -`func (o *Capitalization) GetATT_NAME() string` - -GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. - -### GetATT_NAMEOk - -`func (o *Capitalization) GetATT_NAMEOk() (*string, bool)` - -GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetATT_NAME - -`func (o *Capitalization) SetATT_NAME(v string)` - -SetATT_NAME sets ATT_NAME field to given value. - -### HasATT_NAME - -`func (o *Capitalization) HasATT_NAME() bool` - -HasATT_NAME returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md deleted file mode 100644 index 9f7f4f783cb..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md +++ /dev/null @@ -1,56 +0,0 @@ -# Cat - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Declawed** | Pointer to **bool** | | [optional] - -## Methods - -### NewCat - -`func NewCat() *Cat` - -NewCat instantiates a new Cat object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCatWithDefaults - -`func NewCatWithDefaults() *Cat` - -NewCatWithDefaults instantiates a new Cat object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDeclawed - -`func (o *Cat) GetDeclawed() bool` - -GetDeclawed returns the Declawed field if non-nil, zero value otherwise. - -### GetDeclawedOk - -`func (o *Cat) GetDeclawedOk() (*bool, bool)` - -GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeclawed - -`func (o *Cat) SetDeclawed(v bool)` - -SetDeclawed sets Declawed field to given value. - -### HasDeclawed - -`func (o *Cat) HasDeclawed() bool` - -HasDeclawed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md deleted file mode 100644 index be0cc6c8519..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md +++ /dev/null @@ -1,56 +0,0 @@ -# CatAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Declawed** | Pointer to **bool** | | [optional] - -## Methods - -### NewCatAllOf - -`func NewCatAllOf() *CatAllOf` - -NewCatAllOf instantiates a new CatAllOf object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCatAllOfWithDefaults - -`func NewCatAllOfWithDefaults() *CatAllOf` - -NewCatAllOfWithDefaults instantiates a new CatAllOf object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetDeclawed - -`func (o *CatAllOf) GetDeclawed() bool` - -GetDeclawed returns the Declawed field if non-nil, zero value otherwise. - -### GetDeclawedOk - -`func (o *CatAllOf) GetDeclawedOk() (*bool, bool)` - -GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDeclawed - -`func (o *CatAllOf) SetDeclawed(v bool)` - -SetDeclawed sets Declawed field to given value. - -### HasDeclawed - -`func (o *CatAllOf) HasDeclawed() bool` - -HasDeclawed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md deleted file mode 100644 index 0d3f6d4ff22..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md +++ /dev/null @@ -1,77 +0,0 @@ -# Category - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | **string** | | [default to "default-name"] - -## Methods - -### NewCategory - -`func NewCategory(name string, ) *Category` - -NewCategory instantiates a new Category object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewCategoryWithDefaults - -`func NewCategoryWithDefaults() *Category` - -NewCategoryWithDefaults instantiates a new Category object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Category) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Category) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Category) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Category) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *Category) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Category) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Category) SetName(v string)` - -SetName sets Name field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md deleted file mode 100644 index 51954107bc0..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md +++ /dev/null @@ -1,56 +0,0 @@ -# ClassModel - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Class** | Pointer to **string** | | [optional] - -## Methods - -### NewClassModel - -`func NewClassModel() *ClassModel` - -NewClassModel instantiates a new ClassModel object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewClassModelWithDefaults - -`func NewClassModelWithDefaults() *ClassModel` - -NewClassModelWithDefaults instantiates a new ClassModel object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetClass - -`func (o *ClassModel) GetClass() string` - -GetClass returns the Class field if non-nil, zero value otherwise. - -### GetClassOk - -`func (o *ClassModel) GetClassOk() (*string, bool)` - -GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClass - -`func (o *ClassModel) SetClass(v string)` - -SetClass sets Class field to given value. - -### HasClass - -`func (o *ClassModel) HasClass() bool` - -HasClass returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md deleted file mode 100644 index e24e7c05be5..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md +++ /dev/null @@ -1,56 +0,0 @@ -# Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Client** | Pointer to **string** | | [optional] - -## Methods - -### NewClient - -`func NewClient() *Client` - -NewClient instantiates a new Client object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewClientWithDefaults - -`func NewClientWithDefaults() *Client` - -NewClientWithDefaults instantiates a new Client object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetClient - -`func (o *Client) GetClient() string` - -GetClient returns the Client field if non-nil, zero value otherwise. - -### GetClientOk - -`func (o *Client) GetClientOk() (*string, bool)` - -GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClient - -`func (o *Client) SetClient(v string)` - -SetClient sets Client field to given value. - -### HasClient - -`func (o *Client) HasClient() bool` - -HasClient returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md deleted file mode 100644 index 7a138d8df4a..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md +++ /dev/null @@ -1,68 +0,0 @@ -# \DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**FooGet**](DefaultApi.md#FooGet) | **Get** /foo | - - - -## FooGet - -> InlineResponseDefault FooGet(ctx).Execute() - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DefaultApi.FooGet(context.Background(), ).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FooGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FooGet`: InlineResponseDefault - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FooGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiFooGetRequest struct via the builder pattern - - -### Return type - -[**InlineResponseDefault**](inline_response_default.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md deleted file mode 100644 index edf746aaf55..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md +++ /dev/null @@ -1,56 +0,0 @@ -# Dog - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Breed** | Pointer to **string** | | [optional] - -## Methods - -### NewDog - -`func NewDog() *Dog` - -NewDog instantiates a new Dog object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDogWithDefaults - -`func NewDogWithDefaults() *Dog` - -NewDogWithDefaults instantiates a new Dog object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBreed - -`func (o *Dog) GetBreed() string` - -GetBreed returns the Breed field if non-nil, zero value otherwise. - -### GetBreedOk - -`func (o *Dog) GetBreedOk() (*string, bool)` - -GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBreed - -`func (o *Dog) SetBreed(v string)` - -SetBreed sets Breed field to given value. - -### HasBreed - -`func (o *Dog) HasBreed() bool` - -HasBreed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md deleted file mode 100644 index 3ed4dfa5ea2..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md +++ /dev/null @@ -1,56 +0,0 @@ -# DogAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Breed** | Pointer to **string** | | [optional] - -## Methods - -### NewDogAllOf - -`func NewDogAllOf() *DogAllOf` - -NewDogAllOf instantiates a new DogAllOf object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewDogAllOfWithDefaults - -`func NewDogAllOfWithDefaults() *DogAllOf` - -NewDogAllOfWithDefaults instantiates a new DogAllOf object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBreed - -`func (o *DogAllOf) GetBreed() string` - -GetBreed returns the Breed field if non-nil, zero value otherwise. - -### GetBreedOk - -`func (o *DogAllOf) GetBreedOk() (*string, bool)` - -GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBreed - -`func (o *DogAllOf) SetBreed(v string)` - -SetBreed sets Breed field to given value. - -### HasBreed - -`func (o *DogAllOf) HasBreed() bool` - -HasBreed returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md deleted file mode 100644 index 28011e23f56..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md +++ /dev/null @@ -1,82 +0,0 @@ -# EnumArrays - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JustSymbol** | Pointer to **string** | | [optional] -**ArrayEnum** | Pointer to **[]string** | | [optional] - -## Methods - -### NewEnumArrays - -`func NewEnumArrays() *EnumArrays` - -NewEnumArrays instantiates a new EnumArrays object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnumArraysWithDefaults - -`func NewEnumArraysWithDefaults() *EnumArrays` - -NewEnumArraysWithDefaults instantiates a new EnumArrays object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetJustSymbol - -`func (o *EnumArrays) GetJustSymbol() string` - -GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. - -### GetJustSymbolOk - -`func (o *EnumArrays) GetJustSymbolOk() (*string, bool)` - -GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetJustSymbol - -`func (o *EnumArrays) SetJustSymbol(v string)` - -SetJustSymbol sets JustSymbol field to given value. - -### HasJustSymbol - -`func (o *EnumArrays) HasJustSymbol() bool` - -HasJustSymbol returns a boolean if a field has been set. - -### GetArrayEnum - -`func (o *EnumArrays) GetArrayEnum() []string` - -GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. - -### GetArrayEnumOk - -`func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool)` - -GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayEnum - -`func (o *EnumArrays) SetArrayEnum(v []string)` - -SetArrayEnum sets ArrayEnum field to given value. - -### HasArrayEnum - -`func (o *EnumArrays) HasArrayEnum() bool` - -HasArrayEnum returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md deleted file mode 100644 index e231f94bd73..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md deleted file mode 100644 index a1761a7cd72..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md +++ /dev/null @@ -1,243 +0,0 @@ -# EnumTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EnumString** | Pointer to **string** | | [optional] -**EnumStringRequired** | **string** | | -**EnumInteger** | Pointer to **int32** | | [optional] -**EnumNumber** | Pointer to **float64** | | [optional] -**OuterEnum** | Pointer to [**NullableOuterEnum**](OuterEnum.md) | | [optional] -**OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to "placed"] -**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OUTERENUMINTEGERDEFAULTVALUE__0] - -## Methods - -### NewEnumTest - -`func NewEnumTest(enumStringRequired string, ) *EnumTest` - -NewEnumTest instantiates a new EnumTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewEnumTestWithDefaults - -`func NewEnumTestWithDefaults() *EnumTest` - -NewEnumTestWithDefaults instantiates a new EnumTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEnumString - -`func (o *EnumTest) GetEnumString() string` - -GetEnumString returns the EnumString field if non-nil, zero value otherwise. - -### GetEnumStringOk - -`func (o *EnumTest) GetEnumStringOk() (*string, bool)` - -GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumString - -`func (o *EnumTest) SetEnumString(v string)` - -SetEnumString sets EnumString field to given value. - -### HasEnumString - -`func (o *EnumTest) HasEnumString() bool` - -HasEnumString returns a boolean if a field has been set. - -### GetEnumStringRequired - -`func (o *EnumTest) GetEnumStringRequired() string` - -GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. - -### GetEnumStringRequiredOk - -`func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool)` - -GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumStringRequired - -`func (o *EnumTest) SetEnumStringRequired(v string)` - -SetEnumStringRequired sets EnumStringRequired field to given value. - - -### GetEnumInteger - -`func (o *EnumTest) GetEnumInteger() int32` - -GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. - -### GetEnumIntegerOk - -`func (o *EnumTest) GetEnumIntegerOk() (*int32, bool)` - -GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumInteger - -`func (o *EnumTest) SetEnumInteger(v int32)` - -SetEnumInteger sets EnumInteger field to given value. - -### HasEnumInteger - -`func (o *EnumTest) HasEnumInteger() bool` - -HasEnumInteger returns a boolean if a field has been set. - -### GetEnumNumber - -`func (o *EnumTest) GetEnumNumber() float64` - -GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. - -### GetEnumNumberOk - -`func (o *EnumTest) GetEnumNumberOk() (*float64, bool)` - -GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumNumber - -`func (o *EnumTest) SetEnumNumber(v float64)` - -SetEnumNumber sets EnumNumber field to given value. - -### HasEnumNumber - -`func (o *EnumTest) HasEnumNumber() bool` - -HasEnumNumber returns a boolean if a field has been set. - -### GetOuterEnum - -`func (o *EnumTest) GetOuterEnum() OuterEnum` - -GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. - -### GetOuterEnumOk - -`func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool)` - -GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOuterEnum - -`func (o *EnumTest) SetOuterEnum(v OuterEnum)` - -SetOuterEnum sets OuterEnum field to given value. - -### HasOuterEnum - -`func (o *EnumTest) HasOuterEnum() bool` - -HasOuterEnum returns a boolean if a field has been set. - -### SetOuterEnumNil - -`func (o *EnumTest) SetOuterEnumNil(b bool)` - - SetOuterEnumNil sets the value for OuterEnum to be an explicit nil - -### UnsetOuterEnum -`func (o *EnumTest) UnsetOuterEnum()` - -UnsetOuterEnum ensures that no value is present for OuterEnum, not even an explicit nil -### GetOuterEnumInteger - -`func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger` - -GetOuterEnumInteger returns the OuterEnumInteger field if non-nil, zero value otherwise. - -### GetOuterEnumIntegerOk - -`func (o *EnumTest) GetOuterEnumIntegerOk() (*OuterEnumInteger, bool)` - -GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOuterEnumInteger - -`func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger)` - -SetOuterEnumInteger sets OuterEnumInteger field to given value. - -### HasOuterEnumInteger - -`func (o *EnumTest) HasOuterEnumInteger() bool` - -HasOuterEnumInteger returns a boolean if a field has been set. - -### GetOuterEnumDefaultValue - -`func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue` - -GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field if non-nil, zero value otherwise. - -### GetOuterEnumDefaultValueOk - -`func (o *EnumTest) GetOuterEnumDefaultValueOk() (*OuterEnumDefaultValue, bool)` - -GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOuterEnumDefaultValue - -`func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue)` - -SetOuterEnumDefaultValue sets OuterEnumDefaultValue field to given value. - -### HasOuterEnumDefaultValue - -`func (o *EnumTest) HasOuterEnumDefaultValue() bool` - -HasOuterEnumDefaultValue returns a boolean if a field has been set. - -### GetOuterEnumIntegerDefaultValue - -`func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue` - -GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field if non-nil, zero value otherwise. - -### GetOuterEnumIntegerDefaultValueOk - -`func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (*OuterEnumIntegerDefaultValue, bool)` - -GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOuterEnumIntegerDefaultValue - -`func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue)` - -SetOuterEnumIntegerDefaultValue sets OuterEnumIntegerDefaultValue field to given value. - -### HasOuterEnumIntegerDefaultValue - -`func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool` - -HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md deleted file mode 100644 index 6924101be1e..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md +++ /dev/null @@ -1,979 +0,0 @@ -# \FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**FakeHealthGet**](FakeApi.md#FakeHealthGet) | **Get** /fake/health | Health check endpoint -[**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | -[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | -[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | -[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string | -[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema | -[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params | -[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters -[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) -[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties -[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data -[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | - - - -## FakeHealthGet - -> HealthCheckResult FakeHealthGet(ctx).Execute() - -Health check endpoint - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeHealthGet(context.Background(), ).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeHealthGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeHealthGet`: HealthCheckResult - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeHealthGet`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeHealthGetRequest struct via the builder pattern - - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterBooleanSerialize - -> bool FakeOuterBooleanSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := true // bool | Input boolean as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterBooleanSerialize`: bool - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterBooleanSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterBooleanSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool** | Input boolean as post body | - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterCompositeSerialize - -> OuterComposite FakeOuterCompositeSerialize(ctx).OuterComposite(outerComposite).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - outerComposite := openapiclient.OuterComposite{MyNumber: 123, MyString: "MyString_example", MyBoolean: false} // OuterComposite | Input composite as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background(), ).OuterComposite(outerComposite).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterCompositeSerialize`: OuterComposite - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterCompositeSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterCompositeSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterNumberSerialize - -> float32 FakeOuterNumberSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := 987 // float32 | Input number as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterNumberSerialize`: float32 - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterNumberSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterNumberSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float32** | Input number as post body | - -### Return type - -**float32** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FakeOuterStringSerialize - -> string FakeOuterStringSerialize(ctx).Body(body).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := "body_example" // string | Input string as post body (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background(), ).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterStringSerialize`: string - fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterStringSerialize`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFakeOuterStringSerializeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **string** | Input string as post body | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestBodyWithFileSchema - -> TestBodyWithFileSchema(ctx).FileSchemaTestClass(fileSchemaTestClass).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - fileSchemaTestClass := openapiclient.FileSchemaTestClass{File: openapiclient.File{SourceURI: "SourceURI_example"}, Files: []File{openapiclient.File{SourceURI: "SourceURI_example"})} // FileSchemaTestClass | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background(), fileSchemaTestClass).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestBodyWithFileSchemaRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestBodyWithQueryParams - -> TestBodyWithQueryParams(ctx).Query(query).User(user).Execute() - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - query := "query_example" // string | - user := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123, ArbitraryObject: 123, ArbitraryNullableObject: 123, ArbitraryTypeValue: 123, ArbitraryNullableTypeValue: 123} // User | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background(), query, user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestBodyWithQueryParamsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **string** | | - **user** | [**User**](User.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestClientModel - -> Client TestClientModel(ctx).Client(client).Execute() - -To test \"client\" model - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - client := openapiclient.Client{Client: "Client_example"} // Client | client model - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestClientModel(context.Background(), client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClientModel`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeApi.TestClientModel`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestClientModelRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestEndpointParameters - -> TestEndpointParameters(ctx).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - number := 987 // float32 | None - double := 987 // float64 | None - patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None - byte_ := 987 // string | None - integer := 987 // int32 | None (optional) - int32_ := 987 // int32 | None (optional) - int64_ := 987 // int64 | None (optional) - float := 987 // float32 | None (optional) - string_ := "string__example" // string | None (optional) - binary := 987 // *os.File | None (optional) - date := Get-Date // string | None (optional) - dateTime := Get-Date // time.Time | None (optional) - password := "password_example" // string | None (optional) - callback := "callback_example" // string | None (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background(), number, double, patternWithoutDelimiter, byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestEndpointParametersRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float32** | None | - **double** | **float64** | None | - **patternWithoutDelimiter** | **string** | None | - **byte_** | **string** | None | - **integer** | **int32** | None | - **int32_** | **int32** | None | - **int64_** | **int64** | None | - **float** | **float32** | None | - **string_** | **string** | None | - **binary** | ***os.File** | None | - **date** | **string** | None | - **dateTime** | **time.Time** | None | - **password** | **string** | None | - **callback** | **string** | None | - -### Return type - - (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestEnumParameters - -> TestEnumParameters(ctx).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - -To test enum parameters - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) - enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") - enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) - enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") - enumQueryInteger := 987 // int32 | Query parameter enum test (double) (optional) - enumQueryDouble := 987 // float64 | Query parameter enum test (double) (optional) - enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") - enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background(), ).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestEnumParametersRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[]string**](string.md) | Header parameter enum test (string array) | - **enumHeaderString** | **string** | Header parameter enum test (string) | [default to "-efg"] - **enumQueryStringArray** | [**[]string**](string.md) | Query parameter enum test (string array) | - **enumQueryString** | **string** | Query parameter enum test (string) | [default to "-efg"] - **enumQueryInteger** | **int32** | Query parameter enum test (double) | - **enumQueryDouble** | **float64** | Query parameter enum test (double) | - **enumFormStringArray** | [**[]string**](string.md) | Form parameter enum test (string array) | [default to "$"] - **enumFormString** | **string** | Form parameter enum test (string) | [default to "-efg"] - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestGroupParameters - -> TestGroupParameters(ctx).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - -Fake endpoint to test group parameters (optional) - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - requiredStringGroup := 987 // int32 | Required String in group parameters - requiredBooleanGroup := true // bool | Required Boolean in group parameters - requiredInt64Group := 987 // int64 | Required Integer in group parameters - stringGroup := 987 // int32 | String in group parameters (optional) - booleanGroup := true // bool | Boolean in group parameters (optional) - int64Group := 987 // int64 | Integer in group parameters (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background(), requiredStringGroup, requiredBooleanGroup, requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestGroupParametersRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int32** | Required String in group parameters | - **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | - **requiredInt64Group** | **int64** | Required Integer in group parameters | - **stringGroup** | **int32** | String in group parameters | - **booleanGroup** | **bool** | Boolean in group parameters | - **int64Group** | **int64** | Integer in group parameters | - -### Return type - - (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestInlineAdditionalProperties - -> TestInlineAdditionalProperties(ctx).RequestBody(requestBody).Execute() - -test inline additionalProperties - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - requestBody := map[string]string{ "Key" = "Value" } // map[string]string | request body - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background(), requestBody).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestInlineAdditionalPropertiesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**map[string]string**](string.md) | request body | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestJsonFormData - -> TestJsonFormData(ctx).Param(param).Param2(param2).Execute() - -test json serialization of form data - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - param := "param_example" // string | field1 - param2 := "param2_example" // string | field2 - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background(), param, param2).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestJsonFormDataRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **string** | field1 | - **param2** | **string** | field2 | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## TestQueryParameterCollectionFormat - -> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() - - - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pipe := []string{"Inner_example"} // []string | - ioutil := []string{"Inner_example"} // []string | - http := []string{"Inner_example"} // []string | - url := []string{"Inner_example"} // []string | - context := []string{"Inner_example"} // []string | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background(), pipe, ioutil, http, url, context).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestQueryParameterCollectionFormatRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**[]string**](string.md) | | - **ioutil** | [**[]string**](string.md) | | - **http** | [**[]string**](string.md) | | - **url** | [**[]string**](string.md) | | - **context** | [**[]string**](string.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md deleted file mode 100644 index 1898cc7411b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,75 +0,0 @@ -# \FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**TestClassname**](FakeClassnameTags123Api.md#TestClassname) | **Patch** /fake_classname_test | To test class name in snake case - - - -## TestClassname - -> Client TestClassname(ctx).Client(client).Execute() - -To test class name in snake case - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - client := openapiclient.Client{Client: "Client_example"} // Client | client model - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background(), client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClassname`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123Api.TestClassname`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiTestClassnameRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md deleted file mode 100644 index 91fe90e06f1..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md +++ /dev/null @@ -1,56 +0,0 @@ -# File - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SourceURI** | Pointer to **string** | Test capitalization | [optional] - -## Methods - -### NewFile - -`func NewFile() *File` - -NewFile instantiates a new File object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFileWithDefaults - -`func NewFileWithDefaults() *File` - -NewFileWithDefaults instantiates a new File object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSourceURI - -`func (o *File) GetSourceURI() string` - -GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. - -### GetSourceURIOk - -`func (o *File) GetSourceURIOk() (*string, bool)` - -GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceURI - -`func (o *File) SetSourceURI(v string)` - -SetSourceURI sets SourceURI field to given value. - -### HasSourceURI - -`func (o *File) HasSourceURI() bool` - -HasSourceURI returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md deleted file mode 100644 index 2db8eb31902..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,82 +0,0 @@ -# FileSchemaTestClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**File** | Pointer to [**File**](File.md) | | [optional] -**Files** | Pointer to [**[]File**](File.md) | | [optional] - -## Methods - -### NewFileSchemaTestClass - -`func NewFileSchemaTestClass() *FileSchemaTestClass` - -NewFileSchemaTestClass instantiates a new FileSchemaTestClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFileSchemaTestClassWithDefaults - -`func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass` - -NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetFile - -`func (o *FileSchemaTestClass) GetFile() File` - -GetFile returns the File field if non-nil, zero value otherwise. - -### GetFileOk - -`func (o *FileSchemaTestClass) GetFileOk() (*File, bool)` - -GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFile - -`func (o *FileSchemaTestClass) SetFile(v File)` - -SetFile sets File field to given value. - -### HasFile - -`func (o *FileSchemaTestClass) HasFile() bool` - -HasFile returns a boolean if a field has been set. - -### GetFiles - -`func (o *FileSchemaTestClass) GetFiles() []File` - -GetFiles returns the Files field if non-nil, zero value otherwise. - -### GetFilesOk - -`func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool)` - -GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFiles - -`func (o *FileSchemaTestClass) SetFiles(v []File)` - -SetFiles sets Files field to given value. - -### HasFiles - -`func (o *FileSchemaTestClass) HasFiles() bool` - -HasFiles returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md deleted file mode 100644 index 7f1593a87f4..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md +++ /dev/null @@ -1,56 +0,0 @@ -# Foo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] [default to "bar"] - -## Methods - -### NewFoo - -`func NewFoo() *Foo` - -NewFoo instantiates a new Foo object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFooWithDefaults - -`func NewFooWithDefaults() *Foo` - -NewFooWithDefaults instantiates a new Foo object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBar - -`func (o *Foo) GetBar() string` - -GetBar returns the Bar field if non-nil, zero value otherwise. - -### GetBarOk - -`func (o *Foo) GetBarOk() (*string, bool)` - -GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBar - -`func (o *Foo) SetBar(v string)` - -SetBar sets Bar field to given value. - -### HasBar - -`func (o *Foo) HasBar() bool` - -HasBar returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md deleted file mode 100644 index f94ef3040f2..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md +++ /dev/null @@ -1,400 +0,0 @@ -# FormatTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Integer** | Pointer to **int32** | | [optional] -**Int32** | Pointer to **int32** | | [optional] -**Int64** | Pointer to **int64** | | [optional] -**Number** | **float32** | | -**Float** | Pointer to **float32** | | [optional] -**Double** | Pointer to **float64** | | [optional] -**String** | Pointer to **string** | | [optional] -**Byte** | **string** | | -**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] -**Date** | **string** | | -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Uuid** | Pointer to **string** | | [optional] -**Password** | **string** | | -**PatternWithDigits** | Pointer to **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**PatternWithDigitsAndDelimiter** | Pointer to **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -## Methods - -### NewFormatTest - -`func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest` - -NewFormatTest instantiates a new FormatTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewFormatTestWithDefaults - -`func NewFormatTestWithDefaults() *FormatTest` - -NewFormatTestWithDefaults instantiates a new FormatTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInteger - -`func (o *FormatTest) GetInteger() int32` - -GetInteger returns the Integer field if non-nil, zero value otherwise. - -### GetIntegerOk - -`func (o *FormatTest) GetIntegerOk() (*int32, bool)` - -GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInteger - -`func (o *FormatTest) SetInteger(v int32)` - -SetInteger sets Integer field to given value. - -### HasInteger - -`func (o *FormatTest) HasInteger() bool` - -HasInteger returns a boolean if a field has been set. - -### GetInt32 - -`func (o *FormatTest) GetInt32() int32` - -GetInt32 returns the Int32 field if non-nil, zero value otherwise. - -### GetInt32Ok - -`func (o *FormatTest) GetInt32Ok() (*int32, bool)` - -GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInt32 - -`func (o *FormatTest) SetInt32(v int32)` - -SetInt32 sets Int32 field to given value. - -### HasInt32 - -`func (o *FormatTest) HasInt32() bool` - -HasInt32 returns a boolean if a field has been set. - -### GetInt64 - -`func (o *FormatTest) GetInt64() int64` - -GetInt64 returns the Int64 field if non-nil, zero value otherwise. - -### GetInt64Ok - -`func (o *FormatTest) GetInt64Ok() (*int64, bool)` - -GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInt64 - -`func (o *FormatTest) SetInt64(v int64)` - -SetInt64 sets Int64 field to given value. - -### HasInt64 - -`func (o *FormatTest) HasInt64() bool` - -HasInt64 returns a boolean if a field has been set. - -### GetNumber - -`func (o *FormatTest) GetNumber() float32` - -GetNumber returns the Number field if non-nil, zero value otherwise. - -### GetNumberOk - -`func (o *FormatTest) GetNumberOk() (*float32, bool)` - -GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumber - -`func (o *FormatTest) SetNumber(v float32)` - -SetNumber sets Number field to given value. - - -### GetFloat - -`func (o *FormatTest) GetFloat() float32` - -GetFloat returns the Float field if non-nil, zero value otherwise. - -### GetFloatOk - -`func (o *FormatTest) GetFloatOk() (*float32, bool)` - -GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFloat - -`func (o *FormatTest) SetFloat(v float32)` - -SetFloat sets Float field to given value. - -### HasFloat - -`func (o *FormatTest) HasFloat() bool` - -HasFloat returns a boolean if a field has been set. - -### GetDouble - -`func (o *FormatTest) GetDouble() float64` - -GetDouble returns the Double field if non-nil, zero value otherwise. - -### GetDoubleOk - -`func (o *FormatTest) GetDoubleOk() (*float64, bool)` - -GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDouble - -`func (o *FormatTest) SetDouble(v float64)` - -SetDouble sets Double field to given value. - -### HasDouble - -`func (o *FormatTest) HasDouble() bool` - -HasDouble returns a boolean if a field has been set. - -### GetString - -`func (o *FormatTest) GetString() string` - -GetString returns the String field if non-nil, zero value otherwise. - -### GetStringOk - -`func (o *FormatTest) GetStringOk() (*string, bool)` - -GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetString - -`func (o *FormatTest) SetString(v string)` - -SetString sets String field to given value. - -### HasString - -`func (o *FormatTest) HasString() bool` - -HasString returns a boolean if a field has been set. - -### GetByte - -`func (o *FormatTest) GetByte() string` - -GetByte returns the Byte field if non-nil, zero value otherwise. - -### GetByteOk - -`func (o *FormatTest) GetByteOk() (*string, bool)` - -GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetByte - -`func (o *FormatTest) SetByte(v string)` - -SetByte sets Byte field to given value. - - -### GetBinary - -`func (o *FormatTest) GetBinary() *os.File` - -GetBinary returns the Binary field if non-nil, zero value otherwise. - -### GetBinaryOk - -`func (o *FormatTest) GetBinaryOk() (**os.File, bool)` - -GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBinary - -`func (o *FormatTest) SetBinary(v *os.File)` - -SetBinary sets Binary field to given value. - -### HasBinary - -`func (o *FormatTest) HasBinary() bool` - -HasBinary returns a boolean if a field has been set. - -### GetDate - -`func (o *FormatTest) GetDate() string` - -GetDate returns the Date field if non-nil, zero value otherwise. - -### GetDateOk - -`func (o *FormatTest) GetDateOk() (*string, bool)` - -GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDate - -`func (o *FormatTest) SetDate(v string)` - -SetDate sets Date field to given value. - - -### GetDateTime - -`func (o *FormatTest) GetDateTime() time.Time` - -GetDateTime returns the DateTime field if non-nil, zero value otherwise. - -### GetDateTimeOk - -`func (o *FormatTest) GetDateTimeOk() (*time.Time, bool)` - -GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDateTime - -`func (o *FormatTest) SetDateTime(v time.Time)` - -SetDateTime sets DateTime field to given value. - -### HasDateTime - -`func (o *FormatTest) HasDateTime() bool` - -HasDateTime returns a boolean if a field has been set. - -### GetUuid - -`func (o *FormatTest) GetUuid() string` - -GetUuid returns the Uuid field if non-nil, zero value otherwise. - -### GetUuidOk - -`func (o *FormatTest) GetUuidOk() (*string, bool)` - -GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUuid - -`func (o *FormatTest) SetUuid(v string)` - -SetUuid sets Uuid field to given value. - -### HasUuid - -`func (o *FormatTest) HasUuid() bool` - -HasUuid returns a boolean if a field has been set. - -### GetPassword - -`func (o *FormatTest) GetPassword() string` - -GetPassword returns the Password field if non-nil, zero value otherwise. - -### GetPasswordOk - -`func (o *FormatTest) GetPasswordOk() (*string, bool)` - -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPassword - -`func (o *FormatTest) SetPassword(v string)` - -SetPassword sets Password field to given value. - - -### GetPatternWithDigits - -`func (o *FormatTest) GetPatternWithDigits() string` - -GetPatternWithDigits returns the PatternWithDigits field if non-nil, zero value otherwise. - -### GetPatternWithDigitsOk - -`func (o *FormatTest) GetPatternWithDigitsOk() (*string, bool)` - -GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPatternWithDigits - -`func (o *FormatTest) SetPatternWithDigits(v string)` - -SetPatternWithDigits sets PatternWithDigits field to given value. - -### HasPatternWithDigits - -`func (o *FormatTest) HasPatternWithDigits() bool` - -HasPatternWithDigits returns a boolean if a field has been set. - -### GetPatternWithDigitsAndDelimiter - -`func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string` - -GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field if non-nil, zero value otherwise. - -### GetPatternWithDigitsAndDelimiterOk - -`func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (*string, bool)` - -GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPatternWithDigitsAndDelimiter - -`func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string)` - -SetPatternWithDigitsAndDelimiter sets PatternWithDigitsAndDelimiter field to given value. - -### HasPatternWithDigitsAndDelimiter - -`func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool` - -HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md deleted file mode 100644 index 7f54d772840..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,82 +0,0 @@ -# HasOnlyReadOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] [readonly] -**Foo** | Pointer to **string** | | [optional] [readonly] - -## Methods - -### NewHasOnlyReadOnly - -`func NewHasOnlyReadOnly() *HasOnlyReadOnly` - -NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHasOnlyReadOnlyWithDefaults - -`func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly` - -NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBar - -`func (o *HasOnlyReadOnly) GetBar() string` - -GetBar returns the Bar field if non-nil, zero value otherwise. - -### GetBarOk - -`func (o *HasOnlyReadOnly) GetBarOk() (*string, bool)` - -GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBar - -`func (o *HasOnlyReadOnly) SetBar(v string)` - -SetBar sets Bar field to given value. - -### HasBar - -`func (o *HasOnlyReadOnly) HasBar() bool` - -HasBar returns a boolean if a field has been set. - -### GetFoo - -`func (o *HasOnlyReadOnly) GetFoo() string` - -GetFoo returns the Foo field if non-nil, zero value otherwise. - -### GetFooOk - -`func (o *HasOnlyReadOnly) GetFooOk() (*string, bool)` - -GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFoo - -`func (o *HasOnlyReadOnly) SetFoo(v string)` - -SetFoo sets Foo field to given value. - -### HasFoo - -`func (o *HasOnlyReadOnly) HasFoo() bool` - -HasFoo returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md deleted file mode 100644 index 7f057faf717..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md +++ /dev/null @@ -1,66 +0,0 @@ -# HealthCheckResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**NullableMessage** | Pointer to **NullableString** | | [optional] - -## Methods - -### NewHealthCheckResult - -`func NewHealthCheckResult() *HealthCheckResult` - -NewHealthCheckResult instantiates a new HealthCheckResult object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHealthCheckResultWithDefaults - -`func NewHealthCheckResultWithDefaults() *HealthCheckResult` - -NewHealthCheckResultWithDefaults instantiates a new HealthCheckResult object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetNullableMessage - -`func (o *HealthCheckResult) GetNullableMessage() string` - -GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise. - -### GetNullableMessageOk - -`func (o *HealthCheckResult) GetNullableMessageOk() (*string, bool)` - -GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNullableMessage - -`func (o *HealthCheckResult) SetNullableMessage(v string)` - -SetNullableMessage sets NullableMessage field to given value. - -### HasNullableMessage - -`func (o *HealthCheckResult) HasNullableMessage() bool` - -HasNullableMessage returns a boolean if a field has been set. - -### SetNullableMessageNil - -`func (o *HealthCheckResult) SetNullableMessageNil(b bool)` - - SetNullableMessageNil sets the value for NullableMessage to be an explicit nil - -### UnsetNullableMessage -`func (o *HealthCheckResult) UnsetNullableMessage()` - -UnsetNullableMessage ensures that no value is present for NullableMessage, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md deleted file mode 100644 index 4b0ad91e390..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md +++ /dev/null @@ -1,82 +0,0 @@ -# InlineObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | Updated name of the pet | [optional] -**Status** | Pointer to **string** | Updated status of the pet | [optional] - -## Methods - -### NewInlineObject - -`func NewInlineObject() *InlineObject` - -NewInlineObject instantiates a new InlineObject object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineObjectWithDefaults - -`func NewInlineObjectWithDefaults() *InlineObject` - -NewInlineObjectWithDefaults instantiates a new InlineObject object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *InlineObject) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *InlineObject) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *InlineObject) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *InlineObject) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetStatus - -`func (o *InlineObject) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *InlineObject) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *InlineObject) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *InlineObject) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md deleted file mode 100644 index ab137f8670f..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md +++ /dev/null @@ -1,82 +0,0 @@ -# InlineObject1 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] -**File** | Pointer to [***os.File**](*os.File.md) | file to upload | [optional] - -## Methods - -### NewInlineObject1 - -`func NewInlineObject1() *InlineObject1` - -NewInlineObject1 instantiates a new InlineObject1 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineObject1WithDefaults - -`func NewInlineObject1WithDefaults() *InlineObject1` - -NewInlineObject1WithDefaults instantiates a new InlineObject1 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetAdditionalMetadata - -`func (o *InlineObject1) GetAdditionalMetadata() string` - -GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. - -### GetAdditionalMetadataOk - -`func (o *InlineObject1) GetAdditionalMetadataOk() (*string, bool)` - -GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAdditionalMetadata - -`func (o *InlineObject1) SetAdditionalMetadata(v string)` - -SetAdditionalMetadata sets AdditionalMetadata field to given value. - -### HasAdditionalMetadata - -`func (o *InlineObject1) HasAdditionalMetadata() bool` - -HasAdditionalMetadata returns a boolean if a field has been set. - -### GetFile - -`func (o *InlineObject1) GetFile() *os.File` - -GetFile returns the File field if non-nil, zero value otherwise. - -### GetFileOk - -`func (o *InlineObject1) GetFileOk() (**os.File, bool)` - -GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFile - -`func (o *InlineObject1) SetFile(v *os.File)` - -SetFile sets File field to given value. - -### HasFile - -`func (o *InlineObject1) HasFile() bool` - -HasFile returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md deleted file mode 100644 index 0b6a0dbf0a4..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md +++ /dev/null @@ -1,82 +0,0 @@ -# InlineObject2 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EnumFormStringArray** | Pointer to **[]string** | Form parameter enum test (string array) | [optional] -**EnumFormString** | Pointer to **string** | Form parameter enum test (string) | [optional] [default to "-efg"] - -## Methods - -### NewInlineObject2 - -`func NewInlineObject2() *InlineObject2` - -NewInlineObject2 instantiates a new InlineObject2 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineObject2WithDefaults - -`func NewInlineObject2WithDefaults() *InlineObject2` - -NewInlineObject2WithDefaults instantiates a new InlineObject2 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetEnumFormStringArray - -`func (o *InlineObject2) GetEnumFormStringArray() []string` - -GetEnumFormStringArray returns the EnumFormStringArray field if non-nil, zero value otherwise. - -### GetEnumFormStringArrayOk - -`func (o *InlineObject2) GetEnumFormStringArrayOk() (*[]string, bool)` - -GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumFormStringArray - -`func (o *InlineObject2) SetEnumFormStringArray(v []string)` - -SetEnumFormStringArray sets EnumFormStringArray field to given value. - -### HasEnumFormStringArray - -`func (o *InlineObject2) HasEnumFormStringArray() bool` - -HasEnumFormStringArray returns a boolean if a field has been set. - -### GetEnumFormString - -`func (o *InlineObject2) GetEnumFormString() string` - -GetEnumFormString returns the EnumFormString field if non-nil, zero value otherwise. - -### GetEnumFormStringOk - -`func (o *InlineObject2) GetEnumFormStringOk() (*string, bool)` - -GetEnumFormStringOk returns a tuple with the EnumFormString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEnumFormString - -`func (o *InlineObject2) SetEnumFormString(v string)` - -SetEnumFormString sets EnumFormString field to given value. - -### HasEnumFormString - -`func (o *InlineObject2) HasEnumFormString() bool` - -HasEnumFormString returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md deleted file mode 100644 index e0c1472b2f7..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md +++ /dev/null @@ -1,374 +0,0 @@ -# InlineObject3 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Integer** | Pointer to **int32** | None | [optional] -**Int32** | Pointer to **int32** | None | [optional] -**Int64** | Pointer to **int64** | None | [optional] -**Number** | **float32** | None | -**Float** | Pointer to **float32** | None | [optional] -**Double** | **float64** | None | -**String** | Pointer to **string** | None | [optional] -**PatternWithoutDelimiter** | **string** | None | -**Byte** | **string** | None | -**Binary** | Pointer to [***os.File**](*os.File.md) | None | [optional] -**Date** | Pointer to **string** | None | [optional] -**DateTime** | Pointer to [**time.Time**](time.Time.md) | None | [optional] -**Password** | Pointer to **string** | None | [optional] -**Callback** | Pointer to **string** | None | [optional] - -## Methods - -### NewInlineObject3 - -`func NewInlineObject3(number float32, double float64, patternWithoutDelimiter string, byte_ string, ) *InlineObject3` - -NewInlineObject3 instantiates a new InlineObject3 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineObject3WithDefaults - -`func NewInlineObject3WithDefaults() *InlineObject3` - -NewInlineObject3WithDefaults instantiates a new InlineObject3 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetInteger - -`func (o *InlineObject3) GetInteger() int32` - -GetInteger returns the Integer field if non-nil, zero value otherwise. - -### GetIntegerOk - -`func (o *InlineObject3) GetIntegerOk() (*int32, bool)` - -GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInteger - -`func (o *InlineObject3) SetInteger(v int32)` - -SetInteger sets Integer field to given value. - -### HasInteger - -`func (o *InlineObject3) HasInteger() bool` - -HasInteger returns a boolean if a field has been set. - -### GetInt32 - -`func (o *InlineObject3) GetInt32() int32` - -GetInt32 returns the Int32 field if non-nil, zero value otherwise. - -### GetInt32Ok - -`func (o *InlineObject3) GetInt32Ok() (*int32, bool)` - -GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInt32 - -`func (o *InlineObject3) SetInt32(v int32)` - -SetInt32 sets Int32 field to given value. - -### HasInt32 - -`func (o *InlineObject3) HasInt32() bool` - -HasInt32 returns a boolean if a field has been set. - -### GetInt64 - -`func (o *InlineObject3) GetInt64() int64` - -GetInt64 returns the Int64 field if non-nil, zero value otherwise. - -### GetInt64Ok - -`func (o *InlineObject3) GetInt64Ok() (*int64, bool)` - -GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetInt64 - -`func (o *InlineObject3) SetInt64(v int64)` - -SetInt64 sets Int64 field to given value. - -### HasInt64 - -`func (o *InlineObject3) HasInt64() bool` - -HasInt64 returns a boolean if a field has been set. - -### GetNumber - -`func (o *InlineObject3) GetNumber() float32` - -GetNumber returns the Number field if non-nil, zero value otherwise. - -### GetNumberOk - -`func (o *InlineObject3) GetNumberOk() (*float32, bool)` - -GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumber - -`func (o *InlineObject3) SetNumber(v float32)` - -SetNumber sets Number field to given value. - - -### GetFloat - -`func (o *InlineObject3) GetFloat() float32` - -GetFloat returns the Float field if non-nil, zero value otherwise. - -### GetFloatOk - -`func (o *InlineObject3) GetFloatOk() (*float32, bool)` - -GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFloat - -`func (o *InlineObject3) SetFloat(v float32)` - -SetFloat sets Float field to given value. - -### HasFloat - -`func (o *InlineObject3) HasFloat() bool` - -HasFloat returns a boolean if a field has been set. - -### GetDouble - -`func (o *InlineObject3) GetDouble() float64` - -GetDouble returns the Double field if non-nil, zero value otherwise. - -### GetDoubleOk - -`func (o *InlineObject3) GetDoubleOk() (*float64, bool)` - -GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDouble - -`func (o *InlineObject3) SetDouble(v float64)` - -SetDouble sets Double field to given value. - - -### GetString - -`func (o *InlineObject3) GetString() string` - -GetString returns the String field if non-nil, zero value otherwise. - -### GetStringOk - -`func (o *InlineObject3) GetStringOk() (*string, bool)` - -GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetString - -`func (o *InlineObject3) SetString(v string)` - -SetString sets String field to given value. - -### HasString - -`func (o *InlineObject3) HasString() bool` - -HasString returns a boolean if a field has been set. - -### GetPatternWithoutDelimiter - -`func (o *InlineObject3) GetPatternWithoutDelimiter() string` - -GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field if non-nil, zero value otherwise. - -### GetPatternWithoutDelimiterOk - -`func (o *InlineObject3) GetPatternWithoutDelimiterOk() (*string, bool)` - -GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPatternWithoutDelimiter - -`func (o *InlineObject3) SetPatternWithoutDelimiter(v string)` - -SetPatternWithoutDelimiter sets PatternWithoutDelimiter field to given value. - - -### GetByte - -`func (o *InlineObject3) GetByte() string` - -GetByte returns the Byte field if non-nil, zero value otherwise. - -### GetByteOk - -`func (o *InlineObject3) GetByteOk() (*string, bool)` - -GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetByte - -`func (o *InlineObject3) SetByte(v string)` - -SetByte sets Byte field to given value. - - -### GetBinary - -`func (o *InlineObject3) GetBinary() *os.File` - -GetBinary returns the Binary field if non-nil, zero value otherwise. - -### GetBinaryOk - -`func (o *InlineObject3) GetBinaryOk() (**os.File, bool)` - -GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBinary - -`func (o *InlineObject3) SetBinary(v *os.File)` - -SetBinary sets Binary field to given value. - -### HasBinary - -`func (o *InlineObject3) HasBinary() bool` - -HasBinary returns a boolean if a field has been set. - -### GetDate - -`func (o *InlineObject3) GetDate() string` - -GetDate returns the Date field if non-nil, zero value otherwise. - -### GetDateOk - -`func (o *InlineObject3) GetDateOk() (*string, bool)` - -GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDate - -`func (o *InlineObject3) SetDate(v string)` - -SetDate sets Date field to given value. - -### HasDate - -`func (o *InlineObject3) HasDate() bool` - -HasDate returns a boolean if a field has been set. - -### GetDateTime - -`func (o *InlineObject3) GetDateTime() time.Time` - -GetDateTime returns the DateTime field if non-nil, zero value otherwise. - -### GetDateTimeOk - -`func (o *InlineObject3) GetDateTimeOk() (*time.Time, bool)` - -GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDateTime - -`func (o *InlineObject3) SetDateTime(v time.Time)` - -SetDateTime sets DateTime field to given value. - -### HasDateTime - -`func (o *InlineObject3) HasDateTime() bool` - -HasDateTime returns a boolean if a field has been set. - -### GetPassword - -`func (o *InlineObject3) GetPassword() string` - -GetPassword returns the Password field if non-nil, zero value otherwise. - -### GetPasswordOk - -`func (o *InlineObject3) GetPasswordOk() (*string, bool)` - -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPassword - -`func (o *InlineObject3) SetPassword(v string)` - -SetPassword sets Password field to given value. - -### HasPassword - -`func (o *InlineObject3) HasPassword() bool` - -HasPassword returns a boolean if a field has been set. - -### GetCallback - -`func (o *InlineObject3) GetCallback() string` - -GetCallback returns the Callback field if non-nil, zero value otherwise. - -### GetCallbackOk - -`func (o *InlineObject3) GetCallbackOk() (*string, bool)` - -GetCallbackOk returns a tuple with the Callback field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCallback - -`func (o *InlineObject3) SetCallback(v string)` - -SetCallback sets Callback field to given value. - -### HasCallback - -`func (o *InlineObject3) HasCallback() bool` - -HasCallback returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md deleted file mode 100644 index e716f8dd913..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md +++ /dev/null @@ -1,72 +0,0 @@ -# InlineObject4 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Param** | **string** | field1 | -**Param2** | **string** | field2 | - -## Methods - -### NewInlineObject4 - -`func NewInlineObject4(param string, param2 string, ) *InlineObject4` - -NewInlineObject4 instantiates a new InlineObject4 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineObject4WithDefaults - -`func NewInlineObject4WithDefaults() *InlineObject4` - -NewInlineObject4WithDefaults instantiates a new InlineObject4 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetParam - -`func (o *InlineObject4) GetParam() string` - -GetParam returns the Param field if non-nil, zero value otherwise. - -### GetParamOk - -`func (o *InlineObject4) GetParamOk() (*string, bool)` - -GetParamOk returns a tuple with the Param field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetParam - -`func (o *InlineObject4) SetParam(v string)` - -SetParam sets Param field to given value. - - -### GetParam2 - -`func (o *InlineObject4) GetParam2() string` - -GetParam2 returns the Param2 field if non-nil, zero value otherwise. - -### GetParam2Ok - -`func (o *InlineObject4) GetParam2Ok() (*string, bool)` - -GetParam2Ok returns a tuple with the Param2 field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetParam2 - -`func (o *InlineObject4) SetParam2(v string)` - -SetParam2 sets Param2 field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md deleted file mode 100644 index a6a4f9367b5..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md +++ /dev/null @@ -1,77 +0,0 @@ -# InlineObject5 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] -**RequiredFile** | [***os.File**](*os.File.md) | file to upload | - -## Methods - -### NewInlineObject5 - -`func NewInlineObject5(requiredFile *os.File, ) *InlineObject5` - -NewInlineObject5 instantiates a new InlineObject5 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineObject5WithDefaults - -`func NewInlineObject5WithDefaults() *InlineObject5` - -NewInlineObject5WithDefaults instantiates a new InlineObject5 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetAdditionalMetadata - -`func (o *InlineObject5) GetAdditionalMetadata() string` - -GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. - -### GetAdditionalMetadataOk - -`func (o *InlineObject5) GetAdditionalMetadataOk() (*string, bool)` - -GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAdditionalMetadata - -`func (o *InlineObject5) SetAdditionalMetadata(v string)` - -SetAdditionalMetadata sets AdditionalMetadata field to given value. - -### HasAdditionalMetadata - -`func (o *InlineObject5) HasAdditionalMetadata() bool` - -HasAdditionalMetadata returns a boolean if a field has been set. - -### GetRequiredFile - -`func (o *InlineObject5) GetRequiredFile() *os.File` - -GetRequiredFile returns the RequiredFile field if non-nil, zero value otherwise. - -### GetRequiredFileOk - -`func (o *InlineObject5) GetRequiredFileOk() (**os.File, bool)` - -GetRequiredFileOk returns a tuple with the RequiredFile field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequiredFile - -`func (o *InlineObject5) SetRequiredFile(v *os.File)` - -SetRequiredFile sets RequiredFile field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md deleted file mode 100644 index 0736bb1fb42..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md +++ /dev/null @@ -1,56 +0,0 @@ -# InlineResponseDefault - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**String** | Pointer to [**Foo**](Foo.md) | | [optional] - -## Methods - -### NewInlineResponseDefault - -`func NewInlineResponseDefault() *InlineResponseDefault` - -NewInlineResponseDefault instantiates a new InlineResponseDefault object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineResponseDefaultWithDefaults - -`func NewInlineResponseDefaultWithDefaults() *InlineResponseDefault` - -NewInlineResponseDefaultWithDefaults instantiates a new InlineResponseDefault object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetString - -`func (o *InlineResponseDefault) GetString() Foo` - -GetString returns the String field if non-nil, zero value otherwise. - -### GetStringOk - -`func (o *InlineResponseDefault) GetStringOk() (*Foo, bool)` - -GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetString - -`func (o *InlineResponseDefault) SetString(v Foo)` - -SetString sets String field to given value. - -### HasString - -`func (o *InlineResponseDefault) HasString() bool` - -HasString returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md deleted file mode 100644 index 271c8236a8b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md +++ /dev/null @@ -1,56 +0,0 @@ -# List - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Var123List** | Pointer to **string** | | [optional] - -## Methods - -### NewList - -`func NewList() *List` - -NewList instantiates a new List object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewListWithDefaults - -`func NewListWithDefaults() *List` - -NewListWithDefaults instantiates a new List object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetVar123List - -`func (o *List) GetVar123List() string` - -GetVar123List returns the Var123List field if non-nil, zero value otherwise. - -### GetVar123ListOk - -`func (o *List) GetVar123ListOk() (*string, bool)` - -GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVar123List - -`func (o *List) SetVar123List(v string)` - -SetVar123List sets Var123List field to given value. - -### HasVar123List - -`func (o *List) HasVar123List() bool` - -HasVar123List returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md deleted file mode 100644 index 6b35263c4e3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md +++ /dev/null @@ -1,134 +0,0 @@ -# MapTest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | Pointer to **map[string]string** | | [optional] -**DirectMap** | Pointer to **map[string]bool** | | [optional] -**IndirectMap** | Pointer to **map[string]bool** | | [optional] - -## Methods - -### NewMapTest - -`func NewMapTest() *MapTest` - -NewMapTest instantiates a new MapTest object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMapTestWithDefaults - -`func NewMapTestWithDefaults() *MapTest` - -NewMapTestWithDefaults instantiates a new MapTest object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMapMapOfString - -`func (o *MapTest) GetMapMapOfString() map[string]map[string]string` - -GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. - -### GetMapMapOfStringOk - -`func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool)` - -GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapMapOfString - -`func (o *MapTest) SetMapMapOfString(v map[string]map[string]string)` - -SetMapMapOfString sets MapMapOfString field to given value. - -### HasMapMapOfString - -`func (o *MapTest) HasMapMapOfString() bool` - -HasMapMapOfString returns a boolean if a field has been set. - -### GetMapOfEnumString - -`func (o *MapTest) GetMapOfEnumString() map[string]string` - -GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. - -### GetMapOfEnumStringOk - -`func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool)` - -GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMapOfEnumString - -`func (o *MapTest) SetMapOfEnumString(v map[string]string)` - -SetMapOfEnumString sets MapOfEnumString field to given value. - -### HasMapOfEnumString - -`func (o *MapTest) HasMapOfEnumString() bool` - -HasMapOfEnumString returns a boolean if a field has been set. - -### GetDirectMap - -`func (o *MapTest) GetDirectMap() map[string]bool` - -GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. - -### GetDirectMapOk - -`func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool)` - -GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDirectMap - -`func (o *MapTest) SetDirectMap(v map[string]bool)` - -SetDirectMap sets DirectMap field to given value. - -### HasDirectMap - -`func (o *MapTest) HasDirectMap() bool` - -HasDirectMap returns a boolean if a field has been set. - -### GetIndirectMap - -`func (o *MapTest) GetIndirectMap() map[string]bool` - -GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. - -### GetIndirectMapOk - -`func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool)` - -GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIndirectMap - -`func (o *MapTest) SetIndirectMap(v map[string]bool)` - -SetIndirectMap sets IndirectMap field to given value. - -### HasIndirectMap - -`func (o *MapTest) HasIndirectMap() bool` - -HasIndirectMap returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index f726ffe63e1..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,108 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Uuid** | Pointer to **string** | | [optional] -**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] - -## Methods - -### NewMixedPropertiesAndAdditionalPropertiesClass - -`func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass` - -NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults - -`func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass` - -NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetUuid - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string` - -GetUuid returns the Uuid field if non-nil, zero value otherwise. - -### GetUuidOk - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool)` - -GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUuid - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string)` - -SetUuid sets Uuid field to given value. - -### HasUuid - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool` - -HasUuid returns a boolean if a field has been set. - -### GetDateTime - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time` - -GetDateTime returns the DateTime field if non-nil, zero value otherwise. - -### GetDateTimeOk - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool)` - -GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDateTime - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time)` - -SetDateTime sets DateTime field to given value. - -### HasDateTime - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool` - -HasDateTime returns a boolean if a field has been set. - -### GetMap - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal` - -GetMap returns the Map field if non-nil, zero value otherwise. - -### GetMapOk - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool)` - -GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMap - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal)` - -SetMap sets Map field to given value. - -### HasMap - -`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool` - -HasMap returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md deleted file mode 100644 index 4e0d89fe88f..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md +++ /dev/null @@ -1,82 +0,0 @@ -# Model200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | Pointer to **int32** | | [optional] -**Class** | Pointer to **string** | | [optional] - -## Methods - -### NewModel200Response - -`func NewModel200Response() *Model200Response` - -NewModel200Response instantiates a new Model200Response object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewModel200ResponseWithDefaults - -`func NewModel200ResponseWithDefaults() *Model200Response` - -NewModel200ResponseWithDefaults instantiates a new Model200Response object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *Model200Response) GetName() int32` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Model200Response) GetNameOk() (*int32, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Model200Response) SetName(v int32)` - -SetName sets Name field to given value. - -### HasName - -`func (o *Model200Response) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetClass - -`func (o *Model200Response) GetClass() string` - -GetClass returns the Class field if non-nil, zero value otherwise. - -### GetClassOk - -`func (o *Model200Response) GetClassOk() (*string, bool)` - -GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClass - -`func (o *Model200Response) SetClass(v string)` - -SetClass sets Class field to given value. - -### HasClass - -`func (o *Model200Response) HasClass() bool` - -HasClass returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md deleted file mode 100644 index 18cf04789d6..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md +++ /dev/null @@ -1,129 +0,0 @@ -# Name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **int32** | | -**SnakeCase** | Pointer to **int32** | | [optional] [readonly] -**Property** | Pointer to **string** | | [optional] -**Var123Number** | Pointer to **int32** | | [optional] [readonly] - -## Methods - -### NewName - -`func NewName(name int32, ) *Name` - -NewName instantiates a new Name object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNameWithDefaults - -`func NewNameWithDefaults() *Name` - -NewNameWithDefaults instantiates a new Name object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetName - -`func (o *Name) GetName() int32` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Name) GetNameOk() (*int32, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Name) SetName(v int32)` - -SetName sets Name field to given value. - - -### GetSnakeCase - -`func (o *Name) GetSnakeCase() int32` - -GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. - -### GetSnakeCaseOk - -`func (o *Name) GetSnakeCaseOk() (*int32, bool)` - -GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSnakeCase - -`func (o *Name) SetSnakeCase(v int32)` - -SetSnakeCase sets SnakeCase field to given value. - -### HasSnakeCase - -`func (o *Name) HasSnakeCase() bool` - -HasSnakeCase returns a boolean if a field has been set. - -### GetProperty - -`func (o *Name) GetProperty() string` - -GetProperty returns the Property field if non-nil, zero value otherwise. - -### GetPropertyOk - -`func (o *Name) GetPropertyOk() (*string, bool)` - -GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetProperty - -`func (o *Name) SetProperty(v string)` - -SetProperty sets Property field to given value. - -### HasProperty - -`func (o *Name) HasProperty() bool` - -HasProperty returns a boolean if a field has been set. - -### GetVar123Number - -`func (o *Name) GetVar123Number() int32` - -GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. - -### GetVar123NumberOk - -`func (o *Name) GetVar123NumberOk() (*int32, bool)` - -GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVar123Number - -`func (o *Name) SetVar123Number(v int32)` - -SetVar123Number sets Var123Number field to given value. - -### HasVar123Number - -`func (o *Name) HasVar123Number() bool` - -HasVar123Number returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md deleted file mode 100644 index e24e6447515..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md +++ /dev/null @@ -1,442 +0,0 @@ -# NullableClass - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**IntegerProp** | Pointer to **NullableInt32** | | [optional] -**NumberProp** | Pointer to **NullableFloat32** | | [optional] -**BooleanProp** | Pointer to **NullableBool** | | [optional] -**StringProp** | Pointer to **NullableString** | | [optional] -**DateProp** | Pointer to **NullableString** | | [optional] -**DatetimeProp** | Pointer to [**NullableTime**](time.Time.md) | | [optional] -**ArrayNullableProp** | Pointer to **[]map[string]interface{}** | | [optional] -**ArrayAndItemsNullableProp** | Pointer to **[]map[string]interface{}** | | [optional] -**ArrayItemsNullable** | Pointer to **[]map[string]interface{}** | | [optional] -**ObjectNullableProp** | Pointer to **map[string]map[string]interface{}** | | [optional] -**ObjectAndItemsNullableProp** | Pointer to **map[string]map[string]interface{}** | | [optional] -**ObjectItemsNullable** | Pointer to **map[string]map[string]interface{}** | | [optional] - -## Methods - -### NewNullableClass - -`func NewNullableClass() *NullableClass` - -NewNullableClass instantiates a new NullableClass object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNullableClassWithDefaults - -`func NewNullableClassWithDefaults() *NullableClass` - -NewNullableClassWithDefaults instantiates a new NullableClass object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetIntegerProp - -`func (o *NullableClass) GetIntegerProp() int32` - -GetIntegerProp returns the IntegerProp field if non-nil, zero value otherwise. - -### GetIntegerPropOk - -`func (o *NullableClass) GetIntegerPropOk() (*int32, bool)` - -GetIntegerPropOk returns a tuple with the IntegerProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIntegerProp - -`func (o *NullableClass) SetIntegerProp(v int32)` - -SetIntegerProp sets IntegerProp field to given value. - -### HasIntegerProp - -`func (o *NullableClass) HasIntegerProp() bool` - -HasIntegerProp returns a boolean if a field has been set. - -### SetIntegerPropNil - -`func (o *NullableClass) SetIntegerPropNil(b bool)` - - SetIntegerPropNil sets the value for IntegerProp to be an explicit nil - -### UnsetIntegerProp -`func (o *NullableClass) UnsetIntegerProp()` - -UnsetIntegerProp ensures that no value is present for IntegerProp, not even an explicit nil -### GetNumberProp - -`func (o *NullableClass) GetNumberProp() float32` - -GetNumberProp returns the NumberProp field if non-nil, zero value otherwise. - -### GetNumberPropOk - -`func (o *NullableClass) GetNumberPropOk() (*float32, bool)` - -GetNumberPropOk returns a tuple with the NumberProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNumberProp - -`func (o *NullableClass) SetNumberProp(v float32)` - -SetNumberProp sets NumberProp field to given value. - -### HasNumberProp - -`func (o *NullableClass) HasNumberProp() bool` - -HasNumberProp returns a boolean if a field has been set. - -### SetNumberPropNil - -`func (o *NullableClass) SetNumberPropNil(b bool)` - - SetNumberPropNil sets the value for NumberProp to be an explicit nil - -### UnsetNumberProp -`func (o *NullableClass) UnsetNumberProp()` - -UnsetNumberProp ensures that no value is present for NumberProp, not even an explicit nil -### GetBooleanProp - -`func (o *NullableClass) GetBooleanProp() bool` - -GetBooleanProp returns the BooleanProp field if non-nil, zero value otherwise. - -### GetBooleanPropOk - -`func (o *NullableClass) GetBooleanPropOk() (*bool, bool)` - -GetBooleanPropOk returns a tuple with the BooleanProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBooleanProp - -`func (o *NullableClass) SetBooleanProp(v bool)` - -SetBooleanProp sets BooleanProp field to given value. - -### HasBooleanProp - -`func (o *NullableClass) HasBooleanProp() bool` - -HasBooleanProp returns a boolean if a field has been set. - -### SetBooleanPropNil - -`func (o *NullableClass) SetBooleanPropNil(b bool)` - - SetBooleanPropNil sets the value for BooleanProp to be an explicit nil - -### UnsetBooleanProp -`func (o *NullableClass) UnsetBooleanProp()` - -UnsetBooleanProp ensures that no value is present for BooleanProp, not even an explicit nil -### GetStringProp - -`func (o *NullableClass) GetStringProp() string` - -GetStringProp returns the StringProp field if non-nil, zero value otherwise. - -### GetStringPropOk - -`func (o *NullableClass) GetStringPropOk() (*string, bool)` - -GetStringPropOk returns a tuple with the StringProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStringProp - -`func (o *NullableClass) SetStringProp(v string)` - -SetStringProp sets StringProp field to given value. - -### HasStringProp - -`func (o *NullableClass) HasStringProp() bool` - -HasStringProp returns a boolean if a field has been set. - -### SetStringPropNil - -`func (o *NullableClass) SetStringPropNil(b bool)` - - SetStringPropNil sets the value for StringProp to be an explicit nil - -### UnsetStringProp -`func (o *NullableClass) UnsetStringProp()` - -UnsetStringProp ensures that no value is present for StringProp, not even an explicit nil -### GetDateProp - -`func (o *NullableClass) GetDateProp() string` - -GetDateProp returns the DateProp field if non-nil, zero value otherwise. - -### GetDatePropOk - -`func (o *NullableClass) GetDatePropOk() (*string, bool)` - -GetDatePropOk returns a tuple with the DateProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDateProp - -`func (o *NullableClass) SetDateProp(v string)` - -SetDateProp sets DateProp field to given value. - -### HasDateProp - -`func (o *NullableClass) HasDateProp() bool` - -HasDateProp returns a boolean if a field has been set. - -### SetDatePropNil - -`func (o *NullableClass) SetDatePropNil(b bool)` - - SetDatePropNil sets the value for DateProp to be an explicit nil - -### UnsetDateProp -`func (o *NullableClass) UnsetDateProp()` - -UnsetDateProp ensures that no value is present for DateProp, not even an explicit nil -### GetDatetimeProp - -`func (o *NullableClass) GetDatetimeProp() time.Time` - -GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. - -### GetDatetimePropOk - -`func (o *NullableClass) GetDatetimePropOk() (*time.Time, bool)` - -GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDatetimeProp - -`func (o *NullableClass) SetDatetimeProp(v time.Time)` - -SetDatetimeProp sets DatetimeProp field to given value. - -### HasDatetimeProp - -`func (o *NullableClass) HasDatetimeProp() bool` - -HasDatetimeProp returns a boolean if a field has been set. - -### SetDatetimePropNil - -`func (o *NullableClass) SetDatetimePropNil(b bool)` - - SetDatetimePropNil sets the value for DatetimeProp to be an explicit nil - -### UnsetDatetimeProp -`func (o *NullableClass) UnsetDatetimeProp()` - -UnsetDatetimeProp ensures that no value is present for DatetimeProp, not even an explicit nil -### GetArrayNullableProp - -`func (o *NullableClass) GetArrayNullableProp() []map[string]interface{}` - -GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. - -### GetArrayNullablePropOk - -`func (o *NullableClass) GetArrayNullablePropOk() (*[]map[string]interface{}, bool)` - -GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayNullableProp - -`func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{})` - -SetArrayNullableProp sets ArrayNullableProp field to given value. - -### HasArrayNullableProp - -`func (o *NullableClass) HasArrayNullableProp() bool` - -HasArrayNullableProp returns a boolean if a field has been set. - -### SetArrayNullablePropNil - -`func (o *NullableClass) SetArrayNullablePropNil(b bool)` - - SetArrayNullablePropNil sets the value for ArrayNullableProp to be an explicit nil - -### UnsetArrayNullableProp -`func (o *NullableClass) UnsetArrayNullableProp()` - -UnsetArrayNullableProp ensures that no value is present for ArrayNullableProp, not even an explicit nil -### GetArrayAndItemsNullableProp - -`func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{}` - -GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. - -### GetArrayAndItemsNullablePropOk - -`func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]map[string]interface{}, bool)` - -GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayAndItemsNullableProp - -`func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{})` - -SetArrayAndItemsNullableProp sets ArrayAndItemsNullableProp field to given value. - -### HasArrayAndItemsNullableProp - -`func (o *NullableClass) HasArrayAndItemsNullableProp() bool` - -HasArrayAndItemsNullableProp returns a boolean if a field has been set. - -### SetArrayAndItemsNullablePropNil - -`func (o *NullableClass) SetArrayAndItemsNullablePropNil(b bool)` - - SetArrayAndItemsNullablePropNil sets the value for ArrayAndItemsNullableProp to be an explicit nil - -### UnsetArrayAndItemsNullableProp -`func (o *NullableClass) UnsetArrayAndItemsNullableProp()` - -UnsetArrayAndItemsNullableProp ensures that no value is present for ArrayAndItemsNullableProp, not even an explicit nil -### GetArrayItemsNullable - -`func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{}` - -GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. - -### GetArrayItemsNullableOk - -`func (o *NullableClass) GetArrayItemsNullableOk() (*[]map[string]interface{}, bool)` - -GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArrayItemsNullable - -`func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{})` - -SetArrayItemsNullable sets ArrayItemsNullable field to given value. - -### HasArrayItemsNullable - -`func (o *NullableClass) HasArrayItemsNullable() bool` - -HasArrayItemsNullable returns a boolean if a field has been set. - -### GetObjectNullableProp - -`func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{}` - -GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. - -### GetObjectNullablePropOk - -`func (o *NullableClass) GetObjectNullablePropOk() (*map[string]map[string]interface{}, bool)` - -GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObjectNullableProp - -`func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{})` - -SetObjectNullableProp sets ObjectNullableProp field to given value. - -### HasObjectNullableProp - -`func (o *NullableClass) HasObjectNullableProp() bool` - -HasObjectNullableProp returns a boolean if a field has been set. - -### SetObjectNullablePropNil - -`func (o *NullableClass) SetObjectNullablePropNil(b bool)` - - SetObjectNullablePropNil sets the value for ObjectNullableProp to be an explicit nil - -### UnsetObjectNullableProp -`func (o *NullableClass) UnsetObjectNullableProp()` - -UnsetObjectNullableProp ensures that no value is present for ObjectNullableProp, not even an explicit nil -### GetObjectAndItemsNullableProp - -`func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{}` - -GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. - -### GetObjectAndItemsNullablePropOk - -`func (o *NullableClass) GetObjectAndItemsNullablePropOk() (*map[string]map[string]interface{}, bool)` - -GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObjectAndItemsNullableProp - -`func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{})` - -SetObjectAndItemsNullableProp sets ObjectAndItemsNullableProp field to given value. - -### HasObjectAndItemsNullableProp - -`func (o *NullableClass) HasObjectAndItemsNullableProp() bool` - -HasObjectAndItemsNullableProp returns a boolean if a field has been set. - -### SetObjectAndItemsNullablePropNil - -`func (o *NullableClass) SetObjectAndItemsNullablePropNil(b bool)` - - SetObjectAndItemsNullablePropNil sets the value for ObjectAndItemsNullableProp to be an explicit nil - -### UnsetObjectAndItemsNullableProp -`func (o *NullableClass) UnsetObjectAndItemsNullableProp()` - -UnsetObjectAndItemsNullableProp ensures that no value is present for ObjectAndItemsNullableProp, not even an explicit nil -### GetObjectItemsNullable - -`func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{}` - -GetObjectItemsNullable returns the ObjectItemsNullable field if non-nil, zero value otherwise. - -### GetObjectItemsNullableOk - -`func (o *NullableClass) GetObjectItemsNullableOk() (*map[string]map[string]interface{}, bool)` - -GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObjectItemsNullable - -`func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{})` - -SetObjectItemsNullable sets ObjectItemsNullable field to given value. - -### HasObjectItemsNullable - -`func (o *NullableClass) HasObjectItemsNullable() bool` - -HasObjectItemsNullable returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md deleted file mode 100644 index 81941828b62..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md +++ /dev/null @@ -1,56 +0,0 @@ -# NumberOnly - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**JustNumber** | Pointer to **float32** | | [optional] - -## Methods - -### NewNumberOnly - -`func NewNumberOnly() *NumberOnly` - -NewNumberOnly instantiates a new NumberOnly object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewNumberOnlyWithDefaults - -`func NewNumberOnlyWithDefaults() *NumberOnly` - -NewNumberOnlyWithDefaults instantiates a new NumberOnly object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetJustNumber - -`func (o *NumberOnly) GetJustNumber() float32` - -GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. - -### GetJustNumberOk - -`func (o *NumberOnly) GetJustNumberOk() (*float32, bool)` - -GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetJustNumber - -`func (o *NumberOnly) SetJustNumber(v float32)` - -SetJustNumber sets JustNumber field to given value. - -### HasJustNumber - -`func (o *NumberOnly) HasJustNumber() bool` - -HasJustNumber returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md deleted file mode 100644 index 78cace2f229..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md +++ /dev/null @@ -1,186 +0,0 @@ -# Order - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**PetId** | Pointer to **int64** | | [optional] -**Quantity** | Pointer to **int32** | | [optional] -**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] -**Status** | Pointer to **string** | Order Status | [optional] -**Complete** | Pointer to **bool** | | [optional] [default to false] - -## Methods - -### NewOrder - -`func NewOrder() *Order` - -NewOrder instantiates a new Order object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOrderWithDefaults - -`func NewOrderWithDefaults() *Order` - -NewOrderWithDefaults instantiates a new Order object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Order) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Order) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Order) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Order) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetPetId - -`func (o *Order) GetPetId() int64` - -GetPetId returns the PetId field if non-nil, zero value otherwise. - -### GetPetIdOk - -`func (o *Order) GetPetIdOk() (*int64, bool)` - -GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPetId - -`func (o *Order) SetPetId(v int64)` - -SetPetId sets PetId field to given value. - -### HasPetId - -`func (o *Order) HasPetId() bool` - -HasPetId returns a boolean if a field has been set. - -### GetQuantity - -`func (o *Order) GetQuantity() int32` - -GetQuantity returns the Quantity field if non-nil, zero value otherwise. - -### GetQuantityOk - -`func (o *Order) GetQuantityOk() (*int32, bool)` - -GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQuantity - -`func (o *Order) SetQuantity(v int32)` - -SetQuantity sets Quantity field to given value. - -### HasQuantity - -`func (o *Order) HasQuantity() bool` - -HasQuantity returns a boolean if a field has been set. - -### GetShipDate - -`func (o *Order) GetShipDate() time.Time` - -GetShipDate returns the ShipDate field if non-nil, zero value otherwise. - -### GetShipDateOk - -`func (o *Order) GetShipDateOk() (*time.Time, bool)` - -GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetShipDate - -`func (o *Order) SetShipDate(v time.Time)` - -SetShipDate sets ShipDate field to given value. - -### HasShipDate - -`func (o *Order) HasShipDate() bool` - -HasShipDate returns a boolean if a field has been set. - -### GetStatus - -`func (o *Order) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *Order) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *Order) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *Order) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - -### GetComplete - -`func (o *Order) GetComplete() bool` - -GetComplete returns the Complete field if non-nil, zero value otherwise. - -### GetCompleteOk - -`func (o *Order) GetCompleteOk() (*bool, bool)` - -GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetComplete - -`func (o *Order) SetComplete(v bool)` - -SetComplete sets Complete field to given value. - -### HasComplete - -`func (o *Order) HasComplete() bool` - -HasComplete returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md deleted file mode 100644 index 1ebf86c0a2e..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md +++ /dev/null @@ -1,108 +0,0 @@ -# OuterComposite - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**MyNumber** | Pointer to **float32** | | [optional] -**MyString** | Pointer to **string** | | [optional] -**MyBoolean** | Pointer to **bool** | | [optional] - -## Methods - -### NewOuterComposite - -`func NewOuterComposite() *OuterComposite` - -NewOuterComposite instantiates a new OuterComposite object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOuterCompositeWithDefaults - -`func NewOuterCompositeWithDefaults() *OuterComposite` - -NewOuterCompositeWithDefaults instantiates a new OuterComposite object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetMyNumber - -`func (o *OuterComposite) GetMyNumber() float32` - -GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. - -### GetMyNumberOk - -`func (o *OuterComposite) GetMyNumberOk() (*float32, bool)` - -GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMyNumber - -`func (o *OuterComposite) SetMyNumber(v float32)` - -SetMyNumber sets MyNumber field to given value. - -### HasMyNumber - -`func (o *OuterComposite) HasMyNumber() bool` - -HasMyNumber returns a boolean if a field has been set. - -### GetMyString - -`func (o *OuterComposite) GetMyString() string` - -GetMyString returns the MyString field if non-nil, zero value otherwise. - -### GetMyStringOk - -`func (o *OuterComposite) GetMyStringOk() (*string, bool)` - -GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMyString - -`func (o *OuterComposite) SetMyString(v string)` - -SetMyString sets MyString field to given value. - -### HasMyString - -`func (o *OuterComposite) HasMyString() bool` - -HasMyString returns a boolean if a field has been set. - -### GetMyBoolean - -`func (o *OuterComposite) GetMyBoolean() bool` - -GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. - -### GetMyBooleanOk - -`func (o *OuterComposite) GetMyBooleanOk() (*bool, bool)` - -GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMyBoolean - -`func (o *OuterComposite) SetMyBoolean(v bool)` - -SetMyBoolean sets MyBoolean field to given value. - -### HasMyBoolean - -`func (o *OuterComposite) HasMyBoolean() bool` - -HasMyBoolean returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md deleted file mode 100644 index 13bed2d17fd..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md +++ /dev/null @@ -1,11 +0,0 @@ -# OuterEnum - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md deleted file mode 100644 index 50f8ab0096c..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md +++ /dev/null @@ -1,11 +0,0 @@ -# OuterEnumDefaultValue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md deleted file mode 100644 index eb033db7cc5..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md +++ /dev/null @@ -1,11 +0,0 @@ -# OuterEnumInteger - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index 7a163432954..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,11 +0,0 @@ -# OuterEnumIntegerDefaultValue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md deleted file mode 100644 index a6eae34657d..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md +++ /dev/null @@ -1,176 +0,0 @@ -# Pet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Category** | Pointer to [**Category**](Category.md) | | [optional] -**Name** | **string** | | -**PhotoUrls** | **[]string** | | -**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] -**Status** | Pointer to **string** | pet status in the store | [optional] - -## Methods - -### NewPet - -`func NewPet(name string, photoUrls []string, ) *Pet` - -NewPet instantiates a new Pet object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPetWithDefaults - -`func NewPetWithDefaults() *Pet` - -NewPetWithDefaults instantiates a new Pet object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Pet) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Pet) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Pet) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Pet) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetCategory - -`func (o *Pet) GetCategory() Category` - -GetCategory returns the Category field if non-nil, zero value otherwise. - -### GetCategoryOk - -`func (o *Pet) GetCategoryOk() (*Category, bool)` - -GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCategory - -`func (o *Pet) SetCategory(v Category)` - -SetCategory sets Category field to given value. - -### HasCategory - -`func (o *Pet) HasCategory() bool` - -HasCategory returns a boolean if a field has been set. - -### GetName - -`func (o *Pet) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Pet) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Pet) SetName(v string)` - -SetName sets Name field to given value. - - -### GetPhotoUrls - -`func (o *Pet) GetPhotoUrls() []string` - -GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. - -### GetPhotoUrlsOk - -`func (o *Pet) GetPhotoUrlsOk() (*[]string, bool)` - -GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPhotoUrls - -`func (o *Pet) SetPhotoUrls(v []string)` - -SetPhotoUrls sets PhotoUrls field to given value. - - -### GetTags - -`func (o *Pet) GetTags() []Tag` - -GetTags returns the Tags field if non-nil, zero value otherwise. - -### GetTagsOk - -`func (o *Pet) GetTagsOk() (*[]Tag, bool)` - -GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTags - -`func (o *Pet) SetTags(v []Tag)` - -SetTags sets Tags field to given value. - -### HasTags - -`func (o *Pet) HasTags() bool` - -HasTags returns a boolean if a field has been set. - -### GetStatus - -`func (o *Pet) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *Pet) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *Pet) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *Pet) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md deleted file mode 100644 index 6fdd89f81ba..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md +++ /dev/null @@ -1,625 +0,0 @@ -# \PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AddPet**](PetApi.md#AddPet) | **Post** /pet | Add a new pet to the store -[**DeletePet**](PetApi.md#DeletePet) | **Delete** /pet/{petId} | Deletes a pet -[**FindPetsByStatus**](PetApi.md#FindPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status -[**FindPetsByTags**](PetApi.md#FindPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags -[**GetPetById**](PetApi.md#GetPetById) | **Get** /pet/{petId} | Find pet by ID -[**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet -[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data -[**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image -[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - - -## AddPet - -> AddPet(ctx).Pet(pet).Execute() - -Add a new pet to the store - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pet := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.AddPet(context.Background(), pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiAddPetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - - (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeletePet - -> DeletePet(ctx, petId).ApiKey(apiKey).Execute() - -Deletes a pet - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | Pet id to delete - apiKey := "apiKey_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | Pet id to delete | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeletePetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **apiKey** | **string** | | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FindPetsByStatus - -> []Pet FindPetsByStatus(ctx).Status(status).Execute() - -Finds Pets by status - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - status := []string{"Status_example"} // []string | Status values that need to be considered for filter - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background(), status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByStatus`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByStatus`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFindPetsByStatusRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[]string**](string.md) | Status values that need to be considered for filter | - -### Return type - -[**[]Pet**](Pet.md) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## FindPetsByTags - -> []Pet FindPetsByTags(ctx).Tags(tags).Execute() - -Finds Pets by tags - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - tags := []string{"Inner_example"} // []string | Tags to filter by - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.FindPetsByTags(context.Background(), tags).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByTags`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByTags`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiFindPetsByTagsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[]string**](string.md) | Tags to filter by | - -### Return type - -[**[]Pet**](Pet.md) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetPetById - -> Pet GetPetById(ctx, petId).Execute() - -Find pet by ID - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet to return - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPetById`: Pet - fmt.Fprintf(os.Stdout, "Response from `PetApi.GetPetById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet to return | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetPetByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePet - -> UpdatePet(ctx).Pet(pet).Execute() - -Update an existing pet - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pet := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePet(context.Background(), pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdatePetRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - - (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdatePetWithForm - -> UpdatePetWithForm(ctx, petId).Name(name).Status(status).Execute() - -Updates a pet in the store with form data - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet that needs to be updated - name := "name_example" // string | Updated name of the pet (optional) - status := "status_example" // string | Updated status of the pet (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet that needs to be updated | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdatePetWithFormRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **name** | **string** | Updated name of the pet | - **status** | **string** | Updated status of the pet | - -### Return type - - (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: application/x-www-form-urlencoded -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UploadFile - -> ApiResponse UploadFile(ctx, petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - -uploads an image - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet to update - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - file := 987 // *os.File | file to upload (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFile`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet to update | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUploadFileRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **additionalMetadata** | **string** | Additional data to pass to server | - **file** | ***os.File** | file to upload | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UploadFileWithRequiredFile - -> ApiResponse UploadFileWithRequiredFile(ctx, petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() - -uploads an image (required) - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - petId := 987 // int64 | ID of pet to update - requiredFile := 987 // *os.File | file to upload - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId, requiredFile).AdditionalMetadata(additionalMetadata).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFileWithRequiredFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFileWithRequiredFile`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64** | ID of pet to update | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUploadFileWithRequiredFileRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **requiredFile** | ***os.File** | file to upload | - **additionalMetadata** | **string** | Additional data to pass to server | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md deleted file mode 100644 index 2e25d6d230e..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,82 +0,0 @@ -# ReadOnlyFirst - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Bar** | Pointer to **string** | | [optional] [readonly] -**Baz** | Pointer to **string** | | [optional] - -## Methods - -### NewReadOnlyFirst - -`func NewReadOnlyFirst() *ReadOnlyFirst` - -NewReadOnlyFirst instantiates a new ReadOnlyFirst object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewReadOnlyFirstWithDefaults - -`func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst` - -NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetBar - -`func (o *ReadOnlyFirst) GetBar() string` - -GetBar returns the Bar field if non-nil, zero value otherwise. - -### GetBarOk - -`func (o *ReadOnlyFirst) GetBarOk() (*string, bool)` - -GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBar - -`func (o *ReadOnlyFirst) SetBar(v string)` - -SetBar sets Bar field to given value. - -### HasBar - -`func (o *ReadOnlyFirst) HasBar() bool` - -HasBar returns a boolean if a field has been set. - -### GetBaz - -`func (o *ReadOnlyFirst) GetBaz() string` - -GetBaz returns the Baz field if non-nil, zero value otherwise. - -### GetBazOk - -`func (o *ReadOnlyFirst) GetBazOk() (*string, bool)` - -GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetBaz - -`func (o *ReadOnlyFirst) SetBaz(v string)` - -SetBaz sets Baz field to given value. - -### HasBaz - -`func (o *ReadOnlyFirst) HasBaz() bool` - -HasBaz returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md deleted file mode 100644 index d6be5a42f31..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md +++ /dev/null @@ -1,56 +0,0 @@ -# Return - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Return** | Pointer to **int32** | | [optional] - -## Methods - -### NewReturn - -`func NewReturn() *Return` - -NewReturn instantiates a new Return object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewReturnWithDefaults - -`func NewReturnWithDefaults() *Return` - -NewReturnWithDefaults instantiates a new Return object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetReturn - -`func (o *Return) GetReturn() int32` - -GetReturn returns the Return field if non-nil, zero value otherwise. - -### GetReturnOk - -`func (o *Return) GetReturnOk() (*int32, bool)` - -GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReturn - -`func (o *Return) SetReturn(v int32)` - -SetReturn sets Return field to given value. - -### HasReturn - -`func (o *Return) HasReturn() bool` - -HasReturn returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md deleted file mode 100644 index 3e5a187c1d1..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md +++ /dev/null @@ -1,56 +0,0 @@ -# SpecialModelName - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SpecialPropertyName** | Pointer to **int64** | | [optional] - -## Methods - -### NewSpecialModelName - -`func NewSpecialModelName() *SpecialModelName` - -NewSpecialModelName instantiates a new SpecialModelName object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSpecialModelNameWithDefaults - -`func NewSpecialModelNameWithDefaults() *SpecialModelName` - -NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetSpecialPropertyName - -`func (o *SpecialModelName) GetSpecialPropertyName() int64` - -GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. - -### GetSpecialPropertyNameOk - -`func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool)` - -GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSpecialPropertyName - -`func (o *SpecialModelName) SetSpecialPropertyName(v int64)` - -SetSpecialPropertyName sets SpecialPropertyName field to given value. - -### HasSpecialPropertyName - -`func (o *SpecialModelName) HasSpecialPropertyName() bool` - -HasSpecialPropertyName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md deleted file mode 100644 index 80617c8683b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md +++ /dev/null @@ -1,275 +0,0 @@ -# \StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID -[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status -[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID -[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet - - - -## DeleteOrder - -> DeleteOrder(ctx, orderId).Execute() - -Delete purchase order by ID - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - orderId := "orderId_example" // string | ID of the order that needs to be deleted - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **string** | ID of the order that needs to be deleted | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteOrderRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetInventory - -> map[string]int32 GetInventory(ctx).Execute() - -Returns pet inventories by status - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetInventory(context.Background(), ).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetInventory`: map[string]int32 - fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetInventory`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetInventoryRequest struct via the builder pattern - - -### Return type - -**map[string]int32** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetOrderById - -> Order GetOrderById(ctx, orderId).Execute() - -Find purchase order by ID - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - orderId := 987 // int64 | ID of pet that needs to be fetched - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOrderById`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetOrderById`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **int64** | ID of pet that needs to be fetched | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetOrderByIdRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PlaceOrder - -> Order PlaceOrder(ctx).Order(order).Execute() - -Place an order for a pet - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - order := openapiclient.Order{Id: int64(123), PetId: int64(123), Quantity: 123, ShipDate: "TODO", Status: "Status_example", Complete: false} // Order | order placed for purchasing the pet - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.StoreApi.PlaceOrder(context.Background(), order).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PlaceOrder`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreApi.PlaceOrder`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiPlaceOrderRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md deleted file mode 100644 index 391be6b4900..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md +++ /dev/null @@ -1,82 +0,0 @@ -# Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Name** | Pointer to **string** | | [optional] - -## Methods - -### NewTag - -`func NewTag() *Tag` - -NewTag instantiates a new Tag object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewTagWithDefaults - -`func NewTagWithDefaults() *Tag` - -NewTagWithDefaults instantiates a new Tag object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *Tag) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Tag) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Tag) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Tag) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *Tag) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Tag) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Tag) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *Tag) HasName() bool` - -HasName returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md deleted file mode 100644 index 26c9305363e..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md +++ /dev/null @@ -1,372 +0,0 @@ -# User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **int64** | | [optional] -**Username** | Pointer to **string** | | [optional] -**FirstName** | Pointer to **string** | | [optional] -**LastName** | Pointer to **string** | | [optional] -**Email** | Pointer to **string** | | [optional] -**Password** | Pointer to **string** | | [optional] -**Phone** | Pointer to **string** | | [optional] -**UserStatus** | Pointer to **int32** | User Status | [optional] -**ArbitraryObject** | Pointer to **map[string]interface{}** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] -**ArbitraryNullableObject** | Pointer to **map[string]interface{}** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] -**ArbitraryTypeValue** | Pointer to **interface{}** | test code generation for any type Value can be any type - string, number, boolean, array or object. | [optional] -**ArbitraryNullableTypeValue** | Pointer to **interface{}** | test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. | [optional] - -## Methods - -### NewUser - -`func NewUser() *User` - -NewUser instantiates a new User object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewUserWithDefaults - -`func NewUserWithDefaults() *User` - -NewUserWithDefaults instantiates a new User object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetId - -`func (o *User) GetId() int64` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *User) GetIdOk() (*int64, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *User) SetId(v int64)` - -SetId sets Id field to given value. - -### HasId - -`func (o *User) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetUsername - -`func (o *User) GetUsername() string` - -GetUsername returns the Username field if non-nil, zero value otherwise. - -### GetUsernameOk - -`func (o *User) GetUsernameOk() (*string, bool)` - -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUsername - -`func (o *User) SetUsername(v string)` - -SetUsername sets Username field to given value. - -### HasUsername - -`func (o *User) HasUsername() bool` - -HasUsername returns a boolean if a field has been set. - -### GetFirstName - -`func (o *User) GetFirstName() string` - -GetFirstName returns the FirstName field if non-nil, zero value otherwise. - -### GetFirstNameOk - -`func (o *User) GetFirstNameOk() (*string, bool)` - -GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFirstName - -`func (o *User) SetFirstName(v string)` - -SetFirstName sets FirstName field to given value. - -### HasFirstName - -`func (o *User) HasFirstName() bool` - -HasFirstName returns a boolean if a field has been set. - -### GetLastName - -`func (o *User) GetLastName() string` - -GetLastName returns the LastName field if non-nil, zero value otherwise. - -### GetLastNameOk - -`func (o *User) GetLastNameOk() (*string, bool)` - -GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastName - -`func (o *User) SetLastName(v string)` - -SetLastName sets LastName field to given value. - -### HasLastName - -`func (o *User) HasLastName() bool` - -HasLastName returns a boolean if a field has been set. - -### GetEmail - -`func (o *User) GetEmail() string` - -GetEmail returns the Email field if non-nil, zero value otherwise. - -### GetEmailOk - -`func (o *User) GetEmailOk() (*string, bool)` - -GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEmail - -`func (o *User) SetEmail(v string)` - -SetEmail sets Email field to given value. - -### HasEmail - -`func (o *User) HasEmail() bool` - -HasEmail returns a boolean if a field has been set. - -### GetPassword - -`func (o *User) GetPassword() string` - -GetPassword returns the Password field if non-nil, zero value otherwise. - -### GetPasswordOk - -`func (o *User) GetPasswordOk() (*string, bool)` - -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPassword - -`func (o *User) SetPassword(v string)` - -SetPassword sets Password field to given value. - -### HasPassword - -`func (o *User) HasPassword() bool` - -HasPassword returns a boolean if a field has been set. - -### GetPhone - -`func (o *User) GetPhone() string` - -GetPhone returns the Phone field if non-nil, zero value otherwise. - -### GetPhoneOk - -`func (o *User) GetPhoneOk() (*string, bool)` - -GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPhone - -`func (o *User) SetPhone(v string)` - -SetPhone sets Phone field to given value. - -### HasPhone - -`func (o *User) HasPhone() bool` - -HasPhone returns a boolean if a field has been set. - -### GetUserStatus - -`func (o *User) GetUserStatus() int32` - -GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. - -### GetUserStatusOk - -`func (o *User) GetUserStatusOk() (*int32, bool)` - -GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetUserStatus - -`func (o *User) SetUserStatus(v int32)` - -SetUserStatus sets UserStatus field to given value. - -### HasUserStatus - -`func (o *User) HasUserStatus() bool` - -HasUserStatus returns a boolean if a field has been set. - -### GetArbitraryObject - -`func (o *User) GetArbitraryObject() map[string]interface{}` - -GetArbitraryObject returns the ArbitraryObject field if non-nil, zero value otherwise. - -### GetArbitraryObjectOk - -`func (o *User) GetArbitraryObjectOk() (*map[string]interface{}, bool)` - -GetArbitraryObjectOk returns a tuple with the ArbitraryObject field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArbitraryObject - -`func (o *User) SetArbitraryObject(v map[string]interface{})` - -SetArbitraryObject sets ArbitraryObject field to given value. - -### HasArbitraryObject - -`func (o *User) HasArbitraryObject() bool` - -HasArbitraryObject returns a boolean if a field has been set. - -### GetArbitraryNullableObject - -`func (o *User) GetArbitraryNullableObject() map[string]interface{}` - -GetArbitraryNullableObject returns the ArbitraryNullableObject field if non-nil, zero value otherwise. - -### GetArbitraryNullableObjectOk - -`func (o *User) GetArbitraryNullableObjectOk() (*map[string]interface{}, bool)` - -GetArbitraryNullableObjectOk returns a tuple with the ArbitraryNullableObject field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArbitraryNullableObject - -`func (o *User) SetArbitraryNullableObject(v map[string]interface{})` - -SetArbitraryNullableObject sets ArbitraryNullableObject field to given value. - -### HasArbitraryNullableObject - -`func (o *User) HasArbitraryNullableObject() bool` - -HasArbitraryNullableObject returns a boolean if a field has been set. - -### SetArbitraryNullableObjectNil - -`func (o *User) SetArbitraryNullableObjectNil(b bool)` - - SetArbitraryNullableObjectNil sets the value for ArbitraryNullableObject to be an explicit nil - -### UnsetArbitraryNullableObject -`func (o *User) UnsetArbitraryNullableObject()` - -UnsetArbitraryNullableObject ensures that no value is present for ArbitraryNullableObject, not even an explicit nil -### GetArbitraryTypeValue - -`func (o *User) GetArbitraryTypeValue() interface{}` - -GetArbitraryTypeValue returns the ArbitraryTypeValue field if non-nil, zero value otherwise. - -### GetArbitraryTypeValueOk - -`func (o *User) GetArbitraryTypeValueOk() (*interface{}, bool)` - -GetArbitraryTypeValueOk returns a tuple with the ArbitraryTypeValue field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArbitraryTypeValue - -`func (o *User) SetArbitraryTypeValue(v interface{})` - -SetArbitraryTypeValue sets ArbitraryTypeValue field to given value. - -### HasArbitraryTypeValue - -`func (o *User) HasArbitraryTypeValue() bool` - -HasArbitraryTypeValue returns a boolean if a field has been set. - -### SetArbitraryTypeValueNil - -`func (o *User) SetArbitraryTypeValueNil(b bool)` - - SetArbitraryTypeValueNil sets the value for ArbitraryTypeValue to be an explicit nil - -### UnsetArbitraryTypeValue -`func (o *User) UnsetArbitraryTypeValue()` - -UnsetArbitraryTypeValue ensures that no value is present for ArbitraryTypeValue, not even an explicit nil -### GetArbitraryNullableTypeValue - -`func (o *User) GetArbitraryNullableTypeValue() interface{}` - -GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field if non-nil, zero value otherwise. - -### GetArbitraryNullableTypeValueOk - -`func (o *User) GetArbitraryNullableTypeValueOk() (*interface{}, bool)` - -GetArbitraryNullableTypeValueOk returns a tuple with the ArbitraryNullableTypeValue field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetArbitraryNullableTypeValue - -`func (o *User) SetArbitraryNullableTypeValue(v interface{})` - -SetArbitraryNullableTypeValue sets ArbitraryNullableTypeValue field to given value. - -### HasArbitraryNullableTypeValue - -`func (o *User) HasArbitraryNullableTypeValue() bool` - -HasArbitraryNullableTypeValue returns a boolean if a field has been set. - -### SetArbitraryNullableTypeValueNil - -`func (o *User) SetArbitraryNullableTypeValueNil(b bool)` - - SetArbitraryNullableTypeValueNil sets the value for ArbitraryNullableTypeValue to be an explicit nil - -### UnsetArbitraryNullableTypeValue -`func (o *User) UnsetArbitraryNullableTypeValue()` - -UnsetArbitraryNullableTypeValue ensures that no value is present for ArbitraryNullableTypeValue, not even an explicit nil - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md deleted file mode 100644 index 71205efd786..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md +++ /dev/null @@ -1,533 +0,0 @@ -# \UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateUser**](UserApi.md#CreateUser) | **Post** /user | Create user -[**CreateUsersWithArrayInput**](UserApi.md#CreateUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array -[**CreateUsersWithListInput**](UserApi.md#CreateUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array -[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /user/{username} | Delete user -[**GetUserByName**](UserApi.md#GetUserByName) | **Get** /user/{username} | Get user by user name -[**LoginUser**](UserApi.md#LoginUser) | **Get** /user/login | Logs user into the system -[**LogoutUser**](UserApi.md#LogoutUser) | **Get** /user/logout | Logs out current logged in user session -[**UpdateUser**](UserApi.md#UpdateUser) | **Put** /user/{username} | Updated user - - - -## CreateUser - -> CreateUser(ctx).User(user).Execute() - -Create user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - user := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123, ArbitraryObject: 123, ArbitraryNullableObject: 123, ArbitraryTypeValue: 123, ArbitraryNullableTypeValue: 123} // User | Created user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUser(context.Background(), user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md) | Created user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## CreateUsersWithArrayInput - -> CreateUsersWithArrayInput(ctx).User(user).Execute() - -Creates list of users with given input array - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - user := []User{openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123, ArbitraryObject: 123, ArbitraryNullableObject: 123, ArbitraryTypeValue: 123, ArbitraryNullableTypeValue: 123}} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background(), user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUsersWithArrayInputRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[]User**](User.md) | List of user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## CreateUsersWithListInput - -> CreateUsersWithListInput(ctx).User(user).Execute() - -Creates list of users with given input array - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - user := []User{} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background(), user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUsersWithListInputRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[]User**](User.md) | List of user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeleteUser - -> DeleteUser(ctx, username).Execute() - -Delete user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | The name that needs to be deleted - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string** | The name that needs to be deleted | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetUserByName - -> User GetUserByName(ctx, username).Execute() - -Get user by user name - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUserByName`: User - fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserByName`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string** | The name that needs to be fetched. Use user1 for testing. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetUserByNameRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## LoginUser - -> string LoginUser(ctx).Username(username).Password(password).Execute() - -Logs user into the system - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | The user name for login - password := "password_example" // string | The password for login in clear text - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LoginUser(context.Background(), username, password).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `LoginUser`: string - fmt.Fprintf(os.Stdout, "Response from `UserApi.LoginUser`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiLoginUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string** | The user name for login | - **password** | **string** | The password for login in clear text | - -### Return type - -**string** - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## LogoutUser - -> LogoutUser(ctx).Execute() - -Logs out current logged in user session - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.LogoutUser(context.Background(), ).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiLogoutUserRequest struct via the builder pattern - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## UpdateUser - -> UpdateUser(ctx, username).User(user).Execute() - -Updated user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - username := "username_example" // string | name that need to be deleted - user := // User | Updated user object - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username, user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string** | name that need to be deleted | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **user** | [**User**](User.md) | Updated user object | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh b/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh deleted file mode 100644 index ced3be2b0c7..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod deleted file mode 100644 index f9811556cc5..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/GIT_USER_ID/GIT_REPO_ID - -go 1.13 - -require ( - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 -) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum deleted file mode 100644 index ce55b3c6a08..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum +++ /dev/null @@ -1,15 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go deleted file mode 100644 index f1dcea6f973..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Model200Response Model for testing model name starting with number -type Model200Response struct { - Name *int32 `json:"name,omitempty"` - Class *string `json:"class,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Model200Response Model200Response - -// NewModel200Response instantiates a new Model200Response object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewModel200Response() *Model200Response { - this := Model200Response{} - return &this -} - -// NewModel200ResponseWithDefaults instantiates a new Model200Response object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewModel200ResponseWithDefaults() *Model200Response { - this := Model200Response{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Model200Response) GetName() int32 { - if o == nil || o.Name == nil { - var ret int32 - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model200Response) GetNameOk() (*int32, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *Model200Response) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given int32 and assigns it to the Name field. -func (o *Model200Response) SetName(v int32) { - o.Name = &v -} - -// GetClass returns the Class field value if set, zero value otherwise. -func (o *Model200Response) GetClass() string { - if o == nil || o.Class == nil { - var ret string - return ret - } - return *o.Class -} - -// GetClassOk returns a tuple with the Class field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model200Response) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false - } - return o.Class, true -} - -// HasClass returns a boolean if a field has been set. -func (o *Model200Response) HasClass() bool { - if o != nil && o.Class != nil { - return true - } - - return false -} - -// SetClass gets a reference to the given string and assigns it to the Class field. -func (o *Model200Response) SetClass(v string) { - o.Class = &v -} - -func (o Model200Response) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Class != nil { - toSerialize["class"] = o.Class - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Model200Response) UnmarshalJSON(bytes []byte) (err error) { - varModel200Response := _Model200Response{} - - if err = json.Unmarshal(bytes, &varModel200Response); err == nil { - *o = Model200Response(varModel200Response) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "class") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableModel200Response struct { - value *Model200Response - isSet bool -} - -func (v NullableModel200Response) Get() *Model200Response { - return v.value -} - -func (v *NullableModel200Response) Set(val *Model200Response) { - v.value = val - v.isSet = true -} - -func (v NullableModel200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableModel200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModel200Response(val *Model200Response) *NullableModel200Response { - return &NullableModel200Response{value: val, isSet: true} -} - -func (v NullableModel200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModel200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go deleted file mode 100644 index 83aea0db4ea..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// SpecialModelName struct for SpecialModelName -type SpecialModelName struct { - SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` - AdditionalProperties map[string]interface{} -} - -type _SpecialModelName SpecialModelName - -// NewSpecialModelName instantiates a new SpecialModelName object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSpecialModelName() *SpecialModelName { - this := SpecialModelName{} - return &this -} - -// NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSpecialModelNameWithDefaults() *SpecialModelName { - this := SpecialModelName{} - return &this -} - -// GetSpecialPropertyName returns the SpecialPropertyName field value if set, zero value otherwise. -func (o *SpecialModelName) GetSpecialPropertyName() int64 { - if o == nil || o.SpecialPropertyName == nil { - var ret int64 - return ret - } - return *o.SpecialPropertyName -} - -// GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool) { - if o == nil || o.SpecialPropertyName == nil { - return nil, false - } - return o.SpecialPropertyName, true -} - -// HasSpecialPropertyName returns a boolean if a field has been set. -func (o *SpecialModelName) HasSpecialPropertyName() bool { - if o != nil && o.SpecialPropertyName != nil { - return true - } - - return false -} - -// SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. -func (o *SpecialModelName) SetSpecialPropertyName(v int64) { - o.SpecialPropertyName = &v -} - -func (o SpecialModelName) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.SpecialPropertyName != nil { - toSerialize["$special[property.name]"] = o.SpecialPropertyName - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *SpecialModelName) UnmarshalJSON(bytes []byte) (err error) { - varSpecialModelName := _SpecialModelName{} - - if err = json.Unmarshal(bytes, &varSpecialModelName); err == nil { - *o = SpecialModelName(varSpecialModelName) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "$special[property.name]") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableSpecialModelName struct { - value *SpecialModelName - isSet bool -} - -func (v NullableSpecialModelName) Get() *SpecialModelName { - return v.value -} - -func (v *NullableSpecialModelName) Set(val *SpecialModelName) { - v.value = val - v.isSet = true -} - -func (v NullableSpecialModelName) IsSet() bool { - return v.isSet -} - -func (v *NullableSpecialModelName) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSpecialModelName(val *SpecialModelName) *NullableSpecialModelName { - return &NullableSpecialModelName{value: val, isSet: true} -} - -func (v NullableSpecialModelName) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSpecialModelName) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go deleted file mode 100644 index 927cd61dc49..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// AdditionalPropertiesClass struct for AdditionalPropertiesClass -type AdditionalPropertiesClass struct { - MapProperty *map[string]string `json:"map_property,omitempty"` - MapOfMapProperty *map[string]map[string]string `json:"map_of_map_property,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _AdditionalPropertiesClass AdditionalPropertiesClass - -// NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAdditionalPropertiesClass() *AdditionalPropertiesClass { - this := AdditionalPropertiesClass{} - return &this -} - -// NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass { - this := AdditionalPropertiesClass{} - return &this -} - -// GetMapProperty returns the MapProperty field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string { - if o == nil || o.MapProperty == nil { - var ret map[string]string - return ret - } - return *o.MapProperty -} - -// GetMapPropertyOk returns a tuple with the MapProperty field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapPropertyOk() (*map[string]string, bool) { - if o == nil || o.MapProperty == nil { - return nil, false - } - return o.MapProperty, true -} - -// HasMapProperty returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapProperty() bool { - if o != nil && o.MapProperty != nil { - return true - } - - return false -} - -// SetMapProperty gets a reference to the given map[string]string and assigns it to the MapProperty field. -func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string) { - o.MapProperty = &v -} - -// GetMapOfMapProperty returns the MapOfMapProperty field value if set, zero value otherwise. -func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string { - if o == nil || o.MapOfMapProperty == nil { - var ret map[string]map[string]string - return ret - } - return *o.MapOfMapProperty -} - -// GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapOfMapProperty == nil { - return nil, false - } - return o.MapOfMapProperty, true -} - -// HasMapOfMapProperty returns a boolean if a field has been set. -func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool { - if o != nil && o.MapOfMapProperty != nil { - return true - } - - return false -} - -// SetMapOfMapProperty gets a reference to the given map[string]map[string]string and assigns it to the MapOfMapProperty field. -func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string) { - o.MapOfMapProperty = &v -} - -func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MapProperty != nil { - toSerialize["map_property"] = o.MapProperty - } - if o.MapOfMapProperty != nil { - toSerialize["map_of_map_property"] = o.MapOfMapProperty - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *AdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) { - varAdditionalPropertiesClass := _AdditionalPropertiesClass{} - - if err = json.Unmarshal(bytes, &varAdditionalPropertiesClass); err == nil { - *o = AdditionalPropertiesClass(varAdditionalPropertiesClass) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "map_property") - delete(additionalProperties, "map_of_map_property") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableAdditionalPropertiesClass struct { - value *AdditionalPropertiesClass - isSet bool -} - -func (v NullableAdditionalPropertiesClass) Get() *AdditionalPropertiesClass { - return v.value -} - -func (v *NullableAdditionalPropertiesClass) Set(val *AdditionalPropertiesClass) { - v.value = val - v.isSet = true -} - -func (v NullableAdditionalPropertiesClass) IsSet() bool { - return v.isSet -} - -func (v *NullableAdditionalPropertiesClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAdditionalPropertiesClass(val *AdditionalPropertiesClass) *NullableAdditionalPropertiesClass { - return &NullableAdditionalPropertiesClass{value: val, isSet: true} -} - -func (v NullableAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go deleted file mode 100644 index de5e106e58b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go +++ /dev/null @@ -1,173 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Animal struct for Animal -type Animal struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Animal Animal - -// NewAnimal instantiates a new Animal object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewAnimal(className string, ) *Animal { - this := Animal{} - this.ClassName = className - var color string = "red" - this.Color = &color - return &this -} - -// NewAnimalWithDefaults instantiates a new Animal object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewAnimalWithDefaults() *Animal { - this := Animal{} - var color string = "red" - this.Color = &color - return &this -} - -// GetClassName returns the ClassName field value -func (o *Animal) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// GetClassNameOk returns a tuple with the ClassName field value -// and a boolean to check if the value has been set. -func (o *Animal) GetClassNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.ClassName, true -} - -// SetClassName sets field value -func (o *Animal) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *Animal) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Animal) GetColorOk() (*string, bool) { - if o == nil || o.Color == nil { - return nil, false - } - return o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *Animal) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *Animal) SetColor(v string) { - o.Color = &v -} - -func (o Animal) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["className"] = o.ClassName - } - if o.Color != nil { - toSerialize["color"] = o.Color - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Animal) UnmarshalJSON(bytes []byte) (err error) { - varAnimal := _Animal{} - - if err = json.Unmarshal(bytes, &varAnimal); err == nil { - *o = Animal(varAnimal) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "className") - delete(additionalProperties, "color") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableAnimal struct { - value *Animal - isSet bool -} - -func (v NullableAnimal) Get() *Animal { - return v.value -} - -func (v *NullableAnimal) Set(val *Animal) { - v.value = val - v.isSet = true -} - -func (v NullableAnimal) IsSet() bool { - return v.isSet -} - -func (v *NullableAnimal) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableAnimal(val *Animal) *NullableAnimal { - return &NullableAnimal{value: val, isSet: true} -} - -func (v NullableAnimal) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableAnimal) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go deleted file mode 100644 index c73431ad186..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go +++ /dev/null @@ -1,213 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ApiResponse struct for ApiResponse -type ApiResponse struct { - Code *int32 `json:"code,omitempty"` - Type *string `json:"type,omitempty"` - Message *string `json:"message,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ApiResponse ApiResponse - -// NewApiResponse instantiates a new ApiResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewApiResponse() *ApiResponse { - this := ApiResponse{} - return &this -} - -// NewApiResponseWithDefaults instantiates a new ApiResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewApiResponseWithDefaults() *ApiResponse { - this := ApiResponse{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *ApiResponse) GetCode() int32 { - if o == nil || o.Code == nil { - var ret int32 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetCodeOk() (*int32, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *ApiResponse) HasCode() bool { - if o != nil && o.Code != nil { - return true - } - - return false -} - -// SetCode gets a reference to the given int32 and assigns it to the Code field. -func (o *ApiResponse) SetCode(v int32) { - o.Code = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *ApiResponse) GetType() string { - if o == nil || o.Type == nil { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *ApiResponse) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *ApiResponse) SetType(v string) { - o.Type = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ApiResponse) GetMessage() string { - if o == nil || o.Message == nil { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ApiResponse) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ApiResponse) SetMessage(v string) { - o.Message = &v -} - -func (o ApiResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - if o.Message != nil { - toSerialize["message"] = o.Message - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ApiResponse) UnmarshalJSON(bytes []byte) (err error) { - varApiResponse := _ApiResponse{} - - if err = json.Unmarshal(bytes, &varApiResponse); err == nil { - *o = ApiResponse(varApiResponse) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "code") - delete(additionalProperties, "type") - delete(additionalProperties, "message") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableApiResponse struct { - value *ApiResponse - isSet bool -} - -func (v NullableApiResponse) Get() *ApiResponse { - return v.value -} - -func (v *NullableApiResponse) Set(val *ApiResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiResponse(val *ApiResponse) *NullableApiResponse { - return &NullableApiResponse{value: val, isSet: true} -} - -func (v NullableApiResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go deleted file mode 100644 index 1af9a061306..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly -type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ArrayOfArrayOfNumberOnly ArrayOfArrayOfNumberOnly - -// NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly { - this := ArrayOfArrayOfNumberOnly{} - return &this -} - -// NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly { - this := ArrayOfArrayOfNumberOnly{} - return &this -} - -// GetArrayArrayNumber returns the ArrayArrayNumber field value if set, zero value otherwise. -func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { - if o == nil || o.ArrayArrayNumber == nil { - var ret [][]float32 - return ret - } - return *o.ArrayArrayNumber -} - -// GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool) { - if o == nil || o.ArrayArrayNumber == nil { - return nil, false - } - return o.ArrayArrayNumber, true -} - -// HasArrayArrayNumber returns a boolean if a field has been set. -func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { - if o != nil && o.ArrayArrayNumber != nil { - return true - } - - return false -} - -// SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. -func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { - o.ArrayArrayNumber = &v -} - -func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ArrayArrayNumber != nil { - toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ArrayOfArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) { - varArrayOfArrayOfNumberOnly := _ArrayOfArrayOfNumberOnly{} - - if err = json.Unmarshal(bytes, &varArrayOfArrayOfNumberOnly); err == nil { - *o = ArrayOfArrayOfNumberOnly(varArrayOfArrayOfNumberOnly) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "ArrayArrayNumber") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableArrayOfArrayOfNumberOnly struct { - value *ArrayOfArrayOfNumberOnly - isSet bool -} - -func (v NullableArrayOfArrayOfNumberOnly) Get() *ArrayOfArrayOfNumberOnly { - return v.value -} - -func (v *NullableArrayOfArrayOfNumberOnly) Set(val *ArrayOfArrayOfNumberOnly) { - v.value = val - v.isSet = true -} - -func (v NullableArrayOfArrayOfNumberOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableArrayOfArrayOfNumberOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArrayOfArrayOfNumberOnly(val *ArrayOfArrayOfNumberOnly) *NullableArrayOfArrayOfNumberOnly { - return &NullableArrayOfArrayOfNumberOnly{value: val, isSet: true} -} - -func (v NullableArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArrayOfArrayOfNumberOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go deleted file mode 100644 index 7dcd1f46d30..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ArrayOfNumberOnly struct for ArrayOfNumberOnly -type ArrayOfNumberOnly struct { - ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ArrayOfNumberOnly ArrayOfNumberOnly - -// NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArrayOfNumberOnly() *ArrayOfNumberOnly { - this := ArrayOfNumberOnly{} - return &this -} - -// NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly { - this := ArrayOfNumberOnly{} - return &this -} - -// GetArrayNumber returns the ArrayNumber field value if set, zero value otherwise. -func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { - if o == nil || o.ArrayNumber == nil { - var ret []float32 - return ret - } - return *o.ArrayNumber -} - -// GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool) { - if o == nil || o.ArrayNumber == nil { - return nil, false - } - return o.ArrayNumber, true -} - -// HasArrayNumber returns a boolean if a field has been set. -func (o *ArrayOfNumberOnly) HasArrayNumber() bool { - if o != nil && o.ArrayNumber != nil { - return true - } - - return false -} - -// SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. -func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { - o.ArrayNumber = &v -} - -func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ArrayNumber != nil { - toSerialize["ArrayNumber"] = o.ArrayNumber - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) { - varArrayOfNumberOnly := _ArrayOfNumberOnly{} - - if err = json.Unmarshal(bytes, &varArrayOfNumberOnly); err == nil { - *o = ArrayOfNumberOnly(varArrayOfNumberOnly) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "ArrayNumber") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableArrayOfNumberOnly struct { - value *ArrayOfNumberOnly - isSet bool -} - -func (v NullableArrayOfNumberOnly) Get() *ArrayOfNumberOnly { - return v.value -} - -func (v *NullableArrayOfNumberOnly) Set(val *ArrayOfNumberOnly) { - v.value = val - v.isSet = true -} - -func (v NullableArrayOfNumberOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableArrayOfNumberOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArrayOfNumberOnly(val *ArrayOfNumberOnly) *NullableArrayOfNumberOnly { - return &NullableArrayOfNumberOnly{value: val, isSet: true} -} - -func (v NullableArrayOfNumberOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArrayOfNumberOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go deleted file mode 100644 index 40428c66d45..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ /dev/null @@ -1,213 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ArrayTest struct for ArrayTest -type ArrayTest struct { - ArrayOfString *[]string `json:"array_of_string,omitempty"` - ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` - ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ArrayTest ArrayTest - -// NewArrayTest instantiates a new ArrayTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewArrayTest() *ArrayTest { - this := ArrayTest{} - return &this -} - -// NewArrayTestWithDefaults instantiates a new ArrayTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewArrayTestWithDefaults() *ArrayTest { - this := ArrayTest{} - return &this -} - -// GetArrayOfString returns the ArrayOfString field value if set, zero value otherwise. -func (o *ArrayTest) GetArrayOfString() []string { - if o == nil || o.ArrayOfString == nil { - var ret []string - return ret - } - return *o.ArrayOfString -} - -// GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool) { - if o == nil || o.ArrayOfString == nil { - return nil, false - } - return o.ArrayOfString, true -} - -// HasArrayOfString returns a boolean if a field has been set. -func (o *ArrayTest) HasArrayOfString() bool { - if o != nil && o.ArrayOfString != nil { - return true - } - - return false -} - -// SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. -func (o *ArrayTest) SetArrayOfString(v []string) { - o.ArrayOfString = &v -} - -// GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. -func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { - if o == nil || o.ArrayArrayOfInteger == nil { - var ret [][]int64 - return ret - } - return *o.ArrayArrayOfInteger -} - -// GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool) { - if o == nil || o.ArrayArrayOfInteger == nil { - return nil, false - } - return o.ArrayArrayOfInteger, true -} - -// HasArrayArrayOfInteger returns a boolean if a field has been set. -func (o *ArrayTest) HasArrayArrayOfInteger() bool { - if o != nil && o.ArrayArrayOfInteger != nil { - return true - } - - return false -} - -// SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. -func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { - o.ArrayArrayOfInteger = &v -} - -// GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. -func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { - if o == nil || o.ArrayArrayOfModel == nil { - var ret [][]ReadOnlyFirst - return ret - } - return *o.ArrayArrayOfModel -} - -// GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool) { - if o == nil || o.ArrayArrayOfModel == nil { - return nil, false - } - return o.ArrayArrayOfModel, true -} - -// HasArrayArrayOfModel returns a boolean if a field has been set. -func (o *ArrayTest) HasArrayArrayOfModel() bool { - if o != nil && o.ArrayArrayOfModel != nil { - return true - } - - return false -} - -// SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. -func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { - o.ArrayArrayOfModel = &v -} - -func (o ArrayTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ArrayOfString != nil { - toSerialize["array_of_string"] = o.ArrayOfString - } - if o.ArrayArrayOfInteger != nil { - toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger - } - if o.ArrayArrayOfModel != nil { - toSerialize["array_array_of_model"] = o.ArrayArrayOfModel - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ArrayTest) UnmarshalJSON(bytes []byte) (err error) { - varArrayTest := _ArrayTest{} - - if err = json.Unmarshal(bytes, &varArrayTest); err == nil { - *o = ArrayTest(varArrayTest) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "array_of_string") - delete(additionalProperties, "array_array_of_integer") - delete(additionalProperties, "array_array_of_model") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableArrayTest struct { - value *ArrayTest - isSet bool -} - -func (v NullableArrayTest) Get() *ArrayTest { - return v.value -} - -func (v *NullableArrayTest) Set(val *ArrayTest) { - v.value = val - v.isSet = true -} - -func (v NullableArrayTest) IsSet() bool { - return v.isSet -} - -func (v *NullableArrayTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableArrayTest(val *ArrayTest) *NullableArrayTest { - return &NullableArrayTest{value: val, isSet: true} -} - -func (v NullableArrayTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableArrayTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go deleted file mode 100644 index 8cf8aa20b0d..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ /dev/null @@ -1,325 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Capitalization struct for Capitalization -type Capitalization struct { - SmallCamel *string `json:"smallCamel,omitempty"` - CapitalCamel *string `json:"CapitalCamel,omitempty"` - SmallSnake *string `json:"small_Snake,omitempty"` - CapitalSnake *string `json:"Capital_Snake,omitempty"` - SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` - // Name of the pet - ATT_NAME *string `json:"ATT_NAME,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Capitalization Capitalization - -// NewCapitalization instantiates a new Capitalization object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCapitalization() *Capitalization { - this := Capitalization{} - return &this -} - -// NewCapitalizationWithDefaults instantiates a new Capitalization object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCapitalizationWithDefaults() *Capitalization { - this := Capitalization{} - return &this -} - -// GetSmallCamel returns the SmallCamel field value if set, zero value otherwise. -func (o *Capitalization) GetSmallCamel() string { - if o == nil || o.SmallCamel == nil { - var ret string - return ret - } - return *o.SmallCamel -} - -// GetSmallCamelOk returns a tuple with the SmallCamel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetSmallCamelOk() (*string, bool) { - if o == nil || o.SmallCamel == nil { - return nil, false - } - return o.SmallCamel, true -} - -// HasSmallCamel returns a boolean if a field has been set. -func (o *Capitalization) HasSmallCamel() bool { - if o != nil && o.SmallCamel != nil { - return true - } - - return false -} - -// SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. -func (o *Capitalization) SetSmallCamel(v string) { - o.SmallCamel = &v -} - -// GetCapitalCamel returns the CapitalCamel field value if set, zero value otherwise. -func (o *Capitalization) GetCapitalCamel() string { - if o == nil || o.CapitalCamel == nil { - var ret string - return ret - } - return *o.CapitalCamel -} - -// GetCapitalCamelOk returns a tuple with the CapitalCamel field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetCapitalCamelOk() (*string, bool) { - if o == nil || o.CapitalCamel == nil { - return nil, false - } - return o.CapitalCamel, true -} - -// HasCapitalCamel returns a boolean if a field has been set. -func (o *Capitalization) HasCapitalCamel() bool { - if o != nil && o.CapitalCamel != nil { - return true - } - - return false -} - -// SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. -func (o *Capitalization) SetCapitalCamel(v string) { - o.CapitalCamel = &v -} - -// GetSmallSnake returns the SmallSnake field value if set, zero value otherwise. -func (o *Capitalization) GetSmallSnake() string { - if o == nil || o.SmallSnake == nil { - var ret string - return ret - } - return *o.SmallSnake -} - -// GetSmallSnakeOk returns a tuple with the SmallSnake field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetSmallSnakeOk() (*string, bool) { - if o == nil || o.SmallSnake == nil { - return nil, false - } - return o.SmallSnake, true -} - -// HasSmallSnake returns a boolean if a field has been set. -func (o *Capitalization) HasSmallSnake() bool { - if o != nil && o.SmallSnake != nil { - return true - } - - return false -} - -// SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. -func (o *Capitalization) SetSmallSnake(v string) { - o.SmallSnake = &v -} - -// GetCapitalSnake returns the CapitalSnake field value if set, zero value otherwise. -func (o *Capitalization) GetCapitalSnake() string { - if o == nil || o.CapitalSnake == nil { - var ret string - return ret - } - return *o.CapitalSnake -} - -// GetCapitalSnakeOk returns a tuple with the CapitalSnake field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetCapitalSnakeOk() (*string, bool) { - if o == nil || o.CapitalSnake == nil { - return nil, false - } - return o.CapitalSnake, true -} - -// HasCapitalSnake returns a boolean if a field has been set. -func (o *Capitalization) HasCapitalSnake() bool { - if o != nil && o.CapitalSnake != nil { - return true - } - - return false -} - -// SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. -func (o *Capitalization) SetCapitalSnake(v string) { - o.CapitalSnake = &v -} - -// GetSCAETHFlowPoints returns the SCAETHFlowPoints field value if set, zero value otherwise. -func (o *Capitalization) GetSCAETHFlowPoints() string { - if o == nil || o.SCAETHFlowPoints == nil { - var ret string - return ret - } - return *o.SCAETHFlowPoints -} - -// GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool) { - if o == nil || o.SCAETHFlowPoints == nil { - return nil, false - } - return o.SCAETHFlowPoints, true -} - -// HasSCAETHFlowPoints returns a boolean if a field has been set. -func (o *Capitalization) HasSCAETHFlowPoints() bool { - if o != nil && o.SCAETHFlowPoints != nil { - return true - } - - return false -} - -// SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. -func (o *Capitalization) SetSCAETHFlowPoints(v string) { - o.SCAETHFlowPoints = &v -} - -// GetATT_NAME returns the ATT_NAME field value if set, zero value otherwise. -func (o *Capitalization) GetATT_NAME() string { - if o == nil || o.ATT_NAME == nil { - var ret string - return ret - } - return *o.ATT_NAME -} - -// GetATT_NAMEOk returns a tuple with the ATT_NAME field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Capitalization) GetATT_NAMEOk() (*string, bool) { - if o == nil || o.ATT_NAME == nil { - return nil, false - } - return o.ATT_NAME, true -} - -// HasATT_NAME returns a boolean if a field has been set. -func (o *Capitalization) HasATT_NAME() bool { - if o != nil && o.ATT_NAME != nil { - return true - } - - return false -} - -// SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. -func (o *Capitalization) SetATT_NAME(v string) { - o.ATT_NAME = &v -} - -func (o Capitalization) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.SmallCamel != nil { - toSerialize["smallCamel"] = o.SmallCamel - } - if o.CapitalCamel != nil { - toSerialize["CapitalCamel"] = o.CapitalCamel - } - if o.SmallSnake != nil { - toSerialize["small_Snake"] = o.SmallSnake - } - if o.CapitalSnake != nil { - toSerialize["Capital_Snake"] = o.CapitalSnake - } - if o.SCAETHFlowPoints != nil { - toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints - } - if o.ATT_NAME != nil { - toSerialize["ATT_NAME"] = o.ATT_NAME - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Capitalization) UnmarshalJSON(bytes []byte) (err error) { - varCapitalization := _Capitalization{} - - if err = json.Unmarshal(bytes, &varCapitalization); err == nil { - *o = Capitalization(varCapitalization) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "smallCamel") - delete(additionalProperties, "CapitalCamel") - delete(additionalProperties, "small_Snake") - delete(additionalProperties, "Capital_Snake") - delete(additionalProperties, "SCA_ETH_Flow_Points") - delete(additionalProperties, "ATT_NAME") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCapitalization struct { - value *Capitalization - isSet bool -} - -func (v NullableCapitalization) Get() *Capitalization { - return v.value -} - -func (v *NullableCapitalization) Set(val *Capitalization) { - v.value = val - v.isSet = true -} - -func (v NullableCapitalization) IsSet() bool { - return v.isSet -} - -func (v *NullableCapitalization) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCapitalization(val *Capitalization) *NullableCapitalization { - return &NullableCapitalization{value: val, isSet: true} -} - -func (v NullableCapitalization) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCapitalization) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go deleted file mode 100644 index 5bd129f1f76..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go +++ /dev/null @@ -1,187 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "reflect" - "strings" -) - -// Cat struct for Cat -type Cat struct { - Animal - Declawed *bool `json:"declawed,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Cat Cat - -// NewCat instantiates a new Cat object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCat() *Cat { - this := Cat{} - return &this -} - -// NewCatWithDefaults instantiates a new Cat object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCatWithDefaults() *Cat { - this := Cat{} - return &this -} - -// GetDeclawed returns the Declawed field value if set, zero value otherwise. -func (o *Cat) GetDeclawed() bool { - if o == nil || o.Declawed == nil { - var ret bool - return ret - } - return *o.Declawed -} - -// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Cat) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false - } - return o.Declawed, true -} - -// HasDeclawed returns a boolean if a field has been set. -func (o *Cat) HasDeclawed() bool { - if o != nil && o.Declawed != nil { - return true - } - - return false -} - -// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. -func (o *Cat) SetDeclawed(v bool) { - o.Declawed = &v -} - -func (o Cat) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - serializedAnimal, errAnimal := json.Marshal(o.Animal) - if errAnimal != nil { - return []byte{}, errAnimal - } - errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) - if errAnimal != nil { - return []byte{}, errAnimal - } - if o.Declawed != nil { - toSerialize["declawed"] = o.Declawed - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Cat) UnmarshalJSON(bytes []byte) (err error) { - type CatWithoutEmbeddedStruct struct { - Declawed *bool `json:"declawed,omitempty"` - } - - varCatWithoutEmbeddedStruct := CatWithoutEmbeddedStruct{} - - err = json.Unmarshal(bytes, &varCatWithoutEmbeddedStruct) - if err == nil { - varCat := _Cat{} - varCat.Declawed = varCatWithoutEmbeddedStruct.Declawed - *o = Cat(varCat) - } else { - return err - } - - varCat := _Cat{} - - err = json.Unmarshal(bytes, &varCat) - if err == nil { - o.Animal = varCat.Animal - } else { - return err - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "declawed") - - // remove fields from embedded structs - reflectAnimal := reflect.ValueOf(o.Animal) - for i := 0; i < reflectAnimal.Type().NumField(); i++ { - t := reflectAnimal.Type().Field(i) - - if jsonTag := t.Tag.Get("json"); jsonTag != "" { - fieldName := "" - if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { - fieldName = jsonTag[:commaIdx] - } else { - fieldName = jsonTag - } - if fieldName != "AdditionalProperties" { - delete(additionalProperties, fieldName) - } - } - } - - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCat struct { - value *Cat - isSet bool -} - -func (v NullableCat) Get() *Cat { - return v.value -} - -func (v *NullableCat) Set(val *Cat) { - v.value = val - v.isSet = true -} - -func (v NullableCat) IsSet() bool { - return v.isSet -} - -func (v *NullableCat) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCat(val *Cat) *NullableCat { - return &NullableCat{value: val, isSet: true} -} - -func (v NullableCat) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCat) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go deleted file mode 100644 index ba8ba01e4eb..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// CatAllOf struct for CatAllOf -type CatAllOf struct { - Declawed *bool `json:"declawed,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _CatAllOf CatAllOf - -// NewCatAllOf instantiates a new CatAllOf object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCatAllOf() *CatAllOf { - this := CatAllOf{} - return &this -} - -// NewCatAllOfWithDefaults instantiates a new CatAllOf object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCatAllOfWithDefaults() *CatAllOf { - this := CatAllOf{} - return &this -} - -// GetDeclawed returns the Declawed field value if set, zero value otherwise. -func (o *CatAllOf) GetDeclawed() bool { - if o == nil || o.Declawed == nil { - var ret bool - return ret - } - return *o.Declawed -} - -// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CatAllOf) GetDeclawedOk() (*bool, bool) { - if o == nil || o.Declawed == nil { - return nil, false - } - return o.Declawed, true -} - -// HasDeclawed returns a boolean if a field has been set. -func (o *CatAllOf) HasDeclawed() bool { - if o != nil && o.Declawed != nil { - return true - } - - return false -} - -// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. -func (o *CatAllOf) SetDeclawed(v bool) { - o.Declawed = &v -} - -func (o CatAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Declawed != nil { - toSerialize["declawed"] = o.Declawed - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *CatAllOf) UnmarshalJSON(bytes []byte) (err error) { - varCatAllOf := _CatAllOf{} - - if err = json.Unmarshal(bytes, &varCatAllOf); err == nil { - *o = CatAllOf(varCatAllOf) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "declawed") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCatAllOf struct { - value *CatAllOf - isSet bool -} - -func (v NullableCatAllOf) Get() *CatAllOf { - return v.value -} - -func (v *NullableCatAllOf) Set(val *CatAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableCatAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableCatAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCatAllOf(val *CatAllOf) *NullableCatAllOf { - return &NullableCatAllOf{value: val, isSet: true} -} - -func (v NullableCatAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCatAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go deleted file mode 100644 index 6844fcaa2a6..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go +++ /dev/null @@ -1,171 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Category struct for Category -type Category struct { - Id *int64 `json:"id,omitempty"` - Name string `json:"name"` - AdditionalProperties map[string]interface{} -} - -type _Category Category - -// NewCategory instantiates a new Category object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewCategory(name string, ) *Category { - this := Category{} - this.Name = name - return &this -} - -// NewCategoryWithDefaults instantiates a new Category object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewCategoryWithDefaults() *Category { - this := Category{} - var name string = "default-name" - this.Name = name - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Category) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Category) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Category) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Category) SetId(v int64) { - o.Id = &v -} - -// GetName returns the Name field value -func (o *Category) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Category) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Category) SetName(v string) { - o.Name = v -} - -func (o Category) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if true { - toSerialize["name"] = o.Name - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Category) UnmarshalJSON(bytes []byte) (err error) { - varCategory := _Category{} - - if err = json.Unmarshal(bytes, &varCategory); err == nil { - *o = Category(varCategory) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableCategory struct { - value *Category - isSet bool -} - -func (v NullableCategory) Get() *Category { - return v.value -} - -func (v *NullableCategory) Set(val *Category) { - v.value = val - v.isSet = true -} - -func (v NullableCategory) IsSet() bool { - return v.isSet -} - -func (v *NullableCategory) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCategory(val *Category) *NullableCategory { - return &NullableCategory{value: val, isSet: true} -} - -func (v NullableCategory) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCategory) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go deleted file mode 100644 index dd0e8da5128..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ClassModel Model for testing model with \"_class\" property -type ClassModel struct { - Class *string `json:"_class,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ClassModel ClassModel - -// NewClassModel instantiates a new ClassModel object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewClassModel() *ClassModel { - this := ClassModel{} - return &this -} - -// NewClassModelWithDefaults instantiates a new ClassModel object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewClassModelWithDefaults() *ClassModel { - this := ClassModel{} - return &this -} - -// GetClass returns the Class field value if set, zero value otherwise. -func (o *ClassModel) GetClass() string { - if o == nil || o.Class == nil { - var ret string - return ret - } - return *o.Class -} - -// GetClassOk returns a tuple with the Class field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ClassModel) GetClassOk() (*string, bool) { - if o == nil || o.Class == nil { - return nil, false - } - return o.Class, true -} - -// HasClass returns a boolean if a field has been set. -func (o *ClassModel) HasClass() bool { - if o != nil && o.Class != nil { - return true - } - - return false -} - -// SetClass gets a reference to the given string and assigns it to the Class field. -func (o *ClassModel) SetClass(v string) { - o.Class = &v -} - -func (o ClassModel) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Class != nil { - toSerialize["_class"] = o.Class - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ClassModel) UnmarshalJSON(bytes []byte) (err error) { - varClassModel := _ClassModel{} - - if err = json.Unmarshal(bytes, &varClassModel); err == nil { - *o = ClassModel(varClassModel) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "_class") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableClassModel struct { - value *ClassModel - isSet bool -} - -func (v NullableClassModel) Get() *ClassModel { - return v.value -} - -func (v *NullableClassModel) Set(val *ClassModel) { - v.value = val - v.isSet = true -} - -func (v NullableClassModel) IsSet() bool { - return v.isSet -} - -func (v *NullableClassModel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClassModel(val *ClassModel) *NullableClassModel { - return &NullableClassModel{value: val, isSet: true} -} - -func (v NullableClassModel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClassModel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go deleted file mode 100644 index 4fa9c5c9613..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Client struct for Client -type Client struct { - Client *string `json:"client,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Client Client - -// NewClient instantiates a new Client object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewClient() *Client { - this := Client{} - return &this -} - -// NewClientWithDefaults instantiates a new Client object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewClientWithDefaults() *Client { - this := Client{} - return &this -} - -// GetClient returns the Client field value if set, zero value otherwise. -func (o *Client) GetClient() string { - if o == nil || o.Client == nil { - var ret string - return ret - } - return *o.Client -} - -// GetClientOk returns a tuple with the Client field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetClientOk() (*string, bool) { - if o == nil || o.Client == nil { - return nil, false - } - return o.Client, true -} - -// HasClient returns a boolean if a field has been set. -func (o *Client) HasClient() bool { - if o != nil && o.Client != nil { - return true - } - - return false -} - -// SetClient gets a reference to the given string and assigns it to the Client field. -func (o *Client) SetClient(v string) { - o.Client = &v -} - -func (o Client) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Client != nil { - toSerialize["client"] = o.Client - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Client) UnmarshalJSON(bytes []byte) (err error) { - varClient := _Client{} - - if err = json.Unmarshal(bytes, &varClient); err == nil { - *o = Client(varClient) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "client") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableClient struct { - value *Client - isSet bool -} - -func (v NullableClient) Get() *Client { - return v.value -} - -func (v *NullableClient) Set(val *Client) { - v.value = val - v.isSet = true -} - -func (v NullableClient) IsSet() bool { - return v.isSet -} - -func (v *NullableClient) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClient(val *Client) *NullableClient { - return &NullableClient{value: val, isSet: true} -} - -func (v NullableClient) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClient) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go deleted file mode 100644 index b3a1dcf1a6b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go +++ /dev/null @@ -1,187 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "reflect" - "strings" -) - -// Dog struct for Dog -type Dog struct { - Animal - Breed *string `json:"breed,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Dog Dog - -// NewDog instantiates a new Dog object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDog() *Dog { - this := Dog{} - return &this -} - -// NewDogWithDefaults instantiates a new Dog object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDogWithDefaults() *Dog { - this := Dog{} - return &this -} - -// GetBreed returns the Breed field value if set, zero value otherwise. -func (o *Dog) GetBreed() string { - if o == nil || o.Breed == nil { - var ret string - return ret - } - return *o.Breed -} - -// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Dog) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false - } - return o.Breed, true -} - -// HasBreed returns a boolean if a field has been set. -func (o *Dog) HasBreed() bool { - if o != nil && o.Breed != nil { - return true - } - - return false -} - -// SetBreed gets a reference to the given string and assigns it to the Breed field. -func (o *Dog) SetBreed(v string) { - o.Breed = &v -} - -func (o Dog) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - serializedAnimal, errAnimal := json.Marshal(o.Animal) - if errAnimal != nil { - return []byte{}, errAnimal - } - errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) - if errAnimal != nil { - return []byte{}, errAnimal - } - if o.Breed != nil { - toSerialize["breed"] = o.Breed - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Dog) UnmarshalJSON(bytes []byte) (err error) { - type DogWithoutEmbeddedStruct struct { - Breed *string `json:"breed,omitempty"` - } - - varDogWithoutEmbeddedStruct := DogWithoutEmbeddedStruct{} - - err = json.Unmarshal(bytes, &varDogWithoutEmbeddedStruct) - if err == nil { - varDog := _Dog{} - varDog.Breed = varDogWithoutEmbeddedStruct.Breed - *o = Dog(varDog) - } else { - return err - } - - varDog := _Dog{} - - err = json.Unmarshal(bytes, &varDog) - if err == nil { - o.Animal = varDog.Animal - } else { - return err - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "breed") - - // remove fields from embedded structs - reflectAnimal := reflect.ValueOf(o.Animal) - for i := 0; i < reflectAnimal.Type().NumField(); i++ { - t := reflectAnimal.Type().Field(i) - - if jsonTag := t.Tag.Get("json"); jsonTag != "" { - fieldName := "" - if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { - fieldName = jsonTag[:commaIdx] - } else { - fieldName = jsonTag - } - if fieldName != "AdditionalProperties" { - delete(additionalProperties, fieldName) - } - } - } - - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDog struct { - value *Dog - isSet bool -} - -func (v NullableDog) Get() *Dog { - return v.value -} - -func (v *NullableDog) Set(val *Dog) { - v.value = val - v.isSet = true -} - -func (v NullableDog) IsSet() bool { - return v.isSet -} - -func (v *NullableDog) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDog(val *Dog) *NullableDog { - return &NullableDog{value: val, isSet: true} -} - -func (v NullableDog) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDog) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go deleted file mode 100644 index 5a63ff7ab1f..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// DogAllOf struct for DogAllOf -type DogAllOf struct { - Breed *string `json:"breed,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _DogAllOf DogAllOf - -// NewDogAllOf instantiates a new DogAllOf object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewDogAllOf() *DogAllOf { - this := DogAllOf{} - return &this -} - -// NewDogAllOfWithDefaults instantiates a new DogAllOf object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewDogAllOfWithDefaults() *DogAllOf { - this := DogAllOf{} - return &this -} - -// GetBreed returns the Breed field value if set, zero value otherwise. -func (o *DogAllOf) GetBreed() string { - if o == nil || o.Breed == nil { - var ret string - return ret - } - return *o.Breed -} - -// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DogAllOf) GetBreedOk() (*string, bool) { - if o == nil || o.Breed == nil { - return nil, false - } - return o.Breed, true -} - -// HasBreed returns a boolean if a field has been set. -func (o *DogAllOf) HasBreed() bool { - if o != nil && o.Breed != nil { - return true - } - - return false -} - -// SetBreed gets a reference to the given string and assigns it to the Breed field. -func (o *DogAllOf) SetBreed(v string) { - o.Breed = &v -} - -func (o DogAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Breed != nil { - toSerialize["breed"] = o.Breed - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *DogAllOf) UnmarshalJSON(bytes []byte) (err error) { - varDogAllOf := _DogAllOf{} - - if err = json.Unmarshal(bytes, &varDogAllOf); err == nil { - *o = DogAllOf(varDogAllOf) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "breed") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableDogAllOf struct { - value *DogAllOf - isSet bool -} - -func (v NullableDogAllOf) Get() *DogAllOf { - return v.value -} - -func (v *NullableDogAllOf) Set(val *DogAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableDogAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableDogAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDogAllOf(val *DogAllOf) *NullableDogAllOf { - return &NullableDogAllOf{value: val, isSet: true} -} - -func (v NullableDogAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDogAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go deleted file mode 100644 index 5db0ec9b52b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// EnumArrays struct for EnumArrays -type EnumArrays struct { - JustSymbol *string `json:"just_symbol,omitempty"` - ArrayEnum *[]string `json:"array_enum,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _EnumArrays EnumArrays - -// NewEnumArrays instantiates a new EnumArrays object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnumArrays() *EnumArrays { - this := EnumArrays{} - return &this -} - -// NewEnumArraysWithDefaults instantiates a new EnumArrays object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnumArraysWithDefaults() *EnumArrays { - this := EnumArrays{} - return &this -} - -// GetJustSymbol returns the JustSymbol field value if set, zero value otherwise. -func (o *EnumArrays) GetJustSymbol() string { - if o == nil || o.JustSymbol == nil { - var ret string - return ret - } - return *o.JustSymbol -} - -// GetJustSymbolOk returns a tuple with the JustSymbol field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumArrays) GetJustSymbolOk() (*string, bool) { - if o == nil || o.JustSymbol == nil { - return nil, false - } - return o.JustSymbol, true -} - -// HasJustSymbol returns a boolean if a field has been set. -func (o *EnumArrays) HasJustSymbol() bool { - if o != nil && o.JustSymbol != nil { - return true - } - - return false -} - -// SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. -func (o *EnumArrays) SetJustSymbol(v string) { - o.JustSymbol = &v -} - -// GetArrayEnum returns the ArrayEnum field value if set, zero value otherwise. -func (o *EnumArrays) GetArrayEnum() []string { - if o == nil || o.ArrayEnum == nil { - var ret []string - return ret - } - return *o.ArrayEnum -} - -// GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool) { - if o == nil || o.ArrayEnum == nil { - return nil, false - } - return o.ArrayEnum, true -} - -// HasArrayEnum returns a boolean if a field has been set. -func (o *EnumArrays) HasArrayEnum() bool { - if o != nil && o.ArrayEnum != nil { - return true - } - - return false -} - -// SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. -func (o *EnumArrays) SetArrayEnum(v []string) { - o.ArrayEnum = &v -} - -func (o EnumArrays) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.JustSymbol != nil { - toSerialize["just_symbol"] = o.JustSymbol - } - if o.ArrayEnum != nil { - toSerialize["array_enum"] = o.ArrayEnum - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *EnumArrays) UnmarshalJSON(bytes []byte) (err error) { - varEnumArrays := _EnumArrays{} - - if err = json.Unmarshal(bytes, &varEnumArrays); err == nil { - *o = EnumArrays(varEnumArrays) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "just_symbol") - delete(additionalProperties, "array_enum") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableEnumArrays struct { - value *EnumArrays - isSet bool -} - -func (v NullableEnumArrays) Get() *EnumArrays { - return v.value -} - -func (v *NullableEnumArrays) Set(val *EnumArrays) { - v.value = val - v.isSet = true -} - -func (v NullableEnumArrays) IsSet() bool { - return v.isSet -} - -func (v *NullableEnumArrays) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnumArrays(val *EnumArrays) *NullableEnumArrays { - return &NullableEnumArrays{value: val, isSet: true} -} - -func (v NullableEnumArrays) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnumArrays) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go deleted file mode 100644 index 9c03714608c..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// EnumClass the model 'EnumClass' -type EnumClass string - -// List of EnumClass -const ( - ENUMCLASS_ABC EnumClass = "_abc" - ENUMCLASS_EFG EnumClass = "-efg" - ENUMCLASS_XYZ EnumClass = "(xyz)" -) - -func (v *EnumClass) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := EnumClass(value) - for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid EnumClass", value) -} - -// Ptr returns reference to EnumClass value -func (v EnumClass) Ptr() *EnumClass { - return &v -} - -type NullableEnumClass struct { - value *EnumClass - isSet bool -} - -func (v NullableEnumClass) Get() *EnumClass { - return v.value -} - -func (v *NullableEnumClass) Set(val *EnumClass) { - v.value = val - v.isSet = true -} - -func (v NullableEnumClass) IsSet() bool { - return v.isSet -} - -func (v *NullableEnumClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnumClass(val *EnumClass) *NullableEnumClass { - return &NullableEnumClass{value: val, isSet: true} -} - -func (v NullableEnumClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnumClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go deleted file mode 100644 index bc208327afa..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ /dev/null @@ -1,409 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// EnumTest struct for EnumTest -type EnumTest struct { - EnumString *string `json:"enum_string,omitempty"` - EnumStringRequired string `json:"enum_string_required"` - EnumInteger *int32 `json:"enum_integer,omitempty"` - EnumNumber *float64 `json:"enum_number,omitempty"` - OuterEnum NullableOuterEnum `json:"outerEnum,omitempty"` - OuterEnumInteger *OuterEnumInteger `json:"outerEnumInteger,omitempty"` - OuterEnumDefaultValue *OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` - OuterEnumIntegerDefaultValue *OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _EnumTest EnumTest - -// NewEnumTest instantiates a new EnumTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEnumTest(enumStringRequired string, ) *EnumTest { - this := EnumTest{} - this.EnumStringRequired = enumStringRequired - var outerEnumDefaultValue OuterEnumDefaultValue = "placed" - this.OuterEnumDefaultValue = &outerEnumDefaultValue - var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 - this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue - return &this -} - -// NewEnumTestWithDefaults instantiates a new EnumTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEnumTestWithDefaults() *EnumTest { - this := EnumTest{} - var outerEnumDefaultValue OuterEnumDefaultValue = "placed" - this.OuterEnumDefaultValue = &outerEnumDefaultValue - var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 - this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue - return &this -} - -// GetEnumString returns the EnumString field value if set, zero value otherwise. -func (o *EnumTest) GetEnumString() string { - if o == nil || o.EnumString == nil { - var ret string - return ret - } - return *o.EnumString -} - -// GetEnumStringOk returns a tuple with the EnumString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumStringOk() (*string, bool) { - if o == nil || o.EnumString == nil { - return nil, false - } - return o.EnumString, true -} - -// HasEnumString returns a boolean if a field has been set. -func (o *EnumTest) HasEnumString() bool { - if o != nil && o.EnumString != nil { - return true - } - - return false -} - -// SetEnumString gets a reference to the given string and assigns it to the EnumString field. -func (o *EnumTest) SetEnumString(v string) { - o.EnumString = &v -} - -// GetEnumStringRequired returns the EnumStringRequired field value -func (o *EnumTest) GetEnumStringRequired() string { - if o == nil { - var ret string - return ret - } - - return o.EnumStringRequired -} - -// GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field value -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.EnumStringRequired, true -} - -// SetEnumStringRequired sets field value -func (o *EnumTest) SetEnumStringRequired(v string) { - o.EnumStringRequired = v -} - -// GetEnumInteger returns the EnumInteger field value if set, zero value otherwise. -func (o *EnumTest) GetEnumInteger() int32 { - if o == nil || o.EnumInteger == nil { - var ret int32 - return ret - } - return *o.EnumInteger -} - -// GetEnumIntegerOk returns a tuple with the EnumInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumIntegerOk() (*int32, bool) { - if o == nil || o.EnumInteger == nil { - return nil, false - } - return o.EnumInteger, true -} - -// HasEnumInteger returns a boolean if a field has been set. -func (o *EnumTest) HasEnumInteger() bool { - if o != nil && o.EnumInteger != nil { - return true - } - - return false -} - -// SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. -func (o *EnumTest) SetEnumInteger(v int32) { - o.EnumInteger = &v -} - -// GetEnumNumber returns the EnumNumber field value if set, zero value otherwise. -func (o *EnumTest) GetEnumNumber() float64 { - if o == nil || o.EnumNumber == nil { - var ret float64 - return ret - } - return *o.EnumNumber -} - -// GetEnumNumberOk returns a tuple with the EnumNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetEnumNumberOk() (*float64, bool) { - if o == nil || o.EnumNumber == nil { - return nil, false - } - return o.EnumNumber, true -} - -// HasEnumNumber returns a boolean if a field has been set. -func (o *EnumTest) HasEnumNumber() bool { - if o != nil && o.EnumNumber != nil { - return true - } - - return false -} - -// SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. -func (o *EnumTest) SetEnumNumber(v float64) { - o.EnumNumber = &v -} - -// GetOuterEnum returns the OuterEnum field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *EnumTest) GetOuterEnum() OuterEnum { - if o == nil || o.OuterEnum.Get() == nil { - var ret OuterEnum - return ret - } - return *o.OuterEnum.Get() -} - -// GetOuterEnumOk returns a tuple with the OuterEnum field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { - if o == nil { - return nil, false - } - return o.OuterEnum.Get(), o.OuterEnum.IsSet() -} - -// HasOuterEnum returns a boolean if a field has been set. -func (o *EnumTest) HasOuterEnum() bool { - if o != nil && o.OuterEnum.IsSet() { - return true - } - - return false -} - -// SetOuterEnum gets a reference to the given NullableOuterEnum and assigns it to the OuterEnum field. -func (o *EnumTest) SetOuterEnum(v OuterEnum) { - o.OuterEnum.Set(&v) -} -// SetOuterEnumNil sets the value for OuterEnum to be an explicit nil -func (o *EnumTest) SetOuterEnumNil() { - o.OuterEnum.Set(nil) -} - -// UnsetOuterEnum ensures that no value is present for OuterEnum, not even an explicit nil -func (o *EnumTest) UnsetOuterEnum() { - o.OuterEnum.Unset() -} - -// GetOuterEnumInteger returns the OuterEnumInteger field value if set, zero value otherwise. -func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger { - if o == nil || o.OuterEnumInteger == nil { - var ret OuterEnumInteger - return ret - } - return *o.OuterEnumInteger -} - -// GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetOuterEnumIntegerOk() (*OuterEnumInteger, bool) { - if o == nil || o.OuterEnumInteger == nil { - return nil, false - } - return o.OuterEnumInteger, true -} - -// HasOuterEnumInteger returns a boolean if a field has been set. -func (o *EnumTest) HasOuterEnumInteger() bool { - if o != nil && o.OuterEnumInteger != nil { - return true - } - - return false -} - -// SetOuterEnumInteger gets a reference to the given OuterEnumInteger and assigns it to the OuterEnumInteger field. -func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger) { - o.OuterEnumInteger = &v -} - -// GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field value if set, zero value otherwise. -func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue { - if o == nil || o.OuterEnumDefaultValue == nil { - var ret OuterEnumDefaultValue - return ret - } - return *o.OuterEnumDefaultValue -} - -// GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetOuterEnumDefaultValueOk() (*OuterEnumDefaultValue, bool) { - if o == nil || o.OuterEnumDefaultValue == nil { - return nil, false - } - return o.OuterEnumDefaultValue, true -} - -// HasOuterEnumDefaultValue returns a boolean if a field has been set. -func (o *EnumTest) HasOuterEnumDefaultValue() bool { - if o != nil && o.OuterEnumDefaultValue != nil { - return true - } - - return false -} - -// SetOuterEnumDefaultValue gets a reference to the given OuterEnumDefaultValue and assigns it to the OuterEnumDefaultValue field. -func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue) { - o.OuterEnumDefaultValue = &v -} - -// GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field value if set, zero value otherwise. -func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue { - if o == nil || o.OuterEnumIntegerDefaultValue == nil { - var ret OuterEnumIntegerDefaultValue - return ret - } - return *o.OuterEnumIntegerDefaultValue -} - -// GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (*OuterEnumIntegerDefaultValue, bool) { - if o == nil || o.OuterEnumIntegerDefaultValue == nil { - return nil, false - } - return o.OuterEnumIntegerDefaultValue, true -} - -// HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. -func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool { - if o != nil && o.OuterEnumIntegerDefaultValue != nil { - return true - } - - return false -} - -// SetOuterEnumIntegerDefaultValue gets a reference to the given OuterEnumIntegerDefaultValue and assigns it to the OuterEnumIntegerDefaultValue field. -func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue) { - o.OuterEnumIntegerDefaultValue = &v -} - -func (o EnumTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.EnumString != nil { - toSerialize["enum_string"] = o.EnumString - } - if true { - toSerialize["enum_string_required"] = o.EnumStringRequired - } - if o.EnumInteger != nil { - toSerialize["enum_integer"] = o.EnumInteger - } - if o.EnumNumber != nil { - toSerialize["enum_number"] = o.EnumNumber - } - if o.OuterEnum.IsSet() { - toSerialize["outerEnum"] = o.OuterEnum.Get() - } - if o.OuterEnumInteger != nil { - toSerialize["outerEnumInteger"] = o.OuterEnumInteger - } - if o.OuterEnumDefaultValue != nil { - toSerialize["outerEnumDefaultValue"] = o.OuterEnumDefaultValue - } - if o.OuterEnumIntegerDefaultValue != nil { - toSerialize["outerEnumIntegerDefaultValue"] = o.OuterEnumIntegerDefaultValue - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) { - varEnumTest := _EnumTest{} - - if err = json.Unmarshal(bytes, &varEnumTest); err == nil { - *o = EnumTest(varEnumTest) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "enum_string") - delete(additionalProperties, "enum_string_required") - delete(additionalProperties, "enum_integer") - delete(additionalProperties, "enum_number") - delete(additionalProperties, "outerEnum") - delete(additionalProperties, "outerEnumInteger") - delete(additionalProperties, "outerEnumDefaultValue") - delete(additionalProperties, "outerEnumIntegerDefaultValue") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableEnumTest struct { - value *EnumTest - isSet bool -} - -func (v NullableEnumTest) Get() *EnumTest { - return v.value -} - -func (v *NullableEnumTest) Set(val *EnumTest) { - v.value = val - v.isSet = true -} - -func (v NullableEnumTest) IsSet() bool { - return v.isSet -} - -func (v *NullableEnumTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEnumTest(val *EnumTest) *NullableEnumTest { - return &NullableEnumTest{value: val, isSet: true} -} - -func (v NullableEnumTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEnumTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go deleted file mode 100644 index edb530ef383..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go +++ /dev/null @@ -1,140 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// File Must be named `File` for test. -type File struct { - // Test capitalization - SourceURI *string `json:"sourceURI,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _File File - -// NewFile instantiates a new File object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFile() *File { - this := File{} - return &this -} - -// NewFileWithDefaults instantiates a new File object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFileWithDefaults() *File { - this := File{} - return &this -} - -// GetSourceURI returns the SourceURI field value if set, zero value otherwise. -func (o *File) GetSourceURI() string { - if o == nil || o.SourceURI == nil { - var ret string - return ret - } - return *o.SourceURI -} - -// GetSourceURIOk returns a tuple with the SourceURI field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *File) GetSourceURIOk() (*string, bool) { - if o == nil || o.SourceURI == nil { - return nil, false - } - return o.SourceURI, true -} - -// HasSourceURI returns a boolean if a field has been set. -func (o *File) HasSourceURI() bool { - if o != nil && o.SourceURI != nil { - return true - } - - return false -} - -// SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. -func (o *File) SetSourceURI(v string) { - o.SourceURI = &v -} - -func (o File) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.SourceURI != nil { - toSerialize["sourceURI"] = o.SourceURI - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *File) UnmarshalJSON(bytes []byte) (err error) { - varFile := _File{} - - if err = json.Unmarshal(bytes, &varFile); err == nil { - *o = File(varFile) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "sourceURI") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFile struct { - value *File - isSet bool -} - -func (v NullableFile) Get() *File { - return v.value -} - -func (v *NullableFile) Set(val *File) { - v.value = val - v.isSet = true -} - -func (v NullableFile) IsSet() bool { - return v.isSet -} - -func (v *NullableFile) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFile(val *File) *NullableFile { - return &NullableFile{value: val, isSet: true} -} - -func (v NullableFile) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFile) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go deleted file mode 100644 index 389de1c9252..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// FileSchemaTestClass struct for FileSchemaTestClass -type FileSchemaTestClass struct { - File *File `json:"file,omitempty"` - Files *[]File `json:"files,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _FileSchemaTestClass FileSchemaTestClass - -// NewFileSchemaTestClass instantiates a new FileSchemaTestClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFileSchemaTestClass() *FileSchemaTestClass { - this := FileSchemaTestClass{} - return &this -} - -// NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass { - this := FileSchemaTestClass{} - return &this -} - -// GetFile returns the File field value if set, zero value otherwise. -func (o *FileSchemaTestClass) GetFile() File { - if o == nil || o.File == nil { - var ret File - return ret - } - return *o.File -} - -// GetFileOk returns a tuple with the File field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FileSchemaTestClass) GetFileOk() (*File, bool) { - if o == nil || o.File == nil { - return nil, false - } - return o.File, true -} - -// HasFile returns a boolean if a field has been set. -func (o *FileSchemaTestClass) HasFile() bool { - if o != nil && o.File != nil { - return true - } - - return false -} - -// SetFile gets a reference to the given File and assigns it to the File field. -func (o *FileSchemaTestClass) SetFile(v File) { - o.File = &v -} - -// GetFiles returns the Files field value if set, zero value otherwise. -func (o *FileSchemaTestClass) GetFiles() []File { - if o == nil || o.Files == nil { - var ret []File - return ret - } - return *o.Files -} - -// GetFilesOk returns a tuple with the Files field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool) { - if o == nil || o.Files == nil { - return nil, false - } - return o.Files, true -} - -// HasFiles returns a boolean if a field has been set. -func (o *FileSchemaTestClass) HasFiles() bool { - if o != nil && o.Files != nil { - return true - } - - return false -} - -// SetFiles gets a reference to the given []File and assigns it to the Files field. -func (o *FileSchemaTestClass) SetFiles(v []File) { - o.Files = &v -} - -func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.File != nil { - toSerialize["file"] = o.File - } - if o.Files != nil { - toSerialize["files"] = o.Files - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *FileSchemaTestClass) UnmarshalJSON(bytes []byte) (err error) { - varFileSchemaTestClass := _FileSchemaTestClass{} - - if err = json.Unmarshal(bytes, &varFileSchemaTestClass); err == nil { - *o = FileSchemaTestClass(varFileSchemaTestClass) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "file") - delete(additionalProperties, "files") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFileSchemaTestClass struct { - value *FileSchemaTestClass - isSet bool -} - -func (v NullableFileSchemaTestClass) Get() *FileSchemaTestClass { - return v.value -} - -func (v *NullableFileSchemaTestClass) Set(val *FileSchemaTestClass) { - v.value = val - v.isSet = true -} - -func (v NullableFileSchemaTestClass) IsSet() bool { - return v.isSet -} - -func (v *NullableFileSchemaTestClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFileSchemaTestClass(val *FileSchemaTestClass) *NullableFileSchemaTestClass { - return &NullableFileSchemaTestClass{value: val, isSet: true} -} - -func (v NullableFileSchemaTestClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFileSchemaTestClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go deleted file mode 100644 index d60c4a1c017..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go +++ /dev/null @@ -1,143 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Foo struct for Foo -type Foo struct { - Bar *string `json:"bar,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Foo Foo - -// NewFoo instantiates a new Foo object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFoo() *Foo { - this := Foo{} - var bar string = "bar" - this.Bar = &bar - return &this -} - -// NewFooWithDefaults instantiates a new Foo object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFooWithDefaults() *Foo { - this := Foo{} - var bar string = "bar" - this.Bar = &bar - return &this -} - -// GetBar returns the Bar field value if set, zero value otherwise. -func (o *Foo) GetBar() string { - if o == nil || o.Bar == nil { - var ret string - return ret - } - return *o.Bar -} - -// GetBarOk returns a tuple with the Bar field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Foo) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false - } - return o.Bar, true -} - -// HasBar returns a boolean if a field has been set. -func (o *Foo) HasBar() bool { - if o != nil && o.Bar != nil { - return true - } - - return false -} - -// SetBar gets a reference to the given string and assigns it to the Bar field. -func (o *Foo) SetBar(v string) { - o.Bar = &v -} - -func (o Foo) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Bar != nil { - toSerialize["bar"] = o.Bar - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Foo) UnmarshalJSON(bytes []byte) (err error) { - varFoo := _Foo{} - - if err = json.Unmarshal(bytes, &varFoo); err == nil { - *o = Foo(varFoo) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "bar") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFoo struct { - value *Foo - isSet bool -} - -func (v NullableFoo) Get() *Foo { - return v.value -} - -func (v *NullableFoo) Set(val *Foo) { - v.value = val - v.isSet = true -} - -func (v NullableFoo) IsSet() bool { - return v.isSet -} - -func (v *NullableFoo) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFoo(val *Foo) *NullableFoo { - return &NullableFoo{value: val, isSet: true} -} - -func (v NullableFoo) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFoo) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go deleted file mode 100644 index bbc76b1285c..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ /dev/null @@ -1,633 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "os" - "time" -) - -// FormatTest struct for FormatTest -type FormatTest struct { - Integer *int32 `json:"integer,omitempty"` - Int32 *int32 `json:"int32,omitempty"` - Int64 *int64 `json:"int64,omitempty"` - Number float32 `json:"number"` - Float *float32 `json:"float,omitempty"` - Double *float64 `json:"double,omitempty"` - String *string `json:"string,omitempty"` - Byte string `json:"byte"` - Binary **os.File `json:"binary,omitempty"` - Date string `json:"date"` - DateTime *time.Time `json:"dateTime,omitempty"` - Uuid *string `json:"uuid,omitempty"` - Password string `json:"password"` - // A string that is a 10 digit number. Can have leading zeros. - PatternWithDigits *string `json:"pattern_with_digits,omitempty"` - // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _FormatTest FormatTest - -// NewFormatTest instantiates a new FormatTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest { - this := FormatTest{} - this.Number = number - this.Byte = byte_ - this.Date = date - this.Password = password - return &this -} - -// NewFormatTestWithDefaults instantiates a new FormatTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewFormatTestWithDefaults() *FormatTest { - this := FormatTest{} - return &this -} - -// GetInteger returns the Integer field value if set, zero value otherwise. -func (o *FormatTest) GetInteger() int32 { - if o == nil || o.Integer == nil { - var ret int32 - return ret - } - return *o.Integer -} - -// GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetIntegerOk() (*int32, bool) { - if o == nil || o.Integer == nil { - return nil, false - } - return o.Integer, true -} - -// HasInteger returns a boolean if a field has been set. -func (o *FormatTest) HasInteger() bool { - if o != nil && o.Integer != nil { - return true - } - - return false -} - -// SetInteger gets a reference to the given int32 and assigns it to the Integer field. -func (o *FormatTest) SetInteger(v int32) { - o.Integer = &v -} - -// GetInt32 returns the Int32 field value if set, zero value otherwise. -func (o *FormatTest) GetInt32() int32 { - if o == nil || o.Int32 == nil { - var ret int32 - return ret - } - return *o.Int32 -} - -// GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetInt32Ok() (*int32, bool) { - if o == nil || o.Int32 == nil { - return nil, false - } - return o.Int32, true -} - -// HasInt32 returns a boolean if a field has been set. -func (o *FormatTest) HasInt32() bool { - if o != nil && o.Int32 != nil { - return true - } - - return false -} - -// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. -func (o *FormatTest) SetInt32(v int32) { - o.Int32 = &v -} - -// GetInt64 returns the Int64 field value if set, zero value otherwise. -func (o *FormatTest) GetInt64() int64 { - if o == nil || o.Int64 == nil { - var ret int64 - return ret - } - return *o.Int64 -} - -// GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetInt64Ok() (*int64, bool) { - if o == nil || o.Int64 == nil { - return nil, false - } - return o.Int64, true -} - -// HasInt64 returns a boolean if a field has been set. -func (o *FormatTest) HasInt64() bool { - if o != nil && o.Int64 != nil { - return true - } - - return false -} - -// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. -func (o *FormatTest) SetInt64(v int64) { - o.Int64 = &v -} - -// GetNumber returns the Number field value -func (o *FormatTest) GetNumber() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.Number -} - -// GetNumberOk returns a tuple with the Number field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetNumberOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.Number, true -} - -// SetNumber sets field value -func (o *FormatTest) SetNumber(v float32) { - o.Number = v -} - -// GetFloat returns the Float field value if set, zero value otherwise. -func (o *FormatTest) GetFloat() float32 { - if o == nil || o.Float == nil { - var ret float32 - return ret - } - return *o.Float -} - -// GetFloatOk returns a tuple with the Float field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetFloatOk() (*float32, bool) { - if o == nil || o.Float == nil { - return nil, false - } - return o.Float, true -} - -// HasFloat returns a boolean if a field has been set. -func (o *FormatTest) HasFloat() bool { - if o != nil && o.Float != nil { - return true - } - - return false -} - -// SetFloat gets a reference to the given float32 and assigns it to the Float field. -func (o *FormatTest) SetFloat(v float32) { - o.Float = &v -} - -// GetDouble returns the Double field value if set, zero value otherwise. -func (o *FormatTest) GetDouble() float64 { - if o == nil || o.Double == nil { - var ret float64 - return ret - } - return *o.Double -} - -// GetDoubleOk returns a tuple with the Double field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetDoubleOk() (*float64, bool) { - if o == nil || o.Double == nil { - return nil, false - } - return o.Double, true -} - -// HasDouble returns a boolean if a field has been set. -func (o *FormatTest) HasDouble() bool { - if o != nil && o.Double != nil { - return true - } - - return false -} - -// SetDouble gets a reference to the given float64 and assigns it to the Double field. -func (o *FormatTest) SetDouble(v float64) { - o.Double = &v -} - -// GetString returns the String field value if set, zero value otherwise. -func (o *FormatTest) GetString() string { - if o == nil || o.String == nil { - var ret string - return ret - } - return *o.String -} - -// GetStringOk returns a tuple with the String field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetStringOk() (*string, bool) { - if o == nil || o.String == nil { - return nil, false - } - return o.String, true -} - -// HasString returns a boolean if a field has been set. -func (o *FormatTest) HasString() bool { - if o != nil && o.String != nil { - return true - } - - return false -} - -// SetString gets a reference to the given string and assigns it to the String field. -func (o *FormatTest) SetString(v string) { - o.String = &v -} - -// GetByte returns the Byte field value -func (o *FormatTest) GetByte() string { - if o == nil { - var ret string - return ret - } - - return o.Byte -} - -// GetByteOk returns a tuple with the Byte field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetByteOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Byte, true -} - -// SetByte sets field value -func (o *FormatTest) SetByte(v string) { - o.Byte = v -} - -// GetBinary returns the Binary field value if set, zero value otherwise. -func (o *FormatTest) GetBinary() *os.File { - if o == nil || o.Binary == nil { - var ret *os.File - return ret - } - return *o.Binary -} - -// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetBinaryOk() (**os.File, bool) { - if o == nil || o.Binary == nil { - return nil, false - } - return o.Binary, true -} - -// HasBinary returns a boolean if a field has been set. -func (o *FormatTest) HasBinary() bool { - if o != nil && o.Binary != nil { - return true - } - - return false -} - -// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. -func (o *FormatTest) SetBinary(v *os.File) { - o.Binary = &v -} - -// GetDate returns the Date field value -func (o *FormatTest) GetDate() string { - if o == nil { - var ret string - return ret - } - - return o.Date -} - -// GetDateOk returns a tuple with the Date field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetDateOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Date, true -} - -// SetDate sets field value -func (o *FormatTest) SetDate(v string) { - o.Date = v -} - -// GetDateTime returns the DateTime field value if set, zero value otherwise. -func (o *FormatTest) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { - var ret time.Time - return ret - } - return *o.DateTime -} - -// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false - } - return o.DateTime, true -} - -// HasDateTime returns a boolean if a field has been set. -func (o *FormatTest) HasDateTime() bool { - if o != nil && o.DateTime != nil { - return true - } - - return false -} - -// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. -func (o *FormatTest) SetDateTime(v time.Time) { - o.DateTime = &v -} - -// GetUuid returns the Uuid field value if set, zero value otherwise. -func (o *FormatTest) GetUuid() string { - if o == nil || o.Uuid == nil { - var ret string - return ret - } - return *o.Uuid -} - -// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false - } - return o.Uuid, true -} - -// HasUuid returns a boolean if a field has been set. -func (o *FormatTest) HasUuid() bool { - if o != nil && o.Uuid != nil { - return true - } - - return false -} - -// SetUuid gets a reference to the given string and assigns it to the Uuid field. -func (o *FormatTest) SetUuid(v string) { - o.Uuid = &v -} - -// GetPassword returns the Password field value -func (o *FormatTest) GetPassword() string { - if o == nil { - var ret string - return ret - } - - return o.Password -} - -// GetPasswordOk returns a tuple with the Password field value -// and a boolean to check if the value has been set. -func (o *FormatTest) GetPasswordOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Password, true -} - -// SetPassword sets field value -func (o *FormatTest) SetPassword(v string) { - o.Password = v -} - -// GetPatternWithDigits returns the PatternWithDigits field value if set, zero value otherwise. -func (o *FormatTest) GetPatternWithDigits() string { - if o == nil || o.PatternWithDigits == nil { - var ret string - return ret - } - return *o.PatternWithDigits -} - -// GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetPatternWithDigitsOk() (*string, bool) { - if o == nil || o.PatternWithDigits == nil { - return nil, false - } - return o.PatternWithDigits, true -} - -// HasPatternWithDigits returns a boolean if a field has been set. -func (o *FormatTest) HasPatternWithDigits() bool { - if o != nil && o.PatternWithDigits != nil { - return true - } - - return false -} - -// SetPatternWithDigits gets a reference to the given string and assigns it to the PatternWithDigits field. -func (o *FormatTest) SetPatternWithDigits(v string) { - o.PatternWithDigits = &v -} - -// GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field value if set, zero value otherwise. -func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string { - if o == nil || o.PatternWithDigitsAndDelimiter == nil { - var ret string - return ret - } - return *o.PatternWithDigitsAndDelimiter -} - -// GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (*string, bool) { - if o == nil || o.PatternWithDigitsAndDelimiter == nil { - return nil, false - } - return o.PatternWithDigitsAndDelimiter, true -} - -// HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. -func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool { - if o != nil && o.PatternWithDigitsAndDelimiter != nil { - return true - } - - return false -} - -// SetPatternWithDigitsAndDelimiter gets a reference to the given string and assigns it to the PatternWithDigitsAndDelimiter field. -func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string) { - o.PatternWithDigitsAndDelimiter = &v -} - -func (o FormatTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Integer != nil { - toSerialize["integer"] = o.Integer - } - if o.Int32 != nil { - toSerialize["int32"] = o.Int32 - } - if o.Int64 != nil { - toSerialize["int64"] = o.Int64 - } - if true { - toSerialize["number"] = o.Number - } - if o.Float != nil { - toSerialize["float"] = o.Float - } - if o.Double != nil { - toSerialize["double"] = o.Double - } - if o.String != nil { - toSerialize["string"] = o.String - } - if true { - toSerialize["byte"] = o.Byte - } - if o.Binary != nil { - toSerialize["binary"] = o.Binary - } - if true { - toSerialize["date"] = o.Date - } - if o.DateTime != nil { - toSerialize["dateTime"] = o.DateTime - } - if o.Uuid != nil { - toSerialize["uuid"] = o.Uuid - } - if true { - toSerialize["password"] = o.Password - } - if o.PatternWithDigits != nil { - toSerialize["pattern_with_digits"] = o.PatternWithDigits - } - if o.PatternWithDigitsAndDelimiter != nil { - toSerialize["pattern_with_digits_and_delimiter"] = o.PatternWithDigitsAndDelimiter - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) { - varFormatTest := _FormatTest{} - - if err = json.Unmarshal(bytes, &varFormatTest); err == nil { - *o = FormatTest(varFormatTest) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "integer") - delete(additionalProperties, "int32") - delete(additionalProperties, "int64") - delete(additionalProperties, "number") - delete(additionalProperties, "float") - delete(additionalProperties, "double") - delete(additionalProperties, "string") - delete(additionalProperties, "byte") - delete(additionalProperties, "binary") - delete(additionalProperties, "date") - delete(additionalProperties, "dateTime") - delete(additionalProperties, "uuid") - delete(additionalProperties, "password") - delete(additionalProperties, "pattern_with_digits") - delete(additionalProperties, "pattern_with_digits_and_delimiter") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableFormatTest struct { - value *FormatTest - isSet bool -} - -func (v NullableFormatTest) Get() *FormatTest { - return v.value -} - -func (v *NullableFormatTest) Set(val *FormatTest) { - v.value = val - v.isSet = true -} - -func (v NullableFormatTest) IsSet() bool { - return v.isSet -} - -func (v *NullableFormatTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFormatTest(val *FormatTest) *NullableFormatTest { - return &NullableFormatTest{value: val, isSet: true} -} - -func (v NullableFormatTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFormatTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go deleted file mode 100644 index 4eb331e77eb..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// HasOnlyReadOnly struct for HasOnlyReadOnly -type HasOnlyReadOnly struct { - Bar *string `json:"bar,omitempty"` - Foo *string `json:"foo,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _HasOnlyReadOnly HasOnlyReadOnly - -// NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHasOnlyReadOnly() *HasOnlyReadOnly { - this := HasOnlyReadOnly{} - return &this -} - -// NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly { - this := HasOnlyReadOnly{} - return &this -} - -// GetBar returns the Bar field value if set, zero value otherwise. -func (o *HasOnlyReadOnly) GetBar() string { - if o == nil || o.Bar == nil { - var ret string - return ret - } - return *o.Bar -} - -// GetBarOk returns a tuple with the Bar field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HasOnlyReadOnly) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false - } - return o.Bar, true -} - -// HasBar returns a boolean if a field has been set. -func (o *HasOnlyReadOnly) HasBar() bool { - if o != nil && o.Bar != nil { - return true - } - - return false -} - -// SetBar gets a reference to the given string and assigns it to the Bar field. -func (o *HasOnlyReadOnly) SetBar(v string) { - o.Bar = &v -} - -// GetFoo returns the Foo field value if set, zero value otherwise. -func (o *HasOnlyReadOnly) GetFoo() string { - if o == nil || o.Foo == nil { - var ret string - return ret - } - return *o.Foo -} - -// GetFooOk returns a tuple with the Foo field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HasOnlyReadOnly) GetFooOk() (*string, bool) { - if o == nil || o.Foo == nil { - return nil, false - } - return o.Foo, true -} - -// HasFoo returns a boolean if a field has been set. -func (o *HasOnlyReadOnly) HasFoo() bool { - if o != nil && o.Foo != nil { - return true - } - - return false -} - -// SetFoo gets a reference to the given string and assigns it to the Foo field. -func (o *HasOnlyReadOnly) SetFoo(v string) { - o.Foo = &v -} - -func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Bar != nil { - toSerialize["bar"] = o.Bar - } - if o.Foo != nil { - toSerialize["foo"] = o.Foo - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *HasOnlyReadOnly) UnmarshalJSON(bytes []byte) (err error) { - varHasOnlyReadOnly := _HasOnlyReadOnly{} - - if err = json.Unmarshal(bytes, &varHasOnlyReadOnly); err == nil { - *o = HasOnlyReadOnly(varHasOnlyReadOnly) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "bar") - delete(additionalProperties, "foo") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHasOnlyReadOnly struct { - value *HasOnlyReadOnly - isSet bool -} - -func (v NullableHasOnlyReadOnly) Get() *HasOnlyReadOnly { - return v.value -} - -func (v *NullableHasOnlyReadOnly) Set(val *HasOnlyReadOnly) { - v.value = val - v.isSet = true -} - -func (v NullableHasOnlyReadOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableHasOnlyReadOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHasOnlyReadOnly(val *HasOnlyReadOnly) *NullableHasOnlyReadOnly { - return &NullableHasOnlyReadOnly{value: val, isSet: true} -} - -func (v NullableHasOnlyReadOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHasOnlyReadOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go deleted file mode 100644 index db44ec77384..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go +++ /dev/null @@ -1,149 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. -type HealthCheckResult struct { - NullableMessage NullableString `json:"NullableMessage,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _HealthCheckResult HealthCheckResult - -// NewHealthCheckResult instantiates a new HealthCheckResult object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHealthCheckResult() *HealthCheckResult { - this := HealthCheckResult{} - return &this -} - -// NewHealthCheckResultWithDefaults instantiates a new HealthCheckResult object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHealthCheckResultWithDefaults() *HealthCheckResult { - this := HealthCheckResult{} - return &this -} - -// GetNullableMessage returns the NullableMessage field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *HealthCheckResult) GetNullableMessage() string { - if o == nil || o.NullableMessage.Get() == nil { - var ret string - return ret - } - return *o.NullableMessage.Get() -} - -// GetNullableMessageOk returns a tuple with the NullableMessage field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *HealthCheckResult) GetNullableMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.NullableMessage.Get(), o.NullableMessage.IsSet() -} - -// HasNullableMessage returns a boolean if a field has been set. -func (o *HealthCheckResult) HasNullableMessage() bool { - if o != nil && o.NullableMessage.IsSet() { - return true - } - - return false -} - -// SetNullableMessage gets a reference to the given NullableString and assigns it to the NullableMessage field. -func (o *HealthCheckResult) SetNullableMessage(v string) { - o.NullableMessage.Set(&v) -} -// SetNullableMessageNil sets the value for NullableMessage to be an explicit nil -func (o *HealthCheckResult) SetNullableMessageNil() { - o.NullableMessage.Set(nil) -} - -// UnsetNullableMessage ensures that no value is present for NullableMessage, not even an explicit nil -func (o *HealthCheckResult) UnsetNullableMessage() { - o.NullableMessage.Unset() -} - -func (o HealthCheckResult) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.NullableMessage.IsSet() { - toSerialize["NullableMessage"] = o.NullableMessage.Get() - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *HealthCheckResult) UnmarshalJSON(bytes []byte) (err error) { - varHealthCheckResult := _HealthCheckResult{} - - if err = json.Unmarshal(bytes, &varHealthCheckResult); err == nil { - *o = HealthCheckResult(varHealthCheckResult) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "NullableMessage") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableHealthCheckResult struct { - value *HealthCheckResult - isSet bool -} - -func (v NullableHealthCheckResult) Get() *HealthCheckResult { - return v.value -} - -func (v *NullableHealthCheckResult) Set(val *HealthCheckResult) { - v.value = val - v.isSet = true -} - -func (v NullableHealthCheckResult) IsSet() bool { - return v.isSet -} - -func (v *NullableHealthCheckResult) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHealthCheckResult(val *HealthCheckResult) *NullableHealthCheckResult { - return &NullableHealthCheckResult{value: val, isSet: true} -} - -func (v NullableHealthCheckResult) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHealthCheckResult) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go deleted file mode 100644 index 758deb9dc15..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go +++ /dev/null @@ -1,178 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// InlineObject struct for InlineObject -type InlineObject struct { - // Updated name of the pet - Name *string `json:"name,omitempty"` - // Updated status of the pet - Status *string `json:"status,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InlineObject InlineObject - -// NewInlineObject instantiates a new InlineObject object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineObject() *InlineObject { - this := InlineObject{} - return &this -} - -// NewInlineObjectWithDefaults instantiates a new InlineObject object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineObjectWithDefaults() *InlineObject { - this := InlineObject{} - return &this -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *InlineObject) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *InlineObject) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *InlineObject) SetName(v string) { - o.Name = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *InlineObject) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *InlineObject) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *InlineObject) SetStatus(v string) { - o.Status = &v -} - -func (o InlineObject) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineObject) UnmarshalJSON(bytes []byte) (err error) { - varInlineObject := _InlineObject{} - - if err = json.Unmarshal(bytes, &varInlineObject); err == nil { - *o = InlineObject(varInlineObject) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineObject struct { - value *InlineObject - isSet bool -} - -func (v NullableInlineObject) Get() *InlineObject { - return v.value -} - -func (v *NullableInlineObject) Set(val *InlineObject) { - v.value = val - v.isSet = true -} - -func (v NullableInlineObject) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineObject) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineObject(val *InlineObject) *NullableInlineObject { - return &NullableInlineObject{value: val, isSet: true} -} - -func (v NullableInlineObject) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineObject) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go deleted file mode 100644 index 90c0f63645d..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go +++ /dev/null @@ -1,179 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "os" -) - -// InlineObject1 struct for InlineObject1 -type InlineObject1 struct { - // Additional data to pass to server - AdditionalMetadata *string `json:"additionalMetadata,omitempty"` - // file to upload - File **os.File `json:"file,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InlineObject1 InlineObject1 - -// NewInlineObject1 instantiates a new InlineObject1 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineObject1() *InlineObject1 { - this := InlineObject1{} - return &this -} - -// NewInlineObject1WithDefaults instantiates a new InlineObject1 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineObject1WithDefaults() *InlineObject1 { - this := InlineObject1{} - return &this -} - -// GetAdditionalMetadata returns the AdditionalMetadata field value if set, zero value otherwise. -func (o *InlineObject1) GetAdditionalMetadata() string { - if o == nil || o.AdditionalMetadata == nil { - var ret string - return ret - } - return *o.AdditionalMetadata -} - -// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject1) GetAdditionalMetadataOk() (*string, bool) { - if o == nil || o.AdditionalMetadata == nil { - return nil, false - } - return o.AdditionalMetadata, true -} - -// HasAdditionalMetadata returns a boolean if a field has been set. -func (o *InlineObject1) HasAdditionalMetadata() bool { - if o != nil && o.AdditionalMetadata != nil { - return true - } - - return false -} - -// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. -func (o *InlineObject1) SetAdditionalMetadata(v string) { - o.AdditionalMetadata = &v -} - -// GetFile returns the File field value if set, zero value otherwise. -func (o *InlineObject1) GetFile() *os.File { - if o == nil || o.File == nil { - var ret *os.File - return ret - } - return *o.File -} - -// GetFileOk returns a tuple with the File field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject1) GetFileOk() (**os.File, bool) { - if o == nil || o.File == nil { - return nil, false - } - return o.File, true -} - -// HasFile returns a boolean if a field has been set. -func (o *InlineObject1) HasFile() bool { - if o != nil && o.File != nil { - return true - } - - return false -} - -// SetFile gets a reference to the given *os.File and assigns it to the File field. -func (o *InlineObject1) SetFile(v *os.File) { - o.File = &v -} - -func (o InlineObject1) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.AdditionalMetadata != nil { - toSerialize["additionalMetadata"] = o.AdditionalMetadata - } - if o.File != nil { - toSerialize["file"] = o.File - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineObject1) UnmarshalJSON(bytes []byte) (err error) { - varInlineObject1 := _InlineObject1{} - - if err = json.Unmarshal(bytes, &varInlineObject1); err == nil { - *o = InlineObject1(varInlineObject1) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "additionalMetadata") - delete(additionalProperties, "file") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineObject1 struct { - value *InlineObject1 - isSet bool -} - -func (v NullableInlineObject1) Get() *InlineObject1 { - return v.value -} - -func (v *NullableInlineObject1) Set(val *InlineObject1) { - v.value = val - v.isSet = true -} - -func (v NullableInlineObject1) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineObject1) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineObject1(val *InlineObject1) *NullableInlineObject1 { - return &NullableInlineObject1{value: val, isSet: true} -} - -func (v NullableInlineObject1) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineObject1) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go deleted file mode 100644 index 3217b39c869..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go +++ /dev/null @@ -1,182 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// InlineObject2 struct for InlineObject2 -type InlineObject2 struct { - // Form parameter enum test (string array) - EnumFormStringArray *[]string `json:"enum_form_string_array,omitempty"` - // Form parameter enum test (string) - EnumFormString *string `json:"enum_form_string,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InlineObject2 InlineObject2 - -// NewInlineObject2 instantiates a new InlineObject2 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineObject2() *InlineObject2 { - this := InlineObject2{} - var enumFormString string = "-efg" - this.EnumFormString = &enumFormString - return &this -} - -// NewInlineObject2WithDefaults instantiates a new InlineObject2 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineObject2WithDefaults() *InlineObject2 { - this := InlineObject2{} - var enumFormString string = "-efg" - this.EnumFormString = &enumFormString - return &this -} - -// GetEnumFormStringArray returns the EnumFormStringArray field value if set, zero value otherwise. -func (o *InlineObject2) GetEnumFormStringArray() []string { - if o == nil || o.EnumFormStringArray == nil { - var ret []string - return ret - } - return *o.EnumFormStringArray -} - -// GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject2) GetEnumFormStringArrayOk() (*[]string, bool) { - if o == nil || o.EnumFormStringArray == nil { - return nil, false - } - return o.EnumFormStringArray, true -} - -// HasEnumFormStringArray returns a boolean if a field has been set. -func (o *InlineObject2) HasEnumFormStringArray() bool { - if o != nil && o.EnumFormStringArray != nil { - return true - } - - return false -} - -// SetEnumFormStringArray gets a reference to the given []string and assigns it to the EnumFormStringArray field. -func (o *InlineObject2) SetEnumFormStringArray(v []string) { - o.EnumFormStringArray = &v -} - -// GetEnumFormString returns the EnumFormString field value if set, zero value otherwise. -func (o *InlineObject2) GetEnumFormString() string { - if o == nil || o.EnumFormString == nil { - var ret string - return ret - } - return *o.EnumFormString -} - -// GetEnumFormStringOk returns a tuple with the EnumFormString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject2) GetEnumFormStringOk() (*string, bool) { - if o == nil || o.EnumFormString == nil { - return nil, false - } - return o.EnumFormString, true -} - -// HasEnumFormString returns a boolean if a field has been set. -func (o *InlineObject2) HasEnumFormString() bool { - if o != nil && o.EnumFormString != nil { - return true - } - - return false -} - -// SetEnumFormString gets a reference to the given string and assigns it to the EnumFormString field. -func (o *InlineObject2) SetEnumFormString(v string) { - o.EnumFormString = &v -} - -func (o InlineObject2) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.EnumFormStringArray != nil { - toSerialize["enum_form_string_array"] = o.EnumFormStringArray - } - if o.EnumFormString != nil { - toSerialize["enum_form_string"] = o.EnumFormString - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineObject2) UnmarshalJSON(bytes []byte) (err error) { - varInlineObject2 := _InlineObject2{} - - if err = json.Unmarshal(bytes, &varInlineObject2); err == nil { - *o = InlineObject2(varInlineObject2) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "enum_form_string_array") - delete(additionalProperties, "enum_form_string") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineObject2 struct { - value *InlineObject2 - isSet bool -} - -func (v NullableInlineObject2) Get() *InlineObject2 { - return v.value -} - -func (v *NullableInlineObject2) Set(val *InlineObject2) { - v.value = val - v.isSet = true -} - -func (v NullableInlineObject2) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineObject2) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineObject2(val *InlineObject2) *NullableInlineObject2 { - return &NullableInlineObject2{value: val, isSet: true} -} - -func (v NullableInlineObject2) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineObject2) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go deleted file mode 100644 index 8050df353aa..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go +++ /dev/null @@ -1,608 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "os" - "time" -) - -// InlineObject3 struct for InlineObject3 -type InlineObject3 struct { - // None - Integer *int32 `json:"integer,omitempty"` - // None - Int32 *int32 `json:"int32,omitempty"` - // None - Int64 *int64 `json:"int64,omitempty"` - // None - Number float32 `json:"number"` - // None - Float *float32 `json:"float,omitempty"` - // None - Double float64 `json:"double"` - // None - String *string `json:"string,omitempty"` - // None - PatternWithoutDelimiter string `json:"pattern_without_delimiter"` - // None - Byte string `json:"byte"` - // None - Binary **os.File `json:"binary,omitempty"` - // None - Date *string `json:"date,omitempty"` - // None - DateTime *time.Time `json:"dateTime,omitempty"` - // None - Password *string `json:"password,omitempty"` - // None - Callback *string `json:"callback,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InlineObject3 InlineObject3 - -// NewInlineObject3 instantiates a new InlineObject3 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineObject3(number float32, double float64, patternWithoutDelimiter string, byte_ string, ) *InlineObject3 { - this := InlineObject3{} - this.Number = number - this.Double = double - this.PatternWithoutDelimiter = patternWithoutDelimiter - this.Byte = byte_ - return &this -} - -// NewInlineObject3WithDefaults instantiates a new InlineObject3 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineObject3WithDefaults() *InlineObject3 { - this := InlineObject3{} - return &this -} - -// GetInteger returns the Integer field value if set, zero value otherwise. -func (o *InlineObject3) GetInteger() int32 { - if o == nil || o.Integer == nil { - var ret int32 - return ret - } - return *o.Integer -} - -// GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetIntegerOk() (*int32, bool) { - if o == nil || o.Integer == nil { - return nil, false - } - return o.Integer, true -} - -// HasInteger returns a boolean if a field has been set. -func (o *InlineObject3) HasInteger() bool { - if o != nil && o.Integer != nil { - return true - } - - return false -} - -// SetInteger gets a reference to the given int32 and assigns it to the Integer field. -func (o *InlineObject3) SetInteger(v int32) { - o.Integer = &v -} - -// GetInt32 returns the Int32 field value if set, zero value otherwise. -func (o *InlineObject3) GetInt32() int32 { - if o == nil || o.Int32 == nil { - var ret int32 - return ret - } - return *o.Int32 -} - -// GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetInt32Ok() (*int32, bool) { - if o == nil || o.Int32 == nil { - return nil, false - } - return o.Int32, true -} - -// HasInt32 returns a boolean if a field has been set. -func (o *InlineObject3) HasInt32() bool { - if o != nil && o.Int32 != nil { - return true - } - - return false -} - -// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. -func (o *InlineObject3) SetInt32(v int32) { - o.Int32 = &v -} - -// GetInt64 returns the Int64 field value if set, zero value otherwise. -func (o *InlineObject3) GetInt64() int64 { - if o == nil || o.Int64 == nil { - var ret int64 - return ret - } - return *o.Int64 -} - -// GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetInt64Ok() (*int64, bool) { - if o == nil || o.Int64 == nil { - return nil, false - } - return o.Int64, true -} - -// HasInt64 returns a boolean if a field has been set. -func (o *InlineObject3) HasInt64() bool { - if o != nil && o.Int64 != nil { - return true - } - - return false -} - -// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. -func (o *InlineObject3) SetInt64(v int64) { - o.Int64 = &v -} - -// GetNumber returns the Number field value -func (o *InlineObject3) GetNumber() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.Number -} - -// GetNumberOk returns a tuple with the Number field value -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetNumberOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.Number, true -} - -// SetNumber sets field value -func (o *InlineObject3) SetNumber(v float32) { - o.Number = v -} - -// GetFloat returns the Float field value if set, zero value otherwise. -func (o *InlineObject3) GetFloat() float32 { - if o == nil || o.Float == nil { - var ret float32 - return ret - } - return *o.Float -} - -// GetFloatOk returns a tuple with the Float field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetFloatOk() (*float32, bool) { - if o == nil || o.Float == nil { - return nil, false - } - return o.Float, true -} - -// HasFloat returns a boolean if a field has been set. -func (o *InlineObject3) HasFloat() bool { - if o != nil && o.Float != nil { - return true - } - - return false -} - -// SetFloat gets a reference to the given float32 and assigns it to the Float field. -func (o *InlineObject3) SetFloat(v float32) { - o.Float = &v -} - -// GetDouble returns the Double field value -func (o *InlineObject3) GetDouble() float64 { - if o == nil { - var ret float64 - return ret - } - - return o.Double -} - -// GetDoubleOk returns a tuple with the Double field value -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetDoubleOk() (*float64, bool) { - if o == nil { - return nil, false - } - return &o.Double, true -} - -// SetDouble sets field value -func (o *InlineObject3) SetDouble(v float64) { - o.Double = v -} - -// GetString returns the String field value if set, zero value otherwise. -func (o *InlineObject3) GetString() string { - if o == nil || o.String == nil { - var ret string - return ret - } - return *o.String -} - -// GetStringOk returns a tuple with the String field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetStringOk() (*string, bool) { - if o == nil || o.String == nil { - return nil, false - } - return o.String, true -} - -// HasString returns a boolean if a field has been set. -func (o *InlineObject3) HasString() bool { - if o != nil && o.String != nil { - return true - } - - return false -} - -// SetString gets a reference to the given string and assigns it to the String field. -func (o *InlineObject3) SetString(v string) { - o.String = &v -} - -// GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field value -func (o *InlineObject3) GetPatternWithoutDelimiter() string { - if o == nil { - var ret string - return ret - } - - return o.PatternWithoutDelimiter -} - -// GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field value -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetPatternWithoutDelimiterOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.PatternWithoutDelimiter, true -} - -// SetPatternWithoutDelimiter sets field value -func (o *InlineObject3) SetPatternWithoutDelimiter(v string) { - o.PatternWithoutDelimiter = v -} - -// GetByte returns the Byte field value -func (o *InlineObject3) GetByte() string { - if o == nil { - var ret string - return ret - } - - return o.Byte -} - -// GetByteOk returns a tuple with the Byte field value -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetByteOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Byte, true -} - -// SetByte sets field value -func (o *InlineObject3) SetByte(v string) { - o.Byte = v -} - -// GetBinary returns the Binary field value if set, zero value otherwise. -func (o *InlineObject3) GetBinary() *os.File { - if o == nil || o.Binary == nil { - var ret *os.File - return ret - } - return *o.Binary -} - -// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetBinaryOk() (**os.File, bool) { - if o == nil || o.Binary == nil { - return nil, false - } - return o.Binary, true -} - -// HasBinary returns a boolean if a field has been set. -func (o *InlineObject3) HasBinary() bool { - if o != nil && o.Binary != nil { - return true - } - - return false -} - -// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. -func (o *InlineObject3) SetBinary(v *os.File) { - o.Binary = &v -} - -// GetDate returns the Date field value if set, zero value otherwise. -func (o *InlineObject3) GetDate() string { - if o == nil || o.Date == nil { - var ret string - return ret - } - return *o.Date -} - -// GetDateOk returns a tuple with the Date field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetDateOk() (*string, bool) { - if o == nil || o.Date == nil { - return nil, false - } - return o.Date, true -} - -// HasDate returns a boolean if a field has been set. -func (o *InlineObject3) HasDate() bool { - if o != nil && o.Date != nil { - return true - } - - return false -} - -// SetDate gets a reference to the given string and assigns it to the Date field. -func (o *InlineObject3) SetDate(v string) { - o.Date = &v -} - -// GetDateTime returns the DateTime field value if set, zero value otherwise. -func (o *InlineObject3) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { - var ret time.Time - return ret - } - return *o.DateTime -} - -// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false - } - return o.DateTime, true -} - -// HasDateTime returns a boolean if a field has been set. -func (o *InlineObject3) HasDateTime() bool { - if o != nil && o.DateTime != nil { - return true - } - - return false -} - -// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. -func (o *InlineObject3) SetDateTime(v time.Time) { - o.DateTime = &v -} - -// GetPassword returns the Password field value if set, zero value otherwise. -func (o *InlineObject3) GetPassword() string { - if o == nil || o.Password == nil { - var ret string - return ret - } - return *o.Password -} - -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false - } - return o.Password, true -} - -// HasPassword returns a boolean if a field has been set. -func (o *InlineObject3) HasPassword() bool { - if o != nil && o.Password != nil { - return true - } - - return false -} - -// SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *InlineObject3) SetPassword(v string) { - o.Password = &v -} - -// GetCallback returns the Callback field value if set, zero value otherwise. -func (o *InlineObject3) GetCallback() string { - if o == nil || o.Callback == nil { - var ret string - return ret - } - return *o.Callback -} - -// GetCallbackOk returns a tuple with the Callback field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject3) GetCallbackOk() (*string, bool) { - if o == nil || o.Callback == nil { - return nil, false - } - return o.Callback, true -} - -// HasCallback returns a boolean if a field has been set. -func (o *InlineObject3) HasCallback() bool { - if o != nil && o.Callback != nil { - return true - } - - return false -} - -// SetCallback gets a reference to the given string and assigns it to the Callback field. -func (o *InlineObject3) SetCallback(v string) { - o.Callback = &v -} - -func (o InlineObject3) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Integer != nil { - toSerialize["integer"] = o.Integer - } - if o.Int32 != nil { - toSerialize["int32"] = o.Int32 - } - if o.Int64 != nil { - toSerialize["int64"] = o.Int64 - } - if true { - toSerialize["number"] = o.Number - } - if o.Float != nil { - toSerialize["float"] = o.Float - } - if true { - toSerialize["double"] = o.Double - } - if o.String != nil { - toSerialize["string"] = o.String - } - if true { - toSerialize["pattern_without_delimiter"] = o.PatternWithoutDelimiter - } - if true { - toSerialize["byte"] = o.Byte - } - if o.Binary != nil { - toSerialize["binary"] = o.Binary - } - if o.Date != nil { - toSerialize["date"] = o.Date - } - if o.DateTime != nil { - toSerialize["dateTime"] = o.DateTime - } - if o.Password != nil { - toSerialize["password"] = o.Password - } - if o.Callback != nil { - toSerialize["callback"] = o.Callback - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineObject3) UnmarshalJSON(bytes []byte) (err error) { - varInlineObject3 := _InlineObject3{} - - if err = json.Unmarshal(bytes, &varInlineObject3); err == nil { - *o = InlineObject3(varInlineObject3) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "integer") - delete(additionalProperties, "int32") - delete(additionalProperties, "int64") - delete(additionalProperties, "number") - delete(additionalProperties, "float") - delete(additionalProperties, "double") - delete(additionalProperties, "string") - delete(additionalProperties, "pattern_without_delimiter") - delete(additionalProperties, "byte") - delete(additionalProperties, "binary") - delete(additionalProperties, "date") - delete(additionalProperties, "dateTime") - delete(additionalProperties, "password") - delete(additionalProperties, "callback") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineObject3 struct { - value *InlineObject3 - isSet bool -} - -func (v NullableInlineObject3) Get() *InlineObject3 { - return v.value -} - -func (v *NullableInlineObject3) Set(val *InlineObject3) { - v.value = val - v.isSet = true -} - -func (v NullableInlineObject3) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineObject3) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineObject3(val *InlineObject3) *NullableInlineObject3 { - return &NullableInlineObject3{value: val, isSet: true} -} - -func (v NullableInlineObject3) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineObject3) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go deleted file mode 100644 index bd624f9c4b5..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go +++ /dev/null @@ -1,164 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// InlineObject4 struct for InlineObject4 -type InlineObject4 struct { - // field1 - Param string `json:"param"` - // field2 - Param2 string `json:"param2"` - AdditionalProperties map[string]interface{} -} - -type _InlineObject4 InlineObject4 - -// NewInlineObject4 instantiates a new InlineObject4 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineObject4(param string, param2 string, ) *InlineObject4 { - this := InlineObject4{} - this.Param = param - this.Param2 = param2 - return &this -} - -// NewInlineObject4WithDefaults instantiates a new InlineObject4 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineObject4WithDefaults() *InlineObject4 { - this := InlineObject4{} - return &this -} - -// GetParam returns the Param field value -func (o *InlineObject4) GetParam() string { - if o == nil { - var ret string - return ret - } - - return o.Param -} - -// GetParamOk returns a tuple with the Param field value -// and a boolean to check if the value has been set. -func (o *InlineObject4) GetParamOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Param, true -} - -// SetParam sets field value -func (o *InlineObject4) SetParam(v string) { - o.Param = v -} - -// GetParam2 returns the Param2 field value -func (o *InlineObject4) GetParam2() string { - if o == nil { - var ret string - return ret - } - - return o.Param2 -} - -// GetParam2Ok returns a tuple with the Param2 field value -// and a boolean to check if the value has been set. -func (o *InlineObject4) GetParam2Ok() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Param2, true -} - -// SetParam2 sets field value -func (o *InlineObject4) SetParam2(v string) { - o.Param2 = v -} - -func (o InlineObject4) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["param"] = o.Param - } - if true { - toSerialize["param2"] = o.Param2 - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineObject4) UnmarshalJSON(bytes []byte) (err error) { - varInlineObject4 := _InlineObject4{} - - if err = json.Unmarshal(bytes, &varInlineObject4); err == nil { - *o = InlineObject4(varInlineObject4) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "param") - delete(additionalProperties, "param2") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineObject4 struct { - value *InlineObject4 - isSet bool -} - -func (v NullableInlineObject4) Get() *InlineObject4 { - return v.value -} - -func (v *NullableInlineObject4) Set(val *InlineObject4) { - v.value = val - v.isSet = true -} - -func (v NullableInlineObject4) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineObject4) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineObject4(val *InlineObject4) *NullableInlineObject4 { - return &NullableInlineObject4{value: val, isSet: true} -} - -func (v NullableInlineObject4) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineObject4) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go deleted file mode 100644 index 47fcc6e2e29..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go +++ /dev/null @@ -1,172 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "os" -) - -// InlineObject5 struct for InlineObject5 -type InlineObject5 struct { - // Additional data to pass to server - AdditionalMetadata *string `json:"additionalMetadata,omitempty"` - // file to upload - RequiredFile *os.File `json:"requiredFile"` - AdditionalProperties map[string]interface{} -} - -type _InlineObject5 InlineObject5 - -// NewInlineObject5 instantiates a new InlineObject5 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineObject5(requiredFile *os.File, ) *InlineObject5 { - this := InlineObject5{} - this.RequiredFile = requiredFile - return &this -} - -// NewInlineObject5WithDefaults instantiates a new InlineObject5 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineObject5WithDefaults() *InlineObject5 { - this := InlineObject5{} - return &this -} - -// GetAdditionalMetadata returns the AdditionalMetadata field value if set, zero value otherwise. -func (o *InlineObject5) GetAdditionalMetadata() string { - if o == nil || o.AdditionalMetadata == nil { - var ret string - return ret - } - return *o.AdditionalMetadata -} - -// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineObject5) GetAdditionalMetadataOk() (*string, bool) { - if o == nil || o.AdditionalMetadata == nil { - return nil, false - } - return o.AdditionalMetadata, true -} - -// HasAdditionalMetadata returns a boolean if a field has been set. -func (o *InlineObject5) HasAdditionalMetadata() bool { - if o != nil && o.AdditionalMetadata != nil { - return true - } - - return false -} - -// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. -func (o *InlineObject5) SetAdditionalMetadata(v string) { - o.AdditionalMetadata = &v -} - -// GetRequiredFile returns the RequiredFile field value -func (o *InlineObject5) GetRequiredFile() *os.File { - if o == nil { - var ret *os.File - return ret - } - - return o.RequiredFile -} - -// GetRequiredFileOk returns a tuple with the RequiredFile field value -// and a boolean to check if the value has been set. -func (o *InlineObject5) GetRequiredFileOk() (**os.File, bool) { - if o == nil { - return nil, false - } - return &o.RequiredFile, true -} - -// SetRequiredFile sets field value -func (o *InlineObject5) SetRequiredFile(v *os.File) { - o.RequiredFile = v -} - -func (o InlineObject5) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.AdditionalMetadata != nil { - toSerialize["additionalMetadata"] = o.AdditionalMetadata - } - if true { - toSerialize["requiredFile"] = o.RequiredFile - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineObject5) UnmarshalJSON(bytes []byte) (err error) { - varInlineObject5 := _InlineObject5{} - - if err = json.Unmarshal(bytes, &varInlineObject5); err == nil { - *o = InlineObject5(varInlineObject5) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "additionalMetadata") - delete(additionalProperties, "requiredFile") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineObject5 struct { - value *InlineObject5 - isSet bool -} - -func (v NullableInlineObject5) Get() *InlineObject5 { - return v.value -} - -func (v *NullableInlineObject5) Set(val *InlineObject5) { - v.value = val - v.isSet = true -} - -func (v NullableInlineObject5) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineObject5) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineObject5(val *InlineObject5) *NullableInlineObject5 { - return &NullableInlineObject5{value: val, isSet: true} -} - -func (v NullableInlineObject5) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineObject5) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go deleted file mode 100644 index 70e9023e731..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// InlineResponseDefault struct for InlineResponseDefault -type InlineResponseDefault struct { - String *Foo `json:"string,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _InlineResponseDefault InlineResponseDefault - -// NewInlineResponseDefault instantiates a new InlineResponseDefault object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineResponseDefault() *InlineResponseDefault { - this := InlineResponseDefault{} - return &this -} - -// NewInlineResponseDefaultWithDefaults instantiates a new InlineResponseDefault object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineResponseDefaultWithDefaults() *InlineResponseDefault { - this := InlineResponseDefault{} - return &this -} - -// GetString returns the String field value if set, zero value otherwise. -func (o *InlineResponseDefault) GetString() Foo { - if o == nil || o.String == nil { - var ret Foo - return ret - } - return *o.String -} - -// GetStringOk returns a tuple with the String field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InlineResponseDefault) GetStringOk() (*Foo, bool) { - if o == nil || o.String == nil { - return nil, false - } - return o.String, true -} - -// HasString returns a boolean if a field has been set. -func (o *InlineResponseDefault) HasString() bool { - if o != nil && o.String != nil { - return true - } - - return false -} - -// SetString gets a reference to the given Foo and assigns it to the String field. -func (o *InlineResponseDefault) SetString(v Foo) { - o.String = &v -} - -func (o InlineResponseDefault) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.String != nil { - toSerialize["string"] = o.String - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *InlineResponseDefault) UnmarshalJSON(bytes []byte) (err error) { - varInlineResponseDefault := _InlineResponseDefault{} - - if err = json.Unmarshal(bytes, &varInlineResponseDefault); err == nil { - *o = InlineResponseDefault(varInlineResponseDefault) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "string") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableInlineResponseDefault struct { - value *InlineResponseDefault - isSet bool -} - -func (v NullableInlineResponseDefault) Get() *InlineResponseDefault { - return v.value -} - -func (v *NullableInlineResponseDefault) Set(val *InlineResponseDefault) { - v.value = val - v.isSet = true -} - -func (v NullableInlineResponseDefault) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineResponseDefault) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineResponseDefault(val *InlineResponseDefault) *NullableInlineResponseDefault { - return &NullableInlineResponseDefault{value: val, isSet: true} -} - -func (v NullableInlineResponseDefault) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineResponseDefault) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go deleted file mode 100644 index 565452b2067..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// List struct for List -type List struct { - Var123List *string `json:"123-list,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _List List - -// NewList instantiates a new List object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewList() *List { - this := List{} - return &this -} - -// NewListWithDefaults instantiates a new List object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListWithDefaults() *List { - this := List{} - return &this -} - -// GetVar123List returns the Var123List field value if set, zero value otherwise. -func (o *List) GetVar123List() string { - if o == nil || o.Var123List == nil { - var ret string - return ret - } - return *o.Var123List -} - -// GetVar123ListOk returns a tuple with the Var123List field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *List) GetVar123ListOk() (*string, bool) { - if o == nil || o.Var123List == nil { - return nil, false - } - return o.Var123List, true -} - -// HasVar123List returns a boolean if a field has been set. -func (o *List) HasVar123List() bool { - if o != nil && o.Var123List != nil { - return true - } - - return false -} - -// SetVar123List gets a reference to the given string and assigns it to the Var123List field. -func (o *List) SetVar123List(v string) { - o.Var123List = &v -} - -func (o List) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Var123List != nil { - toSerialize["123-list"] = o.Var123List - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *List) UnmarshalJSON(bytes []byte) (err error) { - varList := _List{} - - if err = json.Unmarshal(bytes, &varList); err == nil { - *o = List(varList) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "123-list") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableList struct { - value *List - isSet bool -} - -func (v NullableList) Get() *List { - return v.value -} - -func (v *NullableList) Set(val *List) { - v.value = val - v.isSet = true -} - -func (v NullableList) IsSet() bool { - return v.isSet -} - -func (v *NullableList) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableList(val *List) *NullableList { - return &NullableList{value: val, isSet: true} -} - -func (v NullableList) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go deleted file mode 100644 index 7bd5860170b..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ /dev/null @@ -1,250 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// MapTest struct for MapTest -type MapTest struct { - MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` - MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` - DirectMap *map[string]bool `json:"direct_map,omitempty"` - IndirectMap *map[string]bool `json:"indirect_map,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _MapTest MapTest - -// NewMapTest instantiates a new MapTest object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMapTest() *MapTest { - this := MapTest{} - return &this -} - -// NewMapTestWithDefaults instantiates a new MapTest object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMapTestWithDefaults() *MapTest { - this := MapTest{} - return &this -} - -// GetMapMapOfString returns the MapMapOfString field value if set, zero value otherwise. -func (o *MapTest) GetMapMapOfString() map[string]map[string]string { - if o == nil || o.MapMapOfString == nil { - var ret map[string]map[string]string - return ret - } - return *o.MapMapOfString -} - -// GetMapMapOfStringOk returns a tuple with the MapMapOfString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool) { - if o == nil || o.MapMapOfString == nil { - return nil, false - } - return o.MapMapOfString, true -} - -// HasMapMapOfString returns a boolean if a field has been set. -func (o *MapTest) HasMapMapOfString() bool { - if o != nil && o.MapMapOfString != nil { - return true - } - - return false -} - -// SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. -func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { - o.MapMapOfString = &v -} - -// GetMapOfEnumString returns the MapOfEnumString field value if set, zero value otherwise. -func (o *MapTest) GetMapOfEnumString() map[string]string { - if o == nil || o.MapOfEnumString == nil { - var ret map[string]string - return ret - } - return *o.MapOfEnumString -} - -// GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool) { - if o == nil || o.MapOfEnumString == nil { - return nil, false - } - return o.MapOfEnumString, true -} - -// HasMapOfEnumString returns a boolean if a field has been set. -func (o *MapTest) HasMapOfEnumString() bool { - if o != nil && o.MapOfEnumString != nil { - return true - } - - return false -} - -// SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. -func (o *MapTest) SetMapOfEnumString(v map[string]string) { - o.MapOfEnumString = &v -} - -// GetDirectMap returns the DirectMap field value if set, zero value otherwise. -func (o *MapTest) GetDirectMap() map[string]bool { - if o == nil || o.DirectMap == nil { - var ret map[string]bool - return ret - } - return *o.DirectMap -} - -// GetDirectMapOk returns a tuple with the DirectMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool) { - if o == nil || o.DirectMap == nil { - return nil, false - } - return o.DirectMap, true -} - -// HasDirectMap returns a boolean if a field has been set. -func (o *MapTest) HasDirectMap() bool { - if o != nil && o.DirectMap != nil { - return true - } - - return false -} - -// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. -func (o *MapTest) SetDirectMap(v map[string]bool) { - o.DirectMap = &v -} - -// GetIndirectMap returns the IndirectMap field value if set, zero value otherwise. -func (o *MapTest) GetIndirectMap() map[string]bool { - if o == nil || o.IndirectMap == nil { - var ret map[string]bool - return ret - } - return *o.IndirectMap -} - -// GetIndirectMapOk returns a tuple with the IndirectMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool) { - if o == nil || o.IndirectMap == nil { - return nil, false - } - return o.IndirectMap, true -} - -// HasIndirectMap returns a boolean if a field has been set. -func (o *MapTest) HasIndirectMap() bool { - if o != nil && o.IndirectMap != nil { - return true - } - - return false -} - -// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. -func (o *MapTest) SetIndirectMap(v map[string]bool) { - o.IndirectMap = &v -} - -func (o MapTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MapMapOfString != nil { - toSerialize["map_map_of_string"] = o.MapMapOfString - } - if o.MapOfEnumString != nil { - toSerialize["map_of_enum_string"] = o.MapOfEnumString - } - if o.DirectMap != nil { - toSerialize["direct_map"] = o.DirectMap - } - if o.IndirectMap != nil { - toSerialize["indirect_map"] = o.IndirectMap - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *MapTest) UnmarshalJSON(bytes []byte) (err error) { - varMapTest := _MapTest{} - - if err = json.Unmarshal(bytes, &varMapTest); err == nil { - *o = MapTest(varMapTest) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "map_map_of_string") - delete(additionalProperties, "map_of_enum_string") - delete(additionalProperties, "direct_map") - delete(additionalProperties, "indirect_map") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableMapTest struct { - value *MapTest - isSet bool -} - -func (v NullableMapTest) Get() *MapTest { - return v.value -} - -func (v *NullableMapTest) Set(val *MapTest) { - v.value = val - v.isSet = true -} - -func (v NullableMapTest) IsSet() bool { - return v.isSet -} - -func (v *NullableMapTest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMapTest(val *MapTest) *NullableMapTest { - return &NullableMapTest{value: val, isSet: true} -} - -func (v NullableMapTest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMapTest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go deleted file mode 100644 index 752ccff41ea..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ /dev/null @@ -1,214 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "time" -) - -// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass -type MixedPropertiesAndAdditionalPropertiesClass struct { - Uuid *string `json:"uuid,omitempty"` - DateTime *time.Time `json:"dateTime,omitempty"` - Map *map[string]Animal `json:"map,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _MixedPropertiesAndAdditionalPropertiesClass MixedPropertiesAndAdditionalPropertiesClass - -// NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass { - this := MixedPropertiesAndAdditionalPropertiesClass{} - return &this -} - -// NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass { - this := MixedPropertiesAndAdditionalPropertiesClass{} - return &this -} - -// GetUuid returns the Uuid field value if set, zero value otherwise. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { - if o == nil || o.Uuid == nil { - var ret string - return ret - } - return *o.Uuid -} - -// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool) { - if o == nil || o.Uuid == nil { - return nil, false - } - return o.Uuid, true -} - -// HasUuid returns a boolean if a field has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { - if o != nil && o.Uuid != nil { - return true - } - - return false -} - -// SetUuid gets a reference to the given string and assigns it to the Uuid field. -func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { - o.Uuid = &v -} - -// GetDateTime returns the DateTime field value if set, zero value otherwise. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { - if o == nil || o.DateTime == nil { - var ret time.Time - return ret - } - return *o.DateTime -} - -// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool) { - if o == nil || o.DateTime == nil { - return nil, false - } - return o.DateTime, true -} - -// HasDateTime returns a boolean if a field has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { - if o != nil && o.DateTime != nil { - return true - } - - return false -} - -// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. -func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { - o.DateTime = &v -} - -// GetMap returns the Map field value if set, zero value otherwise. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { - if o == nil || o.Map == nil { - var ret map[string]Animal - return ret - } - return *o.Map -} - -// GetMapOk returns a tuple with the Map field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool) { - if o == nil || o.Map == nil { - return nil, false - } - return o.Map, true -} - -// HasMap returns a boolean if a field has been set. -func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { - if o != nil && o.Map != nil { - return true - } - - return false -} - -// SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. -func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal) { - o.Map = &v -} - -func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Uuid != nil { - toSerialize["uuid"] = o.Uuid - } - if o.DateTime != nil { - toSerialize["dateTime"] = o.DateTime - } - if o.Map != nil { - toSerialize["map"] = o.Map - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *MixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) { - varMixedPropertiesAndAdditionalPropertiesClass := _MixedPropertiesAndAdditionalPropertiesClass{} - - if err = json.Unmarshal(bytes, &varMixedPropertiesAndAdditionalPropertiesClass); err == nil { - *o = MixedPropertiesAndAdditionalPropertiesClass(varMixedPropertiesAndAdditionalPropertiesClass) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "uuid") - delete(additionalProperties, "dateTime") - delete(additionalProperties, "map") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableMixedPropertiesAndAdditionalPropertiesClass struct { - value *MixedPropertiesAndAdditionalPropertiesClass - isSet bool -} - -func (v NullableMixedPropertiesAndAdditionalPropertiesClass) Get() *MixedPropertiesAndAdditionalPropertiesClass { - return v.value -} - -func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Set(val *MixedPropertiesAndAdditionalPropertiesClass) { - v.value = val - v.isSet = true -} - -func (v NullableMixedPropertiesAndAdditionalPropertiesClass) IsSet() bool { - return v.isSet -} - -func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableMixedPropertiesAndAdditionalPropertiesClass(val *MixedPropertiesAndAdditionalPropertiesClass) *NullableMixedPropertiesAndAdditionalPropertiesClass { - return &NullableMixedPropertiesAndAdditionalPropertiesClass{value: val, isSet: true} -} - -func (v NullableMixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go deleted file mode 100644 index c66130c5bf3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go +++ /dev/null @@ -1,243 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Name Model for testing model name same as property name -type Name struct { - Name int32 `json:"name"` - SnakeCase *int32 `json:"snake_case,omitempty"` - Property *string `json:"property,omitempty"` - Var123Number *int32 `json:"123Number,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Name Name - -// NewName instantiates a new Name object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewName(name int32, ) *Name { - this := Name{} - this.Name = name - return &this -} - -// NewNameWithDefaults instantiates a new Name object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNameWithDefaults() *Name { - this := Name{} - return &this -} - -// GetName returns the Name field value -func (o *Name) GetName() int32 { - if o == nil { - var ret int32 - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Name) GetNameOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Name) SetName(v int32) { - o.Name = v -} - -// GetSnakeCase returns the SnakeCase field value if set, zero value otherwise. -func (o *Name) GetSnakeCase() int32 { - if o == nil || o.SnakeCase == nil { - var ret int32 - return ret - } - return *o.SnakeCase -} - -// GetSnakeCaseOk returns a tuple with the SnakeCase field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Name) GetSnakeCaseOk() (*int32, bool) { - if o == nil || o.SnakeCase == nil { - return nil, false - } - return o.SnakeCase, true -} - -// HasSnakeCase returns a boolean if a field has been set. -func (o *Name) HasSnakeCase() bool { - if o != nil && o.SnakeCase != nil { - return true - } - - return false -} - -// SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. -func (o *Name) SetSnakeCase(v int32) { - o.SnakeCase = &v -} - -// GetProperty returns the Property field value if set, zero value otherwise. -func (o *Name) GetProperty() string { - if o == nil || o.Property == nil { - var ret string - return ret - } - return *o.Property -} - -// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Name) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false - } - return o.Property, true -} - -// HasProperty returns a boolean if a field has been set. -func (o *Name) HasProperty() bool { - if o != nil && o.Property != nil { - return true - } - - return false -} - -// SetProperty gets a reference to the given string and assigns it to the Property field. -func (o *Name) SetProperty(v string) { - o.Property = &v -} - -// GetVar123Number returns the Var123Number field value if set, zero value otherwise. -func (o *Name) GetVar123Number() int32 { - if o == nil || o.Var123Number == nil { - var ret int32 - return ret - } - return *o.Var123Number -} - -// GetVar123NumberOk returns a tuple with the Var123Number field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Name) GetVar123NumberOk() (*int32, bool) { - if o == nil || o.Var123Number == nil { - return nil, false - } - return o.Var123Number, true -} - -// HasVar123Number returns a boolean if a field has been set. -func (o *Name) HasVar123Number() bool { - if o != nil && o.Var123Number != nil { - return true - } - - return false -} - -// SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. -func (o *Name) SetVar123Number(v int32) { - o.Var123Number = &v -} - -func (o Name) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["name"] = o.Name - } - if o.SnakeCase != nil { - toSerialize["snake_case"] = o.SnakeCase - } - if o.Property != nil { - toSerialize["property"] = o.Property - } - if o.Var123Number != nil { - toSerialize["123Number"] = o.Var123Number - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Name) UnmarshalJSON(bytes []byte) (err error) { - varName := _Name{} - - if err = json.Unmarshal(bytes, &varName); err == nil { - *o = Name(varName) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "name") - delete(additionalProperties, "snake_case") - delete(additionalProperties, "property") - delete(additionalProperties, "123Number") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableName struct { - value *Name - isSet bool -} - -func (v NullableName) Get() *Name { - return v.value -} - -func (v *NullableName) Set(val *Name) { - v.value = val - v.isSet = true -} - -func (v NullableName) IsSet() bool { - return v.isSet -} - -func (v *NullableName) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableName(val *Name) *NullableName { - return &NullableName{value: val, isSet: true} -} - -func (v NullableName) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableName) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go deleted file mode 100644 index 72deb6ecf44..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go +++ /dev/null @@ -1,575 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "time" -) - -// NullableClass struct for NullableClass -type NullableClass struct { - IntegerProp NullableInt32 `json:"integer_prop,omitempty"` - NumberProp NullableFloat32 `json:"number_prop,omitempty"` - BooleanProp NullableBool `json:"boolean_prop,omitempty"` - StringProp NullableString `json:"string_prop,omitempty"` - DateProp NullableString `json:"date_prop,omitempty"` - DatetimeProp NullableTime `json:"datetime_prop,omitempty"` - ArrayNullableProp []map[string]interface{} `json:"array_nullable_prop,omitempty"` - ArrayAndItemsNullableProp []map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` - ArrayItemsNullable *[]map[string]interface{} `json:"array_items_nullable,omitempty"` - ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` - ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` - ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` -} - -// NewNullableClass instantiates a new NullableClass object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNullableClass() *NullableClass { - this := NullableClass{} - return &this -} - -// NewNullableClassWithDefaults instantiates a new NullableClass object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNullableClassWithDefaults() *NullableClass { - this := NullableClass{} - return &this -} - -// GetIntegerProp returns the IntegerProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetIntegerProp() int32 { - if o == nil || o.IntegerProp.Get() == nil { - var ret int32 - return ret - } - return *o.IntegerProp.Get() -} - -// GetIntegerPropOk returns a tuple with the IntegerProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetIntegerPropOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.IntegerProp.Get(), o.IntegerProp.IsSet() -} - -// HasIntegerProp returns a boolean if a field has been set. -func (o *NullableClass) HasIntegerProp() bool { - if o != nil && o.IntegerProp.IsSet() { - return true - } - - return false -} - -// SetIntegerProp gets a reference to the given NullableInt32 and assigns it to the IntegerProp field. -func (o *NullableClass) SetIntegerProp(v int32) { - o.IntegerProp.Set(&v) -} -// SetIntegerPropNil sets the value for IntegerProp to be an explicit nil -func (o *NullableClass) SetIntegerPropNil() { - o.IntegerProp.Set(nil) -} - -// UnsetIntegerProp ensures that no value is present for IntegerProp, not even an explicit nil -func (o *NullableClass) UnsetIntegerProp() { - o.IntegerProp.Unset() -} - -// GetNumberProp returns the NumberProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetNumberProp() float32 { - if o == nil || o.NumberProp.Get() == nil { - var ret float32 - return ret - } - return *o.NumberProp.Get() -} - -// GetNumberPropOk returns a tuple with the NumberProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetNumberPropOk() (*float32, bool) { - if o == nil { - return nil, false - } - return o.NumberProp.Get(), o.NumberProp.IsSet() -} - -// HasNumberProp returns a boolean if a field has been set. -func (o *NullableClass) HasNumberProp() bool { - if o != nil && o.NumberProp.IsSet() { - return true - } - - return false -} - -// SetNumberProp gets a reference to the given NullableFloat32 and assigns it to the NumberProp field. -func (o *NullableClass) SetNumberProp(v float32) { - o.NumberProp.Set(&v) -} -// SetNumberPropNil sets the value for NumberProp to be an explicit nil -func (o *NullableClass) SetNumberPropNil() { - o.NumberProp.Set(nil) -} - -// UnsetNumberProp ensures that no value is present for NumberProp, not even an explicit nil -func (o *NullableClass) UnsetNumberProp() { - o.NumberProp.Unset() -} - -// GetBooleanProp returns the BooleanProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetBooleanProp() bool { - if o == nil || o.BooleanProp.Get() == nil { - var ret bool - return ret - } - return *o.BooleanProp.Get() -} - -// GetBooleanPropOk returns a tuple with the BooleanProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetBooleanPropOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.BooleanProp.Get(), o.BooleanProp.IsSet() -} - -// HasBooleanProp returns a boolean if a field has been set. -func (o *NullableClass) HasBooleanProp() bool { - if o != nil && o.BooleanProp.IsSet() { - return true - } - - return false -} - -// SetBooleanProp gets a reference to the given NullableBool and assigns it to the BooleanProp field. -func (o *NullableClass) SetBooleanProp(v bool) { - o.BooleanProp.Set(&v) -} -// SetBooleanPropNil sets the value for BooleanProp to be an explicit nil -func (o *NullableClass) SetBooleanPropNil() { - o.BooleanProp.Set(nil) -} - -// UnsetBooleanProp ensures that no value is present for BooleanProp, not even an explicit nil -func (o *NullableClass) UnsetBooleanProp() { - o.BooleanProp.Unset() -} - -// GetStringProp returns the StringProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetStringProp() string { - if o == nil || o.StringProp.Get() == nil { - var ret string - return ret - } - return *o.StringProp.Get() -} - -// GetStringPropOk returns a tuple with the StringProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetStringPropOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.StringProp.Get(), o.StringProp.IsSet() -} - -// HasStringProp returns a boolean if a field has been set. -func (o *NullableClass) HasStringProp() bool { - if o != nil && o.StringProp.IsSet() { - return true - } - - return false -} - -// SetStringProp gets a reference to the given NullableString and assigns it to the StringProp field. -func (o *NullableClass) SetStringProp(v string) { - o.StringProp.Set(&v) -} -// SetStringPropNil sets the value for StringProp to be an explicit nil -func (o *NullableClass) SetStringPropNil() { - o.StringProp.Set(nil) -} - -// UnsetStringProp ensures that no value is present for StringProp, not even an explicit nil -func (o *NullableClass) UnsetStringProp() { - o.StringProp.Unset() -} - -// GetDateProp returns the DateProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetDateProp() string { - if o == nil || o.DateProp.Get() == nil { - var ret string - return ret - } - return *o.DateProp.Get() -} - -// GetDatePropOk returns a tuple with the DateProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetDatePropOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DateProp.Get(), o.DateProp.IsSet() -} - -// HasDateProp returns a boolean if a field has been set. -func (o *NullableClass) HasDateProp() bool { - if o != nil && o.DateProp.IsSet() { - return true - } - - return false -} - -// SetDateProp gets a reference to the given NullableString and assigns it to the DateProp field. -func (o *NullableClass) SetDateProp(v string) { - o.DateProp.Set(&v) -} -// SetDatePropNil sets the value for DateProp to be an explicit nil -func (o *NullableClass) SetDatePropNil() { - o.DateProp.Set(nil) -} - -// UnsetDateProp ensures that no value is present for DateProp, not even an explicit nil -func (o *NullableClass) UnsetDateProp() { - o.DateProp.Unset() -} - -// GetDatetimeProp returns the DatetimeProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetDatetimeProp() time.Time { - if o == nil || o.DatetimeProp.Get() == nil { - var ret time.Time - return ret - } - return *o.DatetimeProp.Get() -} - -// GetDatetimePropOk returns a tuple with the DatetimeProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetDatetimePropOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return o.DatetimeProp.Get(), o.DatetimeProp.IsSet() -} - -// HasDatetimeProp returns a boolean if a field has been set. -func (o *NullableClass) HasDatetimeProp() bool { - if o != nil && o.DatetimeProp.IsSet() { - return true - } - - return false -} - -// SetDatetimeProp gets a reference to the given NullableTime and assigns it to the DatetimeProp field. -func (o *NullableClass) SetDatetimeProp(v time.Time) { - o.DatetimeProp.Set(&v) -} -// SetDatetimePropNil sets the value for DatetimeProp to be an explicit nil -func (o *NullableClass) SetDatetimePropNil() { - o.DatetimeProp.Set(nil) -} - -// UnsetDatetimeProp ensures that no value is present for DatetimeProp, not even an explicit nil -func (o *NullableClass) UnsetDatetimeProp() { - o.DatetimeProp.Unset() -} - -// GetArrayNullableProp returns the ArrayNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { - if o == nil { - var ret []map[string]interface{} - return ret - } - return o.ArrayNullableProp -} - -// GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetArrayNullablePropOk() (*[]map[string]interface{}, bool) { - if o == nil || o.ArrayNullableProp == nil { - return nil, false - } - return &o.ArrayNullableProp, true -} - -// HasArrayNullableProp returns a boolean if a field has been set. -func (o *NullableClass) HasArrayNullableProp() bool { - if o != nil && o.ArrayNullableProp != nil { - return true - } - - return false -} - -// SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. -func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { - o.ArrayNullableProp = v -} - -// GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} { - if o == nil { - var ret []map[string]interface{} - return ret - } - return o.ArrayAndItemsNullableProp -} - -// GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]map[string]interface{}, bool) { - if o == nil || o.ArrayAndItemsNullableProp == nil { - return nil, false - } - return &o.ArrayAndItemsNullableProp, true -} - -// HasArrayAndItemsNullableProp returns a boolean if a field has been set. -func (o *NullableClass) HasArrayAndItemsNullableProp() bool { - if o != nil && o.ArrayAndItemsNullableProp != nil { - return true - } - - return false -} - -// SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. -func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{}) { - o.ArrayAndItemsNullableProp = v -} - -// GetArrayItemsNullable returns the ArrayItemsNullable field value if set, zero value otherwise. -func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{} { - if o == nil || o.ArrayItemsNullable == nil { - var ret []map[string]interface{} - return ret - } - return *o.ArrayItemsNullable -} - -// GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NullableClass) GetArrayItemsNullableOk() (*[]map[string]interface{}, bool) { - if o == nil || o.ArrayItemsNullable == nil { - return nil, false - } - return o.ArrayItemsNullable, true -} - -// HasArrayItemsNullable returns a boolean if a field has been set. -func (o *NullableClass) HasArrayItemsNullable() bool { - if o != nil && o.ArrayItemsNullable != nil { - return true - } - - return false -} - -// SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. -func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{}) { - o.ArrayItemsNullable = &v -} - -// GetObjectNullableProp returns the ObjectNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{} { - if o == nil { - var ret map[string]map[string]interface{} - return ret - } - return o.ObjectNullableProp -} - -// GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetObjectNullablePropOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.ObjectNullableProp == nil { - return nil, false - } - return &o.ObjectNullableProp, true -} - -// HasObjectNullableProp returns a boolean if a field has been set. -func (o *NullableClass) HasObjectNullableProp() bool { - if o != nil && o.ObjectNullableProp != nil { - return true - } - - return false -} - -// SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. -func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{}) { - o.ObjectNullableProp = v -} - -// GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{} { - if o == nil { - var ret map[string]map[string]interface{} - return ret - } - return o.ObjectAndItemsNullableProp -} - -// GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *NullableClass) GetObjectAndItemsNullablePropOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.ObjectAndItemsNullableProp == nil { - return nil, false - } - return &o.ObjectAndItemsNullableProp, true -} - -// HasObjectAndItemsNullableProp returns a boolean if a field has been set. -func (o *NullableClass) HasObjectAndItemsNullableProp() bool { - if o != nil && o.ObjectAndItemsNullableProp != nil { - return true - } - - return false -} - -// SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. -func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{}) { - o.ObjectAndItemsNullableProp = v -} - -// GetObjectItemsNullable returns the ObjectItemsNullable field value if set, zero value otherwise. -func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{} { - if o == nil || o.ObjectItemsNullable == nil { - var ret map[string]map[string]interface{} - return ret - } - return *o.ObjectItemsNullable -} - -// GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NullableClass) GetObjectItemsNullableOk() (*map[string]map[string]interface{}, bool) { - if o == nil || o.ObjectItemsNullable == nil { - return nil, false - } - return o.ObjectItemsNullable, true -} - -// HasObjectItemsNullable returns a boolean if a field has been set. -func (o *NullableClass) HasObjectItemsNullable() bool { - if o != nil && o.ObjectItemsNullable != nil { - return true - } - - return false -} - -// SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. -func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{}) { - o.ObjectItemsNullable = &v -} - -func (o NullableClass) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.IntegerProp.IsSet() { - toSerialize["integer_prop"] = o.IntegerProp.Get() - } - if o.NumberProp.IsSet() { - toSerialize["number_prop"] = o.NumberProp.Get() - } - if o.BooleanProp.IsSet() { - toSerialize["boolean_prop"] = o.BooleanProp.Get() - } - if o.StringProp.IsSet() { - toSerialize["string_prop"] = o.StringProp.Get() - } - if o.DateProp.IsSet() { - toSerialize["date_prop"] = o.DateProp.Get() - } - if o.DatetimeProp.IsSet() { - toSerialize["datetime_prop"] = o.DatetimeProp.Get() - } - if o.ArrayNullableProp != nil { - toSerialize["array_nullable_prop"] = o.ArrayNullableProp - } - if o.ArrayAndItemsNullableProp != nil { - toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp - } - if o.ArrayItemsNullable != nil { - toSerialize["array_items_nullable"] = o.ArrayItemsNullable - } - if o.ObjectNullableProp != nil { - toSerialize["object_nullable_prop"] = o.ObjectNullableProp - } - if o.ObjectAndItemsNullableProp != nil { - toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp - } - if o.ObjectItemsNullable != nil { - toSerialize["object_items_nullable"] = o.ObjectItemsNullable - } - return json.Marshal(toSerialize) -} - -type NullableNullableClass struct { - value *NullableClass - isSet bool -} - -func (v NullableNullableClass) Get() *NullableClass { - return v.value -} - -func (v *NullableNullableClass) Set(val *NullableClass) { - v.value = val - v.isSet = true -} - -func (v NullableNullableClass) IsSet() bool { - return v.isSet -} - -func (v *NullableNullableClass) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNullableClass(val *NullableClass) *NullableNullableClass { - return &NullableNullableClass{value: val, isSet: true} -} - -func (v NullableNullableClass) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNullableClass) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go deleted file mode 100644 index a0a6f01be08..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// NumberOnly struct for NumberOnly -type NumberOnly struct { - JustNumber *float32 `json:"JustNumber,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _NumberOnly NumberOnly - -// NewNumberOnly instantiates a new NumberOnly object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewNumberOnly() *NumberOnly { - this := NumberOnly{} - return &this -} - -// NewNumberOnlyWithDefaults instantiates a new NumberOnly object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewNumberOnlyWithDefaults() *NumberOnly { - this := NumberOnly{} - return &this -} - -// GetJustNumber returns the JustNumber field value if set, zero value otherwise. -func (o *NumberOnly) GetJustNumber() float32 { - if o == nil || o.JustNumber == nil { - var ret float32 - return ret - } - return *o.JustNumber -} - -// GetJustNumberOk returns a tuple with the JustNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *NumberOnly) GetJustNumberOk() (*float32, bool) { - if o == nil || o.JustNumber == nil { - return nil, false - } - return o.JustNumber, true -} - -// HasJustNumber returns a boolean if a field has been set. -func (o *NumberOnly) HasJustNumber() bool { - if o != nil && o.JustNumber != nil { - return true - } - - return false -} - -// SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. -func (o *NumberOnly) SetJustNumber(v float32) { - o.JustNumber = &v -} - -func (o NumberOnly) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.JustNumber != nil { - toSerialize["JustNumber"] = o.JustNumber - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *NumberOnly) UnmarshalJSON(bytes []byte) (err error) { - varNumberOnly := _NumberOnly{} - - if err = json.Unmarshal(bytes, &varNumberOnly); err == nil { - *o = NumberOnly(varNumberOnly) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "JustNumber") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableNumberOnly struct { - value *NumberOnly - isSet bool -} - -func (v NullableNumberOnly) Get() *NumberOnly { - return v.value -} - -func (v *NullableNumberOnly) Set(val *NumberOnly) { - v.value = val - v.isSet = true -} - -func (v NullableNumberOnly) IsSet() bool { - return v.isSet -} - -func (v *NullableNumberOnly) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableNumberOnly(val *NumberOnly) *NullableNumberOnly { - return &NullableNumberOnly{value: val, isSet: true} -} - -func (v NullableNumberOnly) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableNumberOnly) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go deleted file mode 100644 index 83e6d9fdeb3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go +++ /dev/null @@ -1,330 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "time" -) - -// Order struct for Order -type Order struct { - Id *int64 `json:"id,omitempty"` - PetId *int64 `json:"petId,omitempty"` - Quantity *int32 `json:"quantity,omitempty"` - ShipDate *time.Time `json:"shipDate,omitempty"` - // Order Status - Status *string `json:"status,omitempty"` - Complete *bool `json:"complete,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Order Order - -// NewOrder instantiates a new Order object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOrder() *Order { - this := Order{} - var complete bool = false - this.Complete = &complete - return &this -} - -// NewOrderWithDefaults instantiates a new Order object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOrderWithDefaults() *Order { - this := Order{} - var complete bool = false - this.Complete = &complete - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Order) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Order) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Order) SetId(v int64) { - o.Id = &v -} - -// GetPetId returns the PetId field value if set, zero value otherwise. -func (o *Order) GetPetId() int64 { - if o == nil || o.PetId == nil { - var ret int64 - return ret - } - return *o.PetId -} - -// GetPetIdOk returns a tuple with the PetId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetPetIdOk() (*int64, bool) { - if o == nil || o.PetId == nil { - return nil, false - } - return o.PetId, true -} - -// HasPetId returns a boolean if a field has been set. -func (o *Order) HasPetId() bool { - if o != nil && o.PetId != nil { - return true - } - - return false -} - -// SetPetId gets a reference to the given int64 and assigns it to the PetId field. -func (o *Order) SetPetId(v int64) { - o.PetId = &v -} - -// GetQuantity returns the Quantity field value if set, zero value otherwise. -func (o *Order) GetQuantity() int32 { - if o == nil || o.Quantity == nil { - var ret int32 - return ret - } - return *o.Quantity -} - -// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetQuantityOk() (*int32, bool) { - if o == nil || o.Quantity == nil { - return nil, false - } - return o.Quantity, true -} - -// HasQuantity returns a boolean if a field has been set. -func (o *Order) HasQuantity() bool { - if o != nil && o.Quantity != nil { - return true - } - - return false -} - -// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. -func (o *Order) SetQuantity(v int32) { - o.Quantity = &v -} - -// GetShipDate returns the ShipDate field value if set, zero value otherwise. -func (o *Order) GetShipDate() time.Time { - if o == nil || o.ShipDate == nil { - var ret time.Time - return ret - } - return *o.ShipDate -} - -// GetShipDateOk returns a tuple with the ShipDate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetShipDateOk() (*time.Time, bool) { - if o == nil || o.ShipDate == nil { - return nil, false - } - return o.ShipDate, true -} - -// HasShipDate returns a boolean if a field has been set. -func (o *Order) HasShipDate() bool { - if o != nil && o.ShipDate != nil { - return true - } - - return false -} - -// SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. -func (o *Order) SetShipDate(v time.Time) { - o.ShipDate = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Order) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *Order) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Order) SetStatus(v string) { - o.Status = &v -} - -// GetComplete returns the Complete field value if set, zero value otherwise. -func (o *Order) GetComplete() bool { - if o == nil || o.Complete == nil { - var ret bool - return ret - } - return *o.Complete -} - -// GetCompleteOk returns a tuple with the Complete field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Order) GetCompleteOk() (*bool, bool) { - if o == nil || o.Complete == nil { - return nil, false - } - return o.Complete, true -} - -// HasComplete returns a boolean if a field has been set. -func (o *Order) HasComplete() bool { - if o != nil && o.Complete != nil { - return true - } - - return false -} - -// SetComplete gets a reference to the given bool and assigns it to the Complete field. -func (o *Order) SetComplete(v bool) { - o.Complete = &v -} - -func (o Order) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.PetId != nil { - toSerialize["petId"] = o.PetId - } - if o.Quantity != nil { - toSerialize["quantity"] = o.Quantity - } - if o.ShipDate != nil { - toSerialize["shipDate"] = o.ShipDate - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - if o.Complete != nil { - toSerialize["complete"] = o.Complete - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Order) UnmarshalJSON(bytes []byte) (err error) { - varOrder := _Order{} - - if err = json.Unmarshal(bytes, &varOrder); err == nil { - *o = Order(varOrder) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "petId") - delete(additionalProperties, "quantity") - delete(additionalProperties, "shipDate") - delete(additionalProperties, "status") - delete(additionalProperties, "complete") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableOrder struct { - value *Order - isSet bool -} - -func (v NullableOrder) Get() *Order { - return v.value -} - -func (v *NullableOrder) Set(val *Order) { - v.value = val - v.isSet = true -} - -func (v NullableOrder) IsSet() bool { - return v.isSet -} - -func (v *NullableOrder) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOrder(val *Order) *NullableOrder { - return &NullableOrder{value: val, isSet: true} -} - -func (v NullableOrder) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOrder) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go deleted file mode 100644 index 2b399e1a97f..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ /dev/null @@ -1,213 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// OuterComposite struct for OuterComposite -type OuterComposite struct { - MyNumber *float32 `json:"my_number,omitempty"` - MyString *string `json:"my_string,omitempty"` - MyBoolean *bool `json:"my_boolean,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _OuterComposite OuterComposite - -// NewOuterComposite instantiates a new OuterComposite object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOuterComposite() *OuterComposite { - this := OuterComposite{} - return &this -} - -// NewOuterCompositeWithDefaults instantiates a new OuterComposite object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOuterCompositeWithDefaults() *OuterComposite { - this := OuterComposite{} - return &this -} - -// GetMyNumber returns the MyNumber field value if set, zero value otherwise. -func (o *OuterComposite) GetMyNumber() float32 { - if o == nil || o.MyNumber == nil { - var ret float32 - return ret - } - return *o.MyNumber -} - -// GetMyNumberOk returns a tuple with the MyNumber field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OuterComposite) GetMyNumberOk() (*float32, bool) { - if o == nil || o.MyNumber == nil { - return nil, false - } - return o.MyNumber, true -} - -// HasMyNumber returns a boolean if a field has been set. -func (o *OuterComposite) HasMyNumber() bool { - if o != nil && o.MyNumber != nil { - return true - } - - return false -} - -// SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. -func (o *OuterComposite) SetMyNumber(v float32) { - o.MyNumber = &v -} - -// GetMyString returns the MyString field value if set, zero value otherwise. -func (o *OuterComposite) GetMyString() string { - if o == nil || o.MyString == nil { - var ret string - return ret - } - return *o.MyString -} - -// GetMyStringOk returns a tuple with the MyString field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OuterComposite) GetMyStringOk() (*string, bool) { - if o == nil || o.MyString == nil { - return nil, false - } - return o.MyString, true -} - -// HasMyString returns a boolean if a field has been set. -func (o *OuterComposite) HasMyString() bool { - if o != nil && o.MyString != nil { - return true - } - - return false -} - -// SetMyString gets a reference to the given string and assigns it to the MyString field. -func (o *OuterComposite) SetMyString(v string) { - o.MyString = &v -} - -// GetMyBoolean returns the MyBoolean field value if set, zero value otherwise. -func (o *OuterComposite) GetMyBoolean() bool { - if o == nil || o.MyBoolean == nil { - var ret bool - return ret - } - return *o.MyBoolean -} - -// GetMyBooleanOk returns a tuple with the MyBoolean field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *OuterComposite) GetMyBooleanOk() (*bool, bool) { - if o == nil || o.MyBoolean == nil { - return nil, false - } - return o.MyBoolean, true -} - -// HasMyBoolean returns a boolean if a field has been set. -func (o *OuterComposite) HasMyBoolean() bool { - if o != nil && o.MyBoolean != nil { - return true - } - - return false -} - -// SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. -func (o *OuterComposite) SetMyBoolean(v bool) { - o.MyBoolean = &v -} - -func (o OuterComposite) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.MyNumber != nil { - toSerialize["my_number"] = o.MyNumber - } - if o.MyString != nil { - toSerialize["my_string"] = o.MyString - } - if o.MyBoolean != nil { - toSerialize["my_boolean"] = o.MyBoolean - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *OuterComposite) UnmarshalJSON(bytes []byte) (err error) { - varOuterComposite := _OuterComposite{} - - if err = json.Unmarshal(bytes, &varOuterComposite); err == nil { - *o = OuterComposite(varOuterComposite) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "my_number") - delete(additionalProperties, "my_string") - delete(additionalProperties, "my_boolean") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableOuterComposite struct { - value *OuterComposite - isSet bool -} - -func (v NullableOuterComposite) Get() *OuterComposite { - return v.value -} - -func (v *NullableOuterComposite) Set(val *OuterComposite) { - v.value = val - v.isSet = true -} - -func (v NullableOuterComposite) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterComposite) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterComposite(val *OuterComposite) *NullableOuterComposite { - return &NullableOuterComposite{value: val, isSet: true} -} - -func (v NullableOuterComposite) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterComposite) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go deleted file mode 100644 index f0297f941dd..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// OuterEnum the model 'OuterEnum' -type OuterEnum string - -// List of OuterEnum -const ( - OUTERENUM_PLACED OuterEnum = "placed" - OUTERENUM_APPROVED OuterEnum = "approved" - OUTERENUM_DELIVERED OuterEnum = "delivered" -) - -func (v *OuterEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnum(value) - for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnum", value) -} - -// Ptr returns reference to OuterEnum value -func (v OuterEnum) Ptr() *OuterEnum { - return &v -} - -type NullableOuterEnum struct { - value *OuterEnum - isSet bool -} - -func (v NullableOuterEnum) Get() *OuterEnum { - return v.value -} - -func (v *NullableOuterEnum) Set(val *OuterEnum) { - v.value = val - v.isSet = true -} - -func (v NullableOuterEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterEnum(val *OuterEnum) *NullableOuterEnum { - return &NullableOuterEnum{value: val, isSet: true} -} - -func (v NullableOuterEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterEnum) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go deleted file mode 100644 index 334feef54a5..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// OuterEnumDefaultValue the model 'OuterEnumDefaultValue' -type OuterEnumDefaultValue string - -// List of OuterEnumDefaultValue -const ( - OUTERENUMDEFAULTVALUE_PLACED OuterEnumDefaultValue = "placed" - OUTERENUMDEFAULTVALUE_APPROVED OuterEnumDefaultValue = "approved" - OUTERENUMDEFAULTVALUE_DELIVERED OuterEnumDefaultValue = "delivered" -) - -func (v *OuterEnumDefaultValue) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnumDefaultValue(value) - for _, existing := range []OuterEnumDefaultValue{ "placed", "approved", "delivered", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnumDefaultValue", value) -} - -// Ptr returns reference to OuterEnumDefaultValue value -func (v OuterEnumDefaultValue) Ptr() *OuterEnumDefaultValue { - return &v -} - -type NullableOuterEnumDefaultValue struct { - value *OuterEnumDefaultValue - isSet bool -} - -func (v NullableOuterEnumDefaultValue) Get() *OuterEnumDefaultValue { - return v.value -} - -func (v *NullableOuterEnumDefaultValue) Set(val *OuterEnumDefaultValue) { - v.value = val - v.isSet = true -} - -func (v NullableOuterEnumDefaultValue) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterEnumDefaultValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterEnumDefaultValue(val *OuterEnumDefaultValue) *NullableOuterEnumDefaultValue { - return &NullableOuterEnumDefaultValue{value: val, isSet: true} -} - -func (v NullableOuterEnumDefaultValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterEnumDefaultValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go deleted file mode 100644 index 025b8a7c70a..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// OuterEnumInteger the model 'OuterEnumInteger' -type OuterEnumInteger int32 - -// List of OuterEnumInteger -const ( - OUTERENUMINTEGER__0 OuterEnumInteger = 0 - OUTERENUMINTEGER__1 OuterEnumInteger = 1 - OUTERENUMINTEGER__2 OuterEnumInteger = 2 -) - -func (v *OuterEnumInteger) UnmarshalJSON(src []byte) error { - var value int32 - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnumInteger(value) - for _, existing := range []OuterEnumInteger{ 0, 1, 2, } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnumInteger", value) -} - -// Ptr returns reference to OuterEnumInteger value -func (v OuterEnumInteger) Ptr() *OuterEnumInteger { - return &v -} - -type NullableOuterEnumInteger struct { - value *OuterEnumInteger - isSet bool -} - -func (v NullableOuterEnumInteger) Get() *OuterEnumInteger { - return v.value -} - -func (v *NullableOuterEnumInteger) Set(val *OuterEnumInteger) { - v.value = val - v.isSet = true -} - -func (v NullableOuterEnumInteger) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterEnumInteger) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterEnumInteger(val *OuterEnumInteger) *NullableOuterEnumInteger { - return &NullableOuterEnumInteger{value: val, isSet: true} -} - -func (v NullableOuterEnumInteger) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterEnumInteger) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go deleted file mode 100644 index 07afc92fac9..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" - "fmt" -) - -// OuterEnumIntegerDefaultValue the model 'OuterEnumIntegerDefaultValue' -type OuterEnumIntegerDefaultValue int32 - -// List of OuterEnumIntegerDefaultValue -const ( - OUTERENUMINTEGERDEFAULTVALUE__0 OuterEnumIntegerDefaultValue = 0 - OUTERENUMINTEGERDEFAULTVALUE__1 OuterEnumIntegerDefaultValue = 1 - OUTERENUMINTEGERDEFAULTVALUE__2 OuterEnumIntegerDefaultValue = 2 -) - -func (v *OuterEnumIntegerDefaultValue) UnmarshalJSON(src []byte) error { - var value int32 - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnumIntegerDefaultValue(value) - for _, existing := range []OuterEnumIntegerDefaultValue{ 0, 1, 2, } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnumIntegerDefaultValue", value) -} - -// Ptr returns reference to OuterEnumIntegerDefaultValue value -func (v OuterEnumIntegerDefaultValue) Ptr() *OuterEnumIntegerDefaultValue { - return &v -} - -type NullableOuterEnumIntegerDefaultValue struct { - value *OuterEnumIntegerDefaultValue - isSet bool -} - -func (v NullableOuterEnumIntegerDefaultValue) Get() *OuterEnumIntegerDefaultValue { - return v.value -} - -func (v *NullableOuterEnumIntegerDefaultValue) Set(val *OuterEnumIntegerDefaultValue) { - v.value = val - v.isSet = true -} - -func (v NullableOuterEnumIntegerDefaultValue) IsSet() bool { - return v.isSet -} - -func (v *NullableOuterEnumIntegerDefaultValue) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableOuterEnumIntegerDefaultValue(val *OuterEnumIntegerDefaultValue) *NullableOuterEnumIntegerDefaultValue { - return &NullableOuterEnumIntegerDefaultValue{value: val, isSet: true} -} - -func (v NullableOuterEnumIntegerDefaultValue) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableOuterEnumIntegerDefaultValue) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go deleted file mode 100644 index fc4505e1da4..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go +++ /dev/null @@ -1,311 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Pet struct for Pet -type Pet struct { - Id *int64 `json:"id,omitempty"` - Category *Category `json:"category,omitempty"` - Name string `json:"name"` - PhotoUrls []string `json:"photoUrls"` - Tags *[]Tag `json:"tags,omitempty"` - // pet status in the store - Status *string `json:"status,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Pet Pet - -// NewPet instantiates a new Pet object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPet(name string, photoUrls []string, ) *Pet { - this := Pet{} - this.Name = name - this.PhotoUrls = photoUrls - return &this -} - -// NewPetWithDefaults instantiates a new Pet object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPetWithDefaults() *Pet { - this := Pet{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Pet) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Pet) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Pet) SetId(v int64) { - o.Id = &v -} - -// GetCategory returns the Category field value if set, zero value otherwise. -func (o *Pet) GetCategory() Category { - if o == nil || o.Category == nil { - var ret Category - return ret - } - return *o.Category -} - -// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetCategoryOk() (*Category, bool) { - if o == nil || o.Category == nil { - return nil, false - } - return o.Category, true -} - -// HasCategory returns a boolean if a field has been set. -func (o *Pet) HasCategory() bool { - if o != nil && o.Category != nil { - return true - } - - return false -} - -// SetCategory gets a reference to the given Category and assigns it to the Category field. -func (o *Pet) SetCategory(v Category) { - o.Category = &v -} - -// GetName returns the Name field value -func (o *Pet) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Pet) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Pet) SetName(v string) { - o.Name = v -} - -// GetPhotoUrls returns the PhotoUrls field value -func (o *Pet) GetPhotoUrls() []string { - if o == nil { - var ret []string - return ret - } - - return o.PhotoUrls -} - -// GetPhotoUrlsOk returns a tuple with the PhotoUrls field value -// and a boolean to check if the value has been set. -func (o *Pet) GetPhotoUrlsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return &o.PhotoUrls, true -} - -// SetPhotoUrls sets field value -func (o *Pet) SetPhotoUrls(v []string) { - o.PhotoUrls = v -} - -// GetTags returns the Tags field value if set, zero value otherwise. -func (o *Pet) GetTags() []Tag { - if o == nil || o.Tags == nil { - var ret []Tag - return ret - } - return *o.Tags -} - -// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetTagsOk() (*[]Tag, bool) { - if o == nil || o.Tags == nil { - return nil, false - } - return o.Tags, true -} - -// HasTags returns a boolean if a field has been set. -func (o *Pet) HasTags() bool { - if o != nil && o.Tags != nil { - return true - } - - return false -} - -// SetTags gets a reference to the given []Tag and assigns it to the Tags field. -func (o *Pet) SetTags(v []Tag) { - o.Tags = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *Pet) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Pet) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *Pet) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *Pet) SetStatus(v string) { - o.Status = &v -} - -func (o Pet) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Category != nil { - toSerialize["category"] = o.Category - } - if true { - toSerialize["name"] = o.Name - } - if true { - toSerialize["photoUrls"] = o.PhotoUrls - } - if o.Tags != nil { - toSerialize["tags"] = o.Tags - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { - varPet := _Pet{} - - if err = json.Unmarshal(bytes, &varPet); err == nil { - *o = Pet(varPet) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "category") - delete(additionalProperties, "name") - delete(additionalProperties, "photoUrls") - delete(additionalProperties, "tags") - delete(additionalProperties, "status") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullablePet struct { - value *Pet - isSet bool -} - -func (v NullablePet) Get() *Pet { - return v.value -} - -func (v *NullablePet) Set(val *Pet) { - v.value = val - v.isSet = true -} - -func (v NullablePet) IsSet() bool { - return v.isSet -} - -func (v *NullablePet) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePet(val *Pet) *NullablePet { - return &NullablePet{value: val, isSet: true} -} - -func (v NullablePet) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePet) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go deleted file mode 100644 index 206e8ef240a..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// ReadOnlyFirst struct for ReadOnlyFirst -type ReadOnlyFirst struct { - Bar *string `json:"bar,omitempty"` - Baz *string `json:"baz,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _ReadOnlyFirst ReadOnlyFirst - -// NewReadOnlyFirst instantiates a new ReadOnlyFirst object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewReadOnlyFirst() *ReadOnlyFirst { - this := ReadOnlyFirst{} - return &this -} - -// NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst { - this := ReadOnlyFirst{} - return &this -} - -// GetBar returns the Bar field value if set, zero value otherwise. -func (o *ReadOnlyFirst) GetBar() string { - if o == nil || o.Bar == nil { - var ret string - return ret - } - return *o.Bar -} - -// GetBarOk returns a tuple with the Bar field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReadOnlyFirst) GetBarOk() (*string, bool) { - if o == nil || o.Bar == nil { - return nil, false - } - return o.Bar, true -} - -// HasBar returns a boolean if a field has been set. -func (o *ReadOnlyFirst) HasBar() bool { - if o != nil && o.Bar != nil { - return true - } - - return false -} - -// SetBar gets a reference to the given string and assigns it to the Bar field. -func (o *ReadOnlyFirst) SetBar(v string) { - o.Bar = &v -} - -// GetBaz returns the Baz field value if set, zero value otherwise. -func (o *ReadOnlyFirst) GetBaz() string { - if o == nil || o.Baz == nil { - var ret string - return ret - } - return *o.Baz -} - -// GetBazOk returns a tuple with the Baz field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ReadOnlyFirst) GetBazOk() (*string, bool) { - if o == nil || o.Baz == nil { - return nil, false - } - return o.Baz, true -} - -// HasBaz returns a boolean if a field has been set. -func (o *ReadOnlyFirst) HasBaz() bool { - if o != nil && o.Baz != nil { - return true - } - - return false -} - -// SetBaz gets a reference to the given string and assigns it to the Baz field. -func (o *ReadOnlyFirst) SetBaz(v string) { - o.Baz = &v -} - -func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Bar != nil { - toSerialize["bar"] = o.Bar - } - if o.Baz != nil { - toSerialize["baz"] = o.Baz - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *ReadOnlyFirst) UnmarshalJSON(bytes []byte) (err error) { - varReadOnlyFirst := _ReadOnlyFirst{} - - if err = json.Unmarshal(bytes, &varReadOnlyFirst); err == nil { - *o = ReadOnlyFirst(varReadOnlyFirst) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "bar") - delete(additionalProperties, "baz") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableReadOnlyFirst struct { - value *ReadOnlyFirst - isSet bool -} - -func (v NullableReadOnlyFirst) Get() *ReadOnlyFirst { - return v.value -} - -func (v *NullableReadOnlyFirst) Set(val *ReadOnlyFirst) { - v.value = val - v.isSet = true -} - -func (v NullableReadOnlyFirst) IsSet() bool { - return v.isSet -} - -func (v *NullableReadOnlyFirst) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableReadOnlyFirst(val *ReadOnlyFirst) *NullableReadOnlyFirst { - return &NullableReadOnlyFirst{value: val, isSet: true} -} - -func (v NullableReadOnlyFirst) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableReadOnlyFirst) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go deleted file mode 100644 index 1d258ad1ef9..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Return Model for testing reserved words -type Return struct { - Return *int32 `json:"return,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Return Return - -// NewReturn instantiates a new Return object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewReturn() *Return { - this := Return{} - return &this -} - -// NewReturnWithDefaults instantiates a new Return object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewReturnWithDefaults() *Return { - this := Return{} - return &this -} - -// GetReturn returns the Return field value if set, zero value otherwise. -func (o *Return) GetReturn() int32 { - if o == nil || o.Return == nil { - var ret int32 - return ret - } - return *o.Return -} - -// GetReturnOk returns a tuple with the Return field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Return) GetReturnOk() (*int32, bool) { - if o == nil || o.Return == nil { - return nil, false - } - return o.Return, true -} - -// HasReturn returns a boolean if a field has been set. -func (o *Return) HasReturn() bool { - if o != nil && o.Return != nil { - return true - } - - return false -} - -// SetReturn gets a reference to the given int32 and assigns it to the Return field. -func (o *Return) SetReturn(v int32) { - o.Return = &v -} - -func (o Return) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Return != nil { - toSerialize["return"] = o.Return - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Return) UnmarshalJSON(bytes []byte) (err error) { - varReturn := _Return{} - - if err = json.Unmarshal(bytes, &varReturn); err == nil { - *o = Return(varReturn) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "return") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableReturn struct { - value *Return - isSet bool -} - -func (v NullableReturn) Get() *Return { - return v.value -} - -func (v *NullableReturn) Set(val *Return) { - v.value = val - v.isSet = true -} - -func (v NullableReturn) IsSet() bool { - return v.isSet -} - -func (v *NullableReturn) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableReturn(val *Return) *NullableReturn { - return &NullableReturn{value: val, isSet: true} -} - -func (v NullableReturn) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableReturn) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go deleted file mode 100644 index 22ede38add3..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go +++ /dev/null @@ -1,176 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// Tag struct for Tag -type Tag struct { - Id *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _Tag Tag - -// NewTag instantiates a new Tag object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewTag() *Tag { - this := Tag{} - return &this -} - -// NewTagWithDefaults instantiates a new Tag object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewTagWithDefaults() *Tag { - this := Tag{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *Tag) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Tag) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Tag) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *Tag) SetId(v int64) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *Tag) GetName() string { - if o == nil || o.Name == nil { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Tag) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *Tag) HasName() bool { - if o != nil && o.Name != nil { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Tag) SetName(v string) { - o.Name = &v -} - -func (o Tag) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Name != nil { - toSerialize["name"] = o.Name - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { - varTag := _Tag{} - - if err = json.Unmarshal(bytes, &varTag); err == nil { - *o = Tag(varTag) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "name") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableTag struct { - value *Tag - isSet bool -} - -func (v NullableTag) Get() *Tag { - return v.value -} - -func (v *NullableTag) Set(val *Tag) { - v.value = val - v.isSet = true -} - -func (v NullableTag) IsSet() bool { - return v.isSet -} - -func (v *NullableTag) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTag(val *Tag) *NullableTag { - return &NullableTag{value: val, isSet: true} -} - -func (v NullableTag) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTag) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go deleted file mode 100644 index eac34a34ab6..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go +++ /dev/null @@ -1,554 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "encoding/json" -) - -// User struct for User -type User struct { - Id *int64 `json:"id,omitempty"` - Username *string `json:"username,omitempty"` - FirstName *string `json:"firstName,omitempty"` - LastName *string `json:"lastName,omitempty"` - Email *string `json:"email,omitempty"` - Password *string `json:"password,omitempty"` - Phone *string `json:"phone,omitempty"` - // User Status - UserStatus *int32 `json:"userStatus,omitempty"` - // test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - ArbitraryObject *map[string]interface{} `json:"arbitraryObject,omitempty"` - // test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - ArbitraryNullableObject map[string]interface{} `json:"arbitraryNullableObject,omitempty"` - // test code generation for any type Value can be any type - string, number, boolean, array or object. - ArbitraryTypeValue interface{} `json:"arbitraryTypeValue,omitempty"` - // test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. - ArbitraryNullableTypeValue interface{} `json:"arbitraryNullableTypeValue,omitempty"` - AdditionalProperties map[string]interface{} -} - -type _User User - -// NewUser instantiates a new User object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUser() *User { - this := User{} - return &this -} - -// NewUserWithDefaults instantiates a new User object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUserWithDefaults() *User { - this := User{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *User) GetId() int64 { - if o == nil || o.Id == nil { - var ret int64 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetIdOk() (*int64, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *User) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int64 and assigns it to the Id field. -func (o *User) SetId(v int64) { - o.Id = &v -} - -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *User) GetUsername() string { - if o == nil || o.Username == nil { - var ret string - return ret - } - return *o.Username -} - -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { - return nil, false - } - return o.Username, true -} - -// HasUsername returns a boolean if a field has been set. -func (o *User) HasUsername() bool { - if o != nil && o.Username != nil { - return true - } - - return false -} - -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *User) SetUsername(v string) { - o.Username = &v -} - -// GetFirstName returns the FirstName field value if set, zero value otherwise. -func (o *User) GetFirstName() string { - if o == nil || o.FirstName == nil { - var ret string - return ret - } - return *o.FirstName -} - -// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetFirstNameOk() (*string, bool) { - if o == nil || o.FirstName == nil { - return nil, false - } - return o.FirstName, true -} - -// HasFirstName returns a boolean if a field has been set. -func (o *User) HasFirstName() bool { - if o != nil && o.FirstName != nil { - return true - } - - return false -} - -// SetFirstName gets a reference to the given string and assigns it to the FirstName field. -func (o *User) SetFirstName(v string) { - o.FirstName = &v -} - -// GetLastName returns the LastName field value if set, zero value otherwise. -func (o *User) GetLastName() string { - if o == nil || o.LastName == nil { - var ret string - return ret - } - return *o.LastName -} - -// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetLastNameOk() (*string, bool) { - if o == nil || o.LastName == nil { - return nil, false - } - return o.LastName, true -} - -// HasLastName returns a boolean if a field has been set. -func (o *User) HasLastName() bool { - if o != nil && o.LastName != nil { - return true - } - - return false -} - -// SetLastName gets a reference to the given string and assigns it to the LastName field. -func (o *User) SetLastName(v string) { - o.LastName = &v -} - -// GetEmail returns the Email field value if set, zero value otherwise. -func (o *User) GetEmail() string { - if o == nil || o.Email == nil { - var ret string - return ret - } - return *o.Email -} - -// GetEmailOk returns a tuple with the Email field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { - return nil, false - } - return o.Email, true -} - -// HasEmail returns a boolean if a field has been set. -func (o *User) HasEmail() bool { - if o != nil && o.Email != nil { - return true - } - - return false -} - -// SetEmail gets a reference to the given string and assigns it to the Email field. -func (o *User) SetEmail(v string) { - o.Email = &v -} - -// GetPassword returns the Password field value if set, zero value otherwise. -func (o *User) GetPassword() string { - if o == nil || o.Password == nil { - var ret string - return ret - } - return *o.Password -} - -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { - return nil, false - } - return o.Password, true -} - -// HasPassword returns a boolean if a field has been set. -func (o *User) HasPassword() bool { - if o != nil && o.Password != nil { - return true - } - - return false -} - -// SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *User) SetPassword(v string) { - o.Password = &v -} - -// GetPhone returns the Phone field value if set, zero value otherwise. -func (o *User) GetPhone() string { - if o == nil || o.Phone == nil { - var ret string - return ret - } - return *o.Phone -} - -// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetPhoneOk() (*string, bool) { - if o == nil || o.Phone == nil { - return nil, false - } - return o.Phone, true -} - -// HasPhone returns a boolean if a field has been set. -func (o *User) HasPhone() bool { - if o != nil && o.Phone != nil { - return true - } - - return false -} - -// SetPhone gets a reference to the given string and assigns it to the Phone field. -func (o *User) SetPhone(v string) { - o.Phone = &v -} - -// GetUserStatus returns the UserStatus field value if set, zero value otherwise. -func (o *User) GetUserStatus() int32 { - if o == nil || o.UserStatus == nil { - var ret int32 - return ret - } - return *o.UserStatus -} - -// GetUserStatusOk returns a tuple with the UserStatus field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetUserStatusOk() (*int32, bool) { - if o == nil || o.UserStatus == nil { - return nil, false - } - return o.UserStatus, true -} - -// HasUserStatus returns a boolean if a field has been set. -func (o *User) HasUserStatus() bool { - if o != nil && o.UserStatus != nil { - return true - } - - return false -} - -// SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. -func (o *User) SetUserStatus(v int32) { - o.UserStatus = &v -} - -// GetArbitraryObject returns the ArbitraryObject field value if set, zero value otherwise. -func (o *User) GetArbitraryObject() map[string]interface{} { - if o == nil || o.ArbitraryObject == nil { - var ret map[string]interface{} - return ret - } - return *o.ArbitraryObject -} - -// GetArbitraryObjectOk returns a tuple with the ArbitraryObject field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *User) GetArbitraryObjectOk() (*map[string]interface{}, bool) { - if o == nil || o.ArbitraryObject == nil { - return nil, false - } - return o.ArbitraryObject, true -} - -// HasArbitraryObject returns a boolean if a field has been set. -func (o *User) HasArbitraryObject() bool { - if o != nil && o.ArbitraryObject != nil { - return true - } - - return false -} - -// SetArbitraryObject gets a reference to the given map[string]interface{} and assigns it to the ArbitraryObject field. -func (o *User) SetArbitraryObject(v map[string]interface{}) { - o.ArbitraryObject = &v -} - -// GetArbitraryNullableObject returns the ArbitraryNullableObject field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetArbitraryNullableObject() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - return o.ArbitraryNullableObject -} - -// GetArbitraryNullableObjectOk returns a tuple with the ArbitraryNullableObject field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetArbitraryNullableObjectOk() (*map[string]interface{}, bool) { - if o == nil || o.ArbitraryNullableObject == nil { - return nil, false - } - return &o.ArbitraryNullableObject, true -} - -// HasArbitraryNullableObject returns a boolean if a field has been set. -func (o *User) HasArbitraryNullableObject() bool { - if o != nil && o.ArbitraryNullableObject != nil { - return true - } - - return false -} - -// SetArbitraryNullableObject gets a reference to the given map[string]interface{} and assigns it to the ArbitraryNullableObject field. -func (o *User) SetArbitraryNullableObject(v map[string]interface{}) { - o.ArbitraryNullableObject = v -} - -// GetArbitraryTypeValue returns the ArbitraryTypeValue field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetArbitraryTypeValue() interface{} { - if o == nil { - var ret interface{} - return ret - } - return o.ArbitraryTypeValue -} - -// GetArbitraryTypeValueOk returns a tuple with the ArbitraryTypeValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetArbitraryTypeValueOk() (*interface{}, bool) { - if o == nil || o.ArbitraryTypeValue == nil { - return nil, false - } - return &o.ArbitraryTypeValue, true -} - -// HasArbitraryTypeValue returns a boolean if a field has been set. -func (o *User) HasArbitraryTypeValue() bool { - if o != nil && o.ArbitraryTypeValue != nil { - return true - } - - return false -} - -// SetArbitraryTypeValue gets a reference to the given interface{} and assigns it to the ArbitraryTypeValue field. -func (o *User) SetArbitraryTypeValue(v interface{}) { - o.ArbitraryTypeValue = v -} - -// GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetArbitraryNullableTypeValue() interface{} { - if o == nil { - var ret interface{} - return ret - } - return o.ArbitraryNullableTypeValue -} - -// GetArbitraryNullableTypeValueOk returns a tuple with the ArbitraryNullableTypeValue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetArbitraryNullableTypeValueOk() (*interface{}, bool) { - if o == nil || o.ArbitraryNullableTypeValue == nil { - return nil, false - } - return &o.ArbitraryNullableTypeValue, true -} - -// HasArbitraryNullableTypeValue returns a boolean if a field has been set. -func (o *User) HasArbitraryNullableTypeValue() bool { - if o != nil && o.ArbitraryNullableTypeValue != nil { - return true - } - - return false -} - -// SetArbitraryNullableTypeValue gets a reference to the given interface{} and assigns it to the ArbitraryNullableTypeValue field. -func (o *User) SetArbitraryNullableTypeValue(v interface{}) { - o.ArbitraryNullableTypeValue = v -} - -func (o User) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id - } - if o.Username != nil { - toSerialize["username"] = o.Username - } - if o.FirstName != nil { - toSerialize["firstName"] = o.FirstName - } - if o.LastName != nil { - toSerialize["lastName"] = o.LastName - } - if o.Email != nil { - toSerialize["email"] = o.Email - } - if o.Password != nil { - toSerialize["password"] = o.Password - } - if o.Phone != nil { - toSerialize["phone"] = o.Phone - } - if o.UserStatus != nil { - toSerialize["userStatus"] = o.UserStatus - } - if o.ArbitraryObject != nil { - toSerialize["arbitraryObject"] = o.ArbitraryObject - } - if o.ArbitraryNullableObject != nil { - toSerialize["arbitraryNullableObject"] = o.ArbitraryNullableObject - } - if o.ArbitraryTypeValue != nil { - toSerialize["arbitraryTypeValue"] = o.ArbitraryTypeValue - } - if o.ArbitraryNullableTypeValue != nil { - toSerialize["arbitraryNullableTypeValue"] = o.ArbitraryNullableTypeValue - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return json.Marshal(toSerialize) -} - -func (o *User) UnmarshalJSON(bytes []byte) (err error) { - varUser := _User{} - - if err = json.Unmarshal(bytes, &varUser); err == nil { - *o = User(varUser) - } - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - delete(additionalProperties, "id") - delete(additionalProperties, "username") - delete(additionalProperties, "firstName") - delete(additionalProperties, "lastName") - delete(additionalProperties, "email") - delete(additionalProperties, "password") - delete(additionalProperties, "phone") - delete(additionalProperties, "userStatus") - delete(additionalProperties, "arbitraryObject") - delete(additionalProperties, "arbitraryNullableObject") - delete(additionalProperties, "arbitraryTypeValue") - delete(additionalProperties, "arbitraryNullableTypeValue") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableUser struct { - value *User - isSet bool -} - -func (v NullableUser) Get() *User { - return v.value -} - -func (v *NullableUser) Set(val *User) { - v.value = val - v.isSet = true -} - -func (v NullableUser) IsSet() bool { - return v.isSet -} - -func (v *NullableUser) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUser(val *User) *NullableUser { - return &NullableUser{value: val, isSet: true} -} - -func (v NullableUser) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUser) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go deleted file mode 100644 index c16f181f4e9..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResonse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/samples/openapi3/client/petstore/go-experimental/pet_api_test.go b/samples/openapi3/client/petstore/go-experimental/pet_api_test.go deleted file mode 100644 index 9f0a154f96a..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/pet_api_test.go +++ /dev/null @@ -1,292 +0,0 @@ -package main - -import ( - "context" - "fmt" - "os" - "testing" - - "github.com/stretchr/testify/assert" - - sw "./go-petstore" -) - -var client *sw.APIClient - -const testHost = "petstore.swagger.io:80" -const testScheme = "http" - -func TestMain(m *testing.M) { - cfg := sw.NewConfiguration() - cfg.AddDefaultHeader("testheader", "testvalue") - cfg.Host = testHost - cfg.Scheme = testScheme - client = sw.NewAPIClient(cfg) - retCode := m.Run() - os.Exit(retCode) -} - -func TestAddPet(t *testing.T) { - newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), - Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - - r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() - - if err != nil { - t.Fatalf("Error while adding pet: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestFindPetsByStatusWithMissingParam(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() - - if err != nil { - t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestGetPetById(t *testing.T) { - isPetCorrect(t, 12830, "gopher", "pending") -} - -func TestGetPetByIdWithInvalidID(t *testing.T) { - resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() - if r != nil && r.StatusCode == 404 { - assertedError, ok := err.(sw.GenericOpenAPIError) - a := assert.New(t) - a.True(ok) - a.Contains(string(assertedError.Body()), "type") - - a.Contains(assertedError.Error(), "Not Found") - } else if err != nil { - t.Fatalf("Error while getting pet by invalid id: %v", err) - t.Log(r) - } else { - t.Log(resp) - } -} - -func TestUpdatePetWithForm(t *testing.T) { - r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() - if err != nil { - t.Fatalf("Error while updating pet by id: %v", err) - t.Log(r) - } - if r.StatusCode != 200 { - t.Log(r) - } - - // get the pet with id 12830 from server to verify the update - isPetCorrect(t, 12830, "golang", "available") -} - -func TestFindPetsByTag(t *testing.T) { - var found = false - resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() - if err != nil { - t.Fatalf("Error while getting pet by tag: %v", err) - t.Log(r) - } else { - if len(resp) == 0 { - t.Errorf("Error no pets returned") - } else { - - assert := assert.New(t) - for i := 0; i < len(resp); i++ { - if *resp[i].Id == 12830 { - assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`") - found = true - } - } - } - - if found == false { - t.Errorf("Error while getting pet by tag could not find 12830") - } - - if r.StatusCode != 200 { - t.Log(r) - } - } -} - -func TestFindPetsByStatus(t *testing.T) { - resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() - if err != nil { - t.Fatalf("Error while getting pet by id: %v", err) - t.Log(r) - } else { - if len(resp) == 0 { - t.Errorf("Error no pets returned") - } else { - assert := assert.New(t) - for i := 0; i < len(resp); i++ { - assert.Equal(*resp[i].Status, "available", "Pet status should be `available`") - } - } - - if r.StatusCode != 200 { - t.Log(r) - } - } -} - -func TestUploadFile(t *testing.T) { - file, err1 := os.Open("testfiles/foo.png") - if err1 != nil { - t.Fatalf("Error opening file: %v", err1) - } - - _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() - - if err != nil { - t.Fatalf("Error while uploading file: %v", err) - } - - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestUploadFileRequired(t *testing.T) { - return // remove when server supports this endpoint - file, err1 := os.Open("testfiles/foo.png") - if err1 != nil { - t.Fatalf("Error opening file: %v", err1) - } - - _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() - - if err != nil { - t.Fatalf("Error while uploading file: %v", err) - } - - if r.StatusCode != 200 { - t.Log(r) - } -} - -func TestDeletePet(t *testing.T) { - r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -/* -// Test we can concurrently create, retrieve, update, and delete. -func TestConcurrency(t *testing.T) { - errc := make(chan error) - - newPets := []sw.Pet{ - sw.Pet{Id: 912345, Name: "gopherFred", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, - sw.Pet{Id: 912346, Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, - sw.Pet{Id: 912347, Name: "gopherRick", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "mia"}, - sw.Pet{Id: 912348, Name: "gopherJohn", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, - sw.Pet{Id: 912349, Name: "gopherAlf", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, - sw.Pet{Id: 912350, Name: "gopherRob", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, - sw.Pet{Id: 912351, Name: "gopherIan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, - } - - // Add the pets. - for _, pet := range newPets { - go func(newPet sw.Pet) { - r, err := client.PetApi.AddPet(nil, newPet) - if r.StatusCode != 200 { - t.Log(r) - } - errc <- err - }(pet) - } - waitOnFunctions(t, errc, len(newPets)) - - // Verify they are correct. - for _, pet := range newPets { - go func(pet sw.Pet) { - isPetCorrect(t, pet.Id, pet.Name, pet.Status) - errc <- nil - }(pet) - } - - waitOnFunctions(t, errc, len(newPets)) - - // Update all to active with the name gopherDan - for _, pet := range newPets { - go func(id int64) { - r, err := client.PetApi.UpdatePet(nil, sw.Pet{Id: (int64)(id), Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}) - if r.StatusCode != 200 { - t.Log(r) - } - errc <- err - }(pet.Id) - } - waitOnFunctions(t, errc, len(newPets)) - - // Verify they are correct. - for _, pet := range newPets { - go func(pet sw.Pet) { - isPetCorrect(t, pet.Id, "gopherDan", "active") - errc <- nil - }(pet) - } - - waitOnFunctions(t, errc, len(newPets)) - - // Delete them all. - for _, pet := range newPets { - go func(id int64) { - deletePet(t, (int64)(id)) - errc <- nil - }(pet.Id) - } - waitOnFunctions(t, errc, len(newPets)) -} -*/ - -func waitOnFunctions(t *testing.T, errc chan error, n int) { - for i := 0; i < n; i++ { - err := <-errc - if err != nil { - t.Fatalf("Error performing concurrent test: %v", err) - } - } -} - -func deletePet(t *testing.T, id int64) { - r, err := client.PetApi.DeletePet(context.Background(), id).Execute() - - if err != nil { - t.Fatalf("Error while deleting pet by id: %v", err) - } - if r.StatusCode != 200 { - t.Log(r) - } -} - -func isPetCorrect(t *testing.T, id int64, name string, status string) { - assert := assert.New(t) - resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() - if err != nil { - t.Fatalf("Error while getting pet by id: %v", err) - } else { - assert.Equal(*resp.Id, int64(id), "Pet id should be equal") - assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) - assert.Equal(*resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) - - //t.Log(resp) - } - if r.StatusCode != 200 { - t.Log(r) - } -} diff --git a/samples/openapi3/client/petstore/go-experimental/pom.xml b/samples/openapi3/client/petstore/go-experimental/pom.xml deleted file mode 100644 index 2f84e8bbfe7..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - 4.0.0 - org.openapitools - GoExperimentalOAS3Petstore - pom - 1.0.0 - Go Experimental OpenAPI3 Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - go-get-testify - pre-integration-test - - exec - - - go - - get - github.com/stretchr/testify/assert - - - - - go-get-oauth2 - pre-integration-test - - exec - - - go - - get - golang.org/x/oauth2 - - - - - go-get-context - pre-integration-test - - exec - - - go - - get - golang.org/x/net/context - - - - - go-test - integration-test - - exec - - - go - - test - -v - - - - - - - - diff --git a/samples/openapi3/client/petstore/go-experimental/store_api_test.go b/samples/openapi3/client/petstore/go-experimental/store_api_test.go deleted file mode 100644 index fc0cdec9699..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/store_api_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "context" - "regexp" - "testing" - "time" - - sw "./go-petstore" -) - -func TestPlaceOrder(t *testing.T) { - newOrder := sw.Order{ - Id: sw.PtrInt64(0), - PetId: sw.PtrInt64(0), - Quantity: sw.PtrInt32(0), - ShipDate: sw.PtrTime(time.Now().UTC()), - Status: sw.PtrString("placed"), - Complete: sw.PtrBool(false)} - - _, r, err := client.StoreApi.PlaceOrder(context.Background()).Order(newOrder).Execute() - - if err != nil { - // Skip parsing time error due to error in Petstore Test Server - // https://github.com/OpenAPITools/openapi-generator/issues/1292 - if regexp. - MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`). - MatchString(err.Error()) { - t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime") - } else { - t.Fatalf("Error while placing order: %v", err) - } - } - if r.StatusCode != 200 { - t.Log(r) - } -} diff --git a/samples/openapi3/client/petstore/go-experimental/testfiles/foo.png b/samples/openapi3/client/petstore/go-experimental/testfiles/foo.png deleted file mode 100644 index a9b12cf5927..00000000000 Binary files a/samples/openapi3/client/petstore/go-experimental/testfiles/foo.png and /dev/null differ diff --git a/samples/openapi3/client/petstore/go-experimental/user_api_test.go b/samples/openapi3/client/petstore/go-experimental/user_api_test.go deleted file mode 100644 index ef66e2410c0..00000000000 --- a/samples/openapi3/client/petstore/go-experimental/user_api_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package main - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - - sw "./go-petstore" -) - -func TestCreateUser(t *testing.T) { - newUser := sw.User{ - Id: sw.PtrInt64(1000), - FirstName: sw.PtrString("gopher"), - LastName: sw.PtrString("lang"), - Username: sw.PtrString("gopher"), - Password: sw.PtrString("lang"), - Email: sw.PtrString("lang@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1)} - - apiResponse, err := client.UserApi.CreateUser(context.Background()).User(newUser).Execute() - - if err != nil { - t.Fatalf("Error while adding user: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} - -//adding x to skip the test, currently it is failing -func TestCreateUsersWithArrayInput(t *testing.T) { - newUsers := []sw.User{ - sw.User{ - Id: sw.PtrInt64(1001), - FirstName: sw.PtrString("gopher1"), - LastName: sw.PtrString("lang1"), - Username: sw.PtrString("gopher1"), - Password: sw.PtrString("lang1"), - Email: sw.PtrString("lang1@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1), - }, - sw.User{ - Id: sw.PtrInt64(1002), - FirstName: sw.PtrString("gopher2"), - LastName: sw.PtrString("lang2"), - Username: sw.PtrString("gopher2"), - Password: sw.PtrString("lang2"), - Email: sw.PtrString("lang2@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1), - }, - } - - apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).User(newUsers).Execute() - if err != nil { - t.Fatalf("Error while adding users: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } - -/* issue deleting users due to issue in the server side (500). commented out below for the time being - //tear down - _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() - if err1 != nil { - t.Errorf("Error while deleting user") - t.Log(err1) - } - - _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2").Execute() - if err2 != nil { - t.Errorf("Error while deleting user") - t.Log(err2) - } -*/ -} - -func TestGetUserByName(t *testing.T) { - assert := assert.New(t) - - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { - t.Fatalf("Error while getting user by id: %v", err) - } else { - assert.Equal(*resp.Id, int64(1000), "User id should be equal") - assert.Equal(*resp.Username, "gopher", "User name should be gopher") - assert.Equal(*resp.LastName, "lang", "Last name should be lang") - //t.Log(resp) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} - -func TestGetUserByNameWithInvalidID(t *testing.T) { - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() - if apiResponse != nil && apiResponse.StatusCode == 404 { - return // This is a pass condition. API will return with a 404 error. - } else if err != nil { - t.Fatalf("Error while getting user by invalid id: %v", err) - t.Log(apiResponse) - } else { - t.Log(resp) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} - -func TestUpdateUser(t *testing.T) { - assert := assert.New(t) - - newUser := sw.User{ - Id: sw.PtrInt64(1000), - FirstName: sw.PtrString("gopher20"), - LastName: sw.PtrString("lang20"), - Username: sw.PtrString("gopher"), - Password: sw.PtrString("lang"), - Email: sw.PtrString("lang@test.com"), - Phone: sw.PtrString("5101112222"), - UserStatus: sw.PtrInt32(1)} - - apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").User(newUser).Execute() - if err != nil { - t.Fatalf("Error while deleting user by id: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } - - //verify changings are correct - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() - if err != nil { - t.Fatalf("Error while getting user by id: %v", err) - } else { - assert.Equal(*resp.Id, int64(1000), "User id should be equal") - assert.Equal(*resp.FirstName, "gopher20", "User name should be gopher") - assert.Equal(*resp.Password, "lang", "User name should be the same") - } -} - -/* issue deleting users due to issue in the server side (500). commented out below for the time being -func TestDeleteUser(t *testing.T) { - apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() - - if err != nil { - t.Fatalf("Error while deleting user: %v", err) - } - if apiResponse.StatusCode != 200 { - t.Log(apiResponse) - } -} -*/ diff --git a/samples/openapi3/client/petstore/go/auth_test.go b/samples/openapi3/client/petstore/go/auth_test.go index 5f817703a88..aec544c2f26 100644 --- a/samples/openapi3/client/petstore/go/auth_test.go +++ b/samples/openapi3/client/petstore/go/auth_test.go @@ -37,10 +37,11 @@ func TestOAuth2(t *testing.T) { tokenSource := cfg.TokenSource(createContext(nil), &tok) auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -49,7 +50,7 @@ func TestOAuth2(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -71,10 +72,11 @@ func TestBasicAuth(t *testing.T) { Password: "f4k3p455", }) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(auth, newPet) + r, err := client.PetApi.AddPet(auth).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -83,7 +85,7 @@ func TestBasicAuth(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -100,10 +102,11 @@ func TestBasicAuth(t *testing.T) { func TestAccessToken(t *testing.T) { auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(nil, newPet) + r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -112,7 +115,7 @@ func TestAccessToken(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -127,12 +130,13 @@ func TestAccessToken(t *testing.T) { } func TestAPIKeyNoPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123"}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -141,7 +145,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { t.Log(r) } - _, r, err = client.PetApi.GetPetById(auth, 12992) + _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -151,7 +155,7 @@ func TestAPIKeyNoPrefix(t *testing.T) { t.Errorf("APIKey Authentication is missing") } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -161,12 +165,13 @@ func TestAPIKeyNoPrefix(t *testing.T) { } func TestAPIKeyWithPrefix(t *testing.T) { - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123", Prefix: "Bearer"}) + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(nil, newPet) + r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -175,7 +180,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { t.Log(r) } - _, r, err = client.PetApi.GetPetById(auth, 12992) + _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -185,7 +190,7 @@ func TestAPIKeyWithPrefix(t *testing.T) { t.Errorf("APIKey Authentication is missing") } - r, err = client.PetApi.DeletePet(auth, 12992, nil) + r, err = client.PetApi.DeletePet(auth, 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) } @@ -195,11 +200,11 @@ func TestAPIKeyWithPrefix(t *testing.T) { } func TestDefaultHeader(t *testing.T) { + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - newPet := (sw.Pet{Id: 12992, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) - - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -208,7 +213,7 @@ func TestDefaultHeader(t *testing.T) { t.Log(r) } - r, err = client.PetApi.DeletePet(context.Background(), 12992, nil) + r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -223,7 +228,7 @@ func TestDefaultHeader(t *testing.T) { } func TestHostOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() if err != nil { t.Fatalf("Error while finding pets by status: %v", err) @@ -235,7 +240,7 @@ func TestHostOverride(t *testing.T) { } func TestSchemeOverride(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() if err != nil { t.Fatalf("Error while finding pets by status: %v", err) diff --git a/samples/openapi3/client/petstore/go/fake_api_test.go b/samples/openapi3/client/petstore/go/fake_api_test.go index f4242b5048c..97910bf3cf7 100644 --- a/samples/openapi3/client/petstore/go/fake_api_test.go +++ b/samples/openapi3/client/petstore/go/fake_api_test.go @@ -1,10 +1,10 @@ package main import ( + "context" "testing" sw "./go-petstore" - "golang.org/x/net/context" ) // TestPutBodyWithFileSchema ensures a model with the name 'File' @@ -14,10 +14,10 @@ func TestPutBodyWithFileSchema(t *testing.T) { return // early return to test compilation schema := sw.FileSchemaTestClass{ - File: sw.File{SourceURI: "https://example.com/image.png"}, - Files: []sw.File{{SourceURI: "https://example.com/image.png"}}} + File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, + Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} - r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema) + r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(schema).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES index cc725b6d4dc..ea0ef18d926 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -15,9 +15,13 @@ docs/AdditionalPropertiesClass.md docs/Animal.md docs/AnotherFakeApi.md docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md docs/ArrayOfArrayOfNumberOnly.md docs/ArrayOfNumberOnly.md docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md docs/Capitalization.md docs/Cat.md docs/CatAllOf.md @@ -36,6 +40,9 @@ docs/File.md docs/FileSchemaTestClass.md docs/Foo.md docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md docs/HasOnlyReadOnly.md docs/HealthCheckResult.md docs/InlineObject.md @@ -46,6 +53,7 @@ docs/InlineObject4.md docs/InlineObject5.md docs/InlineResponseDefault.md docs/List.md +docs/Mammal.md docs/MapTest.md docs/MixedPropertiesAndAdditionalPropertiesClass.md docs/Model200Response.md @@ -67,56 +75,11 @@ docs/StoreApi.md docs/Tag.md docs/User.md docs/UserApi.md +docs/Whale.md +docs/Zebra.md git_push.sh go.mod go.sum -model_200_response.go -model__special_model_name_.go -model_additional_properties_class.go -model_animal.go -model_api_response.go -model_array_of_array_of_number_only.go -model_array_of_number_only.go -model_array_test_.go -model_capitalization.go -model_cat.go -model_cat_all_of.go -model_category.go -model_class_model.go -model_client.go -model_dog.go -model_dog_all_of.go -model_enum_arrays.go -model_enum_class.go -model_enum_test_.go -model_file.go -model_file_schema_test_class.go -model_foo.go -model_format_test_.go -model_has_only_read_only.go -model_health_check_result.go -model_inline_object.go -model_inline_object_1.go -model_inline_object_2.go -model_inline_object_3.go -model_inline_object_4.go -model_inline_object_5.go -model_inline_response_default.go -model_list.go -model_map_test_.go -model_mixed_properties_and_additional_properties_class.go -model_name.go -model_nullable_class.go -model_number_only.go -model_order.go -model_outer_composite.go -model_outer_enum.go -model_outer_enum_default_value.go -model_outer_enum_integer.go -model_outer_enum_integer_default_value.go -model_pet.go -model_read_only_first.go -model_return.go -model_tag.go -model_user.go response.go +signing.go +utils.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 78adce57a44..fda9fc282f6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -17,13 +17,53 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import "./petstore" +import sw "./petstore" +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +``` +ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) ``` ## Documentation for API Endpoints @@ -35,7 +75,6 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags *DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **Get** /foo | *FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **Get** /fake/health | Health check endpoint -*FakeApi* | [**FakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **Get** /fake/http-signature-test | test http signature authentication *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | @@ -78,9 +117,13 @@ Class | Method | HTTP request | Description - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Animal](docs/Animal.md) - [ApiResponse](docs/ApiResponse.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) - [CatAllOf](docs/CatAllOf.md) @@ -96,6 +139,9 @@ Class | Method | HTTP request | Description - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [HealthCheckResult](docs/HealthCheckResult.md) - [InlineObject](docs/InlineObject.md) @@ -106,6 +152,7 @@ Class | Method | HTTP request | Description - [InlineObject5](docs/InlineObject5.md) - [InlineResponseDefault](docs/InlineResponseDefault.md) - [List](docs/List.md) + - [Mammal](docs/Mammal.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) @@ -124,62 +171,52 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) ## Documentation For Authorization -## api_key +### api_key - **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAPIKey, petstore.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` +Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request. -## api_key_query +### api_key_query - **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string -Example - -```golang -auth := context.WithValue(context.Background(), petstore.ContextAPIKey, petstore.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. -}) -r, err := client.Service.Operation(auth, args) -``` +Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request. -## bearer_test +### bearer_test - **Type**: HTTP Bearer token authentication Example ```golang -auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "BEARERTOKENSTRING") +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` -## http_basic_test +### http_basic_test - **Type**: HTTP basic authentication Example ```golang -auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{ +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ UserName: "username", Password: "password", }) @@ -187,12 +224,39 @@ r, err := client.Service.Operation(auth, args) ``` -## http_signature_test +### http_signature_test -Not supported. +- **Type**: HTTP signature authentication +Example -## petstore_auth +```golang + authConfig := sw.HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "rsa.pem", + Passphrase: "my-passphrase", + SigningScheme: sw.HttpSigningSchemeHs2019, + SignedHeaders: []string{ + sw.HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + sw.HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + SigningAlgorithm: sw.HttpSigningAlgorithmRsaPSS, + SignatureMaxValidity: 5 * time.Minute, + } + var authCtx context.Context + var err error + if authCtx, err = authConfig.ContextWithValue(context.Background()); err != nil { + // Process error + } + r, err = client.Service.Operation(auth, args) + +``` + +### petstore_auth - **Type**: OAuth @@ -205,7 +269,7 @@ Not supported. Example ```golang -auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING") +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` @@ -217,11 +281,26 @@ import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) -auth := context.WithValue(oauth2.NoContext, petstore.ContextOAuth2, tokenSource) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) r, err := client.Service.Operation(auth, args) ``` +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` ## Author diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 51e7c243284..4bb7abdc392 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -57,6 +57,7 @@ paths: "405": description: Invalid input security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -75,6 +76,7 @@ paths: "405": description: Validation exception security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -121,6 +123,7 @@ paths: "400": description: Invalid status value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -161,6 +164,7 @@ paths: "400": description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -1169,36 +1173,6 @@ paths: summary: Health check endpoint tags: - fake - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake components: requestBodies: UserArray: @@ -1325,9 +1299,13 @@ components: lastName: lastName password: password userStatus: 6 + arbitraryTypeValue: "" + arbitraryNullableTypeValue: "" phone: phone id: 0 + arbitraryObject: '{}' email: email + arbitraryNullableObject: '{}' username: username properties: id: @@ -1350,6 +1328,22 @@ components: description: User Status format: int32 type: integer + arbitraryObject: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + arbitraryNullableObject: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + arbitraryTypeValue: + description: test code generation for any type Value can be any type - string, + number, boolean, array or object. + arbitraryNullableTypeValue: + description: test code generation for any type Value can be any type - string, + number, boolean, array, object or the 'null' value. + nullable: true type: object xml: name: User @@ -1482,7 +1476,12 @@ components: Cat: allOf: - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' - $ref: '#/components/schemas/Cat_allOf' + Address: + additionalProperties: + type: integer + type: object Animal: discriminator: propertyName: className @@ -1913,6 +1912,86 @@ components: type: object type: object type: object + fruit: + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + apple: + properties: + cultivar: + type: string + type: object + banana: + additionalProperties: true + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + mapping: + whale: '#/components/schemas/whale' + zebra: '#/components/schemas/zebra' + propertyName: className + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + gmFruit: + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + properties: + color: + type: string + fruitReq: + oneOf: + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + appleReq: + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object inline_response_default: example: string: diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go index d0126855865..519084b8ce6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_another_fake.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" ) // Linger please @@ -22,19 +21,59 @@ var ( _ _context.Context ) +type AnotherFakeApi interface { + + /* + * Call123TestSpecialTags To test special tags + * To test special tags and operation ID starting with number + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCall123TestSpecialTagsRequest + */ + Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest + + /* + * Call123TestSpecialTagsExecute executes the request + * @return Client + */ + Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) +} + // AnotherFakeApiService AnotherFakeApi service type AnotherFakeApiService service +type ApiCall123TestSpecialTagsRequest struct { + ctx _context.Context + ApiService AnotherFakeApi + client *Client +} + +func (r ApiCall123TestSpecialTagsRequest) Client(client Client) ApiCall123TestSpecialTagsRequest { + r.client = &client + return r +} + +func (r ApiCall123TestSpecialTagsRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.Call123TestSpecialTagsExecute(r) +} + /* * Call123TestSpecialTags To test special tags - * * To test special tags and operation ID starting with number - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param client client model + * @return ApiCall123TestSpecialTagsRequest + */ +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context) ApiCall123TestSpecialTagsRequest { + return ApiCall123TestSpecialTagsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Client */ -func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { +func (a *AnotherFakeApiService) Call123TestSpecialTagsExecute(r ApiCall123TestSpecialTagsRequest) (Client, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -44,11 +83,19 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, cli localVarReturnValue Client ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnotherFakeApiService.Call123TestSpecialTags") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/another-fake/dummy" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.client == nil { + return localVarReturnValue, nil, reportError("client is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -68,20 +115,19 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, cli localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.client + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_default.go b/samples/openapi3/client/petstore/go/go-petstore/api_default.go index 183a2d799f1..10bcff6ac1c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_default.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" ) // Linger please @@ -22,16 +21,52 @@ var ( _ _context.Context ) +type DefaultApi interface { + + /* + * FooGet Method for FooGet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFooGetRequest + */ + FooGet(ctx _context.Context) ApiFooGetRequest + + /* + * FooGetExecute executes the request + * @return InlineResponseDefault + */ + FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) +} + // DefaultApiService DefaultApi service type DefaultApiService service +type ApiFooGetRequest struct { + ctx _context.Context + ApiService DefaultApi +} + + +func (r ApiFooGetRequest) Execute() (InlineResponseDefault, *_nethttp.Response, error) { + return r.ApiService.FooGetExecute(r) +} + /* * FooGet Method for FooGet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFooGetRequest + */ +func (a *DefaultApiService) FooGet(ctx _context.Context) ApiFooGetRequest { + return ApiFooGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return InlineResponseDefault */ -func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault, *_nethttp.Response, error) { +func (a *DefaultApiService) FooGetExecute(r ApiFooGetRequest) (InlineResponseDefault, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -41,8 +76,13 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault, localVarReturnValue InlineResponseDefault ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/foo" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.FooGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/foo" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -64,19 +104,18 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index 6e36a8816a3..a54ed2f73ce 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -14,9 +14,8 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" - "github.com/antihax/optional" "os" + "time" "reflect" ) @@ -25,16 +24,227 @@ var ( _ _context.Context ) +type FakeApi interface { + + /* + * FakeHealthGet Health check endpoint + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeHealthGetRequest + */ + FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest + + /* + * FakeHealthGetExecute executes the request + * @return HealthCheckResult + */ + FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) + + /* + * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize + * Test serialization of outer boolean types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterBooleanSerializeRequest + */ + FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest + + /* + * FakeOuterBooleanSerializeExecute executes the request + * @return bool + */ + FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) + + /* + * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize + * Test serialization of object with outer number type + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterCompositeSerializeRequest + */ + FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest + + /* + * FakeOuterCompositeSerializeExecute executes the request + * @return OuterComposite + */ + FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) + + /* + * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize + * Test serialization of outer number types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterNumberSerializeRequest + */ + FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest + + /* + * FakeOuterNumberSerializeExecute executes the request + * @return float32 + */ + FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) + + /* + * FakeOuterStringSerialize Method for FakeOuterStringSerialize + * Test serialization of outer string types + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeOuterStringSerializeRequest + */ + FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest + + /* + * FakeOuterStringSerializeExecute executes the request + * @return string + */ + FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) + + /* + * TestBodyWithFileSchema Method for TestBodyWithFileSchema + * For this test, the body for this request much reference a schema named `File`. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestBodyWithFileSchemaRequest + */ + TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest + + /* + * TestBodyWithFileSchemaExecute executes the request + */ + TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) + + /* + * TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestBodyWithQueryParamsRequest + */ + TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest + + /* + * TestBodyWithQueryParamsExecute executes the request + */ + TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) + + /* + * TestClientModel To test \"client\" model + * To test "client" model + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestClientModelRequest + */ + TestClientModel(ctx _context.Context) ApiTestClientModelRequest + + /* + * TestClientModelExecute executes the request + * @return Client + */ + TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) + + /* + * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트 + + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestEndpointParametersRequest + */ + TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest + + /* + * TestEndpointParametersExecute executes the request + */ + TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) + + /* + * TestEnumParameters To test enum parameters + * To test enum parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestEnumParametersRequest + */ + TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest + + /* + * TestEnumParametersExecute executes the request + */ + TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) + + /* + * TestGroupParameters Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestGroupParametersRequest + */ + TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest + + /* + * TestGroupParametersExecute executes the request + */ + TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) + + /* + * TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestInlineAdditionalPropertiesRequest + */ + TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest + + /* + * TestInlineAdditionalPropertiesExecute executes the request + */ + TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) + + /* + * TestJsonFormData test json serialization of form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestJsonFormDataRequest + */ + TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest + + /* + * TestJsonFormDataExecute executes the request + */ + TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) + + /* + * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat + * To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestQueryParameterCollectionFormatRequest + */ + TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest + + /* + * TestQueryParameterCollectionFormatExecute executes the request + */ + TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) +} + // FakeApiService FakeApi service type FakeApiService service +type ApiFakeHealthGetRequest struct { + ctx _context.Context + ApiService FakeApi +} + + +func (r ApiFakeHealthGetRequest) Execute() (HealthCheckResult, *_nethttp.Response, error) { + return r.ApiService.FakeHealthGetExecute(r) +} + /* * FakeHealthGet Health check endpoint - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFakeHealthGetRequest + */ +func (a *FakeApiService) FakeHealthGet(ctx _context.Context) ApiFakeHealthGetRequest { + return ApiFakeHealthGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return HealthCheckResult */ -func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, *_nethttp.Response, error) { +func (a *FakeApiService) FakeHealthGetExecute(r ApiFakeHealthGetRequest) (HealthCheckResult, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -44,8 +254,13 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, localVarReturnValue HealthCheckResult ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/health" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeHealthGet") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/health" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -67,19 +282,18 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -104,105 +318,39 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, return localVarReturnValue, localVarHTTPResponse, nil } -// FakeHttpSignatureTestOpts Optional parameters for the method 'FakeHttpSignatureTest' -type FakeHttpSignatureTestOpts struct { - Query1 optional.String - Header1 optional.String +type ApiFakeOuterBooleanSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *bool } -/* - * FakeHttpSignatureTest test http signature authentication - * - * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pet Pet object that needs to be added to the store - * @param optional nil or *FakeHttpSignatureTestOpts - Optional Parameters: - * @param "Query1" (optional.String) - query parameter - * @param "Header1" (optional.String) - header parameter - */ -func (a *FakeApiService) FakeHttpSignatureTest(ctx _context.Context, pet Pet, localVarOptionals *FakeHttpSignatureTestOpts) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/http-signature-test" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - if localVarOptionals != nil && localVarOptionals.Query1.IsSet() { - localVarQueryParams.Add("query_1", parameterToString(localVarOptionals.Query1.Value(), "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json", "application/xml"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - if localVarOptionals != nil && localVarOptionals.Header1.IsSet() { - localVarHeaderParams["header_1"] = parameterToString(localVarOptionals.Header1.Value(), "") - } - // body params - localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil +func (r ApiFakeOuterBooleanSerializeRequest) Body(body bool) ApiFakeOuterBooleanSerializeRequest { + r.body = &body + return r } -// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' -type FakeOuterBooleanSerializeOpts struct { - Body optional.Bool +func (r ApiFakeOuterBooleanSerializeRequest) Execute() (bool, *_nethttp.Response, error) { + return r.ApiService.FakeOuterBooleanSerializeExecute(r) } /* * FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize - * * Test serialization of outer boolean types - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: - * @param "Body" (optional.Bool) - Input boolean as post body + * @return ApiFakeOuterBooleanSerializeRequest + */ +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context) ApiFakeOuterBooleanSerializeRequest { + return ApiFakeOuterBooleanSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return bool */ -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerializeExecute(r ApiFakeOuterBooleanSerializeRequest) (bool, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -212,8 +360,13 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa localVarReturnValue bool ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterBooleanSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/boolean" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -236,23 +389,19 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -277,22 +426,39 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa return localVarReturnValue, localVarHTTPResponse, nil } -// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' -type FakeOuterCompositeSerializeOpts struct { - OuterComposite optional.Interface +type ApiFakeOuterCompositeSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + outerComposite *OuterComposite +} + +func (r ApiFakeOuterCompositeSerializeRequest) OuterComposite(outerComposite OuterComposite) ApiFakeOuterCompositeSerializeRequest { + r.outerComposite = &outerComposite + return r +} + +func (r ApiFakeOuterCompositeSerializeRequest) Execute() (OuterComposite, *_nethttp.Response, error) { + return r.ApiService.FakeOuterCompositeSerializeExecute(r) } /* * FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize - * * Test serialization of object with outer number type - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: - * @param "OuterComposite" (optional.Interface of OuterComposite) - Input composite as post body + * @return ApiFakeOuterCompositeSerializeRequest + */ +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context) ApiFakeOuterCompositeSerializeRequest { + return ApiFakeOuterCompositeSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return OuterComposite */ -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerializeExecute(r ApiFakeOuterCompositeSerializeRequest) (OuterComposite, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -302,8 +468,13 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local localVarReturnValue OuterComposite ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterCompositeSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/composite" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -326,27 +497,19 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.OuterComposite.IsSet() { - localVarOptionalOuterComposite, localVarOptionalOuterCompositeok := localVarOptionals.OuterComposite.Value().(OuterComposite) - if !localVarOptionalOuterCompositeok { - return localVarReturnValue, nil, reportError("outerComposite should be OuterComposite") - } - localVarPostBody = &localVarOptionalOuterComposite - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.outerComposite + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -371,22 +534,39 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local return localVarReturnValue, localVarHTTPResponse, nil } -// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' -type FakeOuterNumberSerializeOpts struct { - Body optional.Float32 +type ApiFakeOuterNumberSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *float32 +} + +func (r ApiFakeOuterNumberSerializeRequest) Body(body float32) ApiFakeOuterNumberSerializeRequest { + r.body = &body + return r +} + +func (r ApiFakeOuterNumberSerializeRequest) Execute() (float32, *_nethttp.Response, error) { + return r.ApiService.FakeOuterNumberSerializeExecute(r) } /* * FakeOuterNumberSerialize Method for FakeOuterNumberSerialize - * * Test serialization of outer number types - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: - * @param "Body" (optional.Float32) - Input number as post body + * @return ApiFakeOuterNumberSerializeRequest + */ +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context) ApiFakeOuterNumberSerializeRequest { + return ApiFakeOuterNumberSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return float32 */ -func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerializeExecute(r ApiFakeOuterNumberSerializeRequest) (float32, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -396,8 +576,13 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar localVarReturnValue float32 ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/number" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterNumberSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/number" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -420,23 +605,19 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -461,22 +642,39 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar return localVarReturnValue, localVarHTTPResponse, nil } -// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' -type FakeOuterStringSerializeOpts struct { - Body optional.String +type ApiFakeOuterStringSerializeRequest struct { + ctx _context.Context + ApiService FakeApi + body *string +} + +func (r ApiFakeOuterStringSerializeRequest) Body(body string) ApiFakeOuterStringSerializeRequest { + r.body = &body + return r +} + +func (r ApiFakeOuterStringSerializeRequest) Execute() (string, *_nethttp.Response, error) { + return r.ApiService.FakeOuterStringSerializeExecute(r) } /* * FakeOuterStringSerialize Method for FakeOuterStringSerialize - * * Test serialization of outer string types - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: - * @param "Body" (optional.String) - Input string as post body + * @return ApiFakeOuterStringSerializeRequest + */ +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context) ApiFakeOuterStringSerializeRequest { + return ApiFakeOuterStringSerializeRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return string */ -func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { +func (a *FakeApiService) FakeOuterStringSerializeExecute(r ApiFakeOuterStringSerializeRequest) (string, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -486,8 +684,13 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar localVarReturnValue string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/outer/string" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.FakeOuterStringSerialize") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/outer/string" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -510,23 +713,19 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - if localVarOptionals != nil && localVarOptionals.Body.IsSet() { - localVarPostBody = localVarOptionals.Body.Value() - } - - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -551,15 +750,38 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar return localVarReturnValue, localVarHTTPResponse, nil } +type ApiTestBodyWithFileSchemaRequest struct { + ctx _context.Context + ApiService FakeApi + fileSchemaTestClass *FileSchemaTestClass +} + +func (r ApiTestBodyWithFileSchemaRequest) FileSchemaTestClass(fileSchemaTestClass FileSchemaTestClass) ApiTestBodyWithFileSchemaRequest { + r.fileSchemaTestClass = &fileSchemaTestClass + return r +} + +func (r ApiTestBodyWithFileSchemaRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithFileSchemaExecute(r) +} + /* * TestBodyWithFileSchema Method for TestBodyWithFileSchema - * - * For this test, the body for this request much reference a schema named `File`. - * + * For this test, the body for this request much reference a schema named `File`. * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param fileSchemaTestClass + * @return ApiTestBodyWithFileSchemaRequest */ -func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchemaTestClass FileSchemaTestClass) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context) ApiTestBodyWithFileSchemaRequest { + return ApiTestBodyWithFileSchemaRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestBodyWithFileSchemaExecute(r ApiTestBodyWithFileSchemaRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -568,11 +790,19 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchema localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithFileSchema") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/body-with-file-schema" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.fileSchemaTestClass == nil { + return nil, reportError("fileSchemaTestClass is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -592,20 +822,19 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchema localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &fileSchemaTestClass - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.fileSchemaTestClass + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -621,14 +850,42 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchema return localVarHTTPResponse, nil } +type ApiTestBodyWithQueryParamsRequest struct { + ctx _context.Context + ApiService FakeApi + query *string + user *User +} + +func (r ApiTestBodyWithQueryParamsRequest) Query(query string) ApiTestBodyWithQueryParamsRequest { + r.query = &query + return r +} +func (r ApiTestBodyWithQueryParamsRequest) User(user User) ApiTestBodyWithQueryParamsRequest { + r.user = &user + return r +} + +func (r ApiTestBodyWithQueryParamsRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestBodyWithQueryParamsExecute(r) +} + /* * TestBodyWithQueryParams Method for TestBodyWithQueryParams - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param query - * @param user + * @return ApiTestBodyWithQueryParamsRequest */ -func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, user User) (*_nethttp.Response, error) { +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context) ApiTestBodyWithQueryParamsRequest { + return ApiTestBodyWithQueryParamsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryParamsRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -637,13 +894,24 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestBodyWithQueryParams") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/body-with-query-params" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.query == nil { + return nil, reportError("query is required and must be specified") + } + if r.user == nil { + return nil, reportError("user is required and must be specified") + } - localVarQueryParams.Add("query", parameterToString(query, "")) + localVarQueryParams.Add("query", parameterToString(*r.query, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -662,20 +930,19 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -691,16 +958,39 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query str return localVarHTTPResponse, nil } +type ApiTestClientModelRequest struct { + ctx _context.Context + ApiService FakeApi + client *Client +} + +func (r ApiTestClientModelRequest) Client(client Client) ApiTestClientModelRequest { + r.client = &client + return r +} + +func (r ApiTestClientModelRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.TestClientModelExecute(r) +} + /* * TestClientModel To test \"client\" model - * - * To test \"client\" model - * + * To test "client" model * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param client client model + * @return ApiTestClientModelRequest + */ +func (a *FakeApiService) TestClientModel(ctx _context.Context) ApiTestClientModelRequest { + return ApiTestClientModelRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Client */ -func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { +func (a *FakeApiService) TestClientModelExecute(r ApiTestClientModelRequest) (Client, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -710,11 +1000,19 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (C localVarReturnValue Client ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestClientModel") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.client == nil { + return localVarReturnValue, nil, reportError("client is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -734,20 +1032,19 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (C localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.client + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -772,43 +1069,107 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (C return localVarReturnValue, localVarHTTPResponse, nil } -// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' -type TestEndpointParametersOpts struct { - Integer optional.Int32 - Int32_ optional.Int32 - Int64_ optional.Int64 - Float optional.Float32 - String_ optional.String - Binary optional.Interface - Date optional.String - DateTime optional.Time - Password optional.String - Callback optional.String +type ApiTestEndpointParametersRequest struct { + ctx _context.Context + ApiService FakeApi + number *float32 + double *float64 + patternWithoutDelimiter *string + byte_ *string + integer *int32 + int32_ *int32 + int64_ *int64 + float *float32 + string_ *string + binary **os.File + date *string + dateTime *time.Time + password *string + callback *string +} + +func (r ApiTestEndpointParametersRequest) Number(number float32) ApiTestEndpointParametersRequest { + r.number = &number + return r +} +func (r ApiTestEndpointParametersRequest) Double(double float64) ApiTestEndpointParametersRequest { + r.double = &double + return r +} +func (r ApiTestEndpointParametersRequest) PatternWithoutDelimiter(patternWithoutDelimiter string) ApiTestEndpointParametersRequest { + r.patternWithoutDelimiter = &patternWithoutDelimiter + return r +} +func (r ApiTestEndpointParametersRequest) Byte_(byte_ string) ApiTestEndpointParametersRequest { + r.byte_ = &byte_ + return r +} +func (r ApiTestEndpointParametersRequest) Integer(integer int32) ApiTestEndpointParametersRequest { + r.integer = &integer + return r +} +func (r ApiTestEndpointParametersRequest) Int32_(int32_ int32) ApiTestEndpointParametersRequest { + r.int32_ = &int32_ + return r +} +func (r ApiTestEndpointParametersRequest) Int64_(int64_ int64) ApiTestEndpointParametersRequest { + r.int64_ = &int64_ + return r +} +func (r ApiTestEndpointParametersRequest) Float(float float32) ApiTestEndpointParametersRequest { + r.float = &float + return r +} +func (r ApiTestEndpointParametersRequest) String_(string_ string) ApiTestEndpointParametersRequest { + r.string_ = &string_ + return r +} +func (r ApiTestEndpointParametersRequest) Binary(binary *os.File) ApiTestEndpointParametersRequest { + r.binary = &binary + return r +} +func (r ApiTestEndpointParametersRequest) Date(date string) ApiTestEndpointParametersRequest { + r.date = &date + return r +} +func (r ApiTestEndpointParametersRequest) DateTime(dateTime time.Time) ApiTestEndpointParametersRequest { + r.dateTime = &dateTime + return r +} +func (r ApiTestEndpointParametersRequest) Password(password string) ApiTestEndpointParametersRequest { + r.password = &password + return r +} +func (r ApiTestEndpointParametersRequest) Callback(callback string) ApiTestEndpointParametersRequest { + r.callback = &callback + return r +} + +func (r ApiTestEndpointParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEndpointParametersExecute(r) } /* * TestEndpointParameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * + * Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트 + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param number None - * @param double None - * @param patternWithoutDelimiter None - * @param byte_ None - * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: - * @param "Integer" (optional.Int32) - None - * @param "Int32_" (optional.Int32) - None - * @param "Int64_" (optional.Int64) - None - * @param "Float" (optional.Float32) - None - * @param "String_" (optional.String) - None - * @param "Binary" (optional.Interface of *os.File) - None - * @param "Date" (optional.String) - None - * @param "DateTime" (optional.Time) - None - * @param "Password" (optional.String) - None - * @param "Callback" (optional.String) - None + * @return ApiTestEndpointParametersRequest */ -func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context) ApiTestEndpointParametersRequest { + return ApiTestEndpointParametersRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParametersRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -817,23 +1178,40 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEndpointParameters") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if number < 32.1 { + if r.number == nil { + return nil, reportError("number is required and must be specified") + } + if *r.number < 32.1 { return nil, reportError("number must be greater than 32.1") } - if number > 543.2 { + if *r.number > 543.2 { return nil, reportError("number must be less than 543.2") } - if double < 67.8 { + if r.double == nil { + return nil, reportError("double is required and must be specified") + } + if *r.double < 67.8 { return nil, reportError("double must be greater than 67.8") } - if double > 123.4 { + if *r.double > 123.4 { return nil, reportError("double must be less than 123.4") } + if r.patternWithoutDelimiter == nil { + return nil, reportError("patternWithoutDelimiter is required and must be specified") + } + if r.byte_ == nil { + return nil, reportError("byte_ is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -852,33 +1230,29 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.Integer.IsSet() { - localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), "")) + if r.integer != nil { + localVarFormParams.Add("integer", parameterToString(*r.integer, "")) } - if localVarOptionals != nil && localVarOptionals.Int32_.IsSet() { - localVarFormParams.Add("int32", parameterToString(localVarOptionals.Int32_.Value(), "")) + if r.int32_ != nil { + localVarFormParams.Add("int32", parameterToString(*r.int32_, "")) } - if localVarOptionals != nil && localVarOptionals.Int64_.IsSet() { - localVarFormParams.Add("int64", parameterToString(localVarOptionals.Int64_.Value(), "")) + if r.int64_ != nil { + localVarFormParams.Add("int64", parameterToString(*r.int64_, "")) } - localVarFormParams.Add("number", parameterToString(number, "")) - if localVarOptionals != nil && localVarOptionals.Float.IsSet() { - localVarFormParams.Add("float", parameterToString(localVarOptionals.Float.Value(), "")) + localVarFormParams.Add("number", parameterToString(*r.number, "")) + if r.float != nil { + localVarFormParams.Add("float", parameterToString(*r.float, "")) } - localVarFormParams.Add("double", parameterToString(double, "")) - if localVarOptionals != nil && localVarOptionals.String_.IsSet() { - localVarFormParams.Add("string", parameterToString(localVarOptionals.String_.Value(), "")) + localVarFormParams.Add("double", parameterToString(*r.double, "")) + if r.string_ != nil { + localVarFormParams.Add("string", parameterToString(*r.string_, "")) } - localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, "")) - localVarFormParams.Add("byte", parameterToString(byte_, "")) + localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, "")) + localVarFormParams.Add("byte", parameterToString(*r.byte_, "")) localVarFormFileName = "binary" var localVarFile *os.File - if localVarOptionals != nil && localVarOptionals.Binary.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.Binary.Value().(*os.File) - if !localVarFileOk { - return nil, reportError("binary should be *os.File") - } + if r.binary != nil { + localVarFile = *r.binary } if localVarFile != nil { fbs, _ := _ioutil.ReadAll(localVarFile) @@ -886,31 +1260,30 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo localVarFileName = localVarFile.Name() localVarFile.Close() } - if localVarOptionals != nil && localVarOptionals.Date.IsSet() { - localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), "")) + if r.date != nil { + localVarFormParams.Add("date", parameterToString(*r.date, "")) } - if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { - localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) + if r.dateTime != nil { + localVarFormParams.Add("dateTime", parameterToString(*r.dateTime, "")) } - if localVarOptionals != nil && localVarOptionals.Password.IsSet() { - localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + if r.password != nil { + localVarFormParams.Add("password", parameterToString(*r.password, "")) } - if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { - localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) + if r.callback != nil { + localVarFormParams.Add("callback", parameterToString(*r.callback, "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -926,35 +1299,73 @@ func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number flo return localVarHTTPResponse, nil } -// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' -type TestEnumParametersOpts struct { - EnumHeaderStringArray optional.Interface - EnumHeaderString optional.String - EnumQueryStringArray optional.Interface - EnumQueryString optional.String - EnumQueryInteger optional.Int32 - EnumQueryDouble optional.Float64 - EnumFormStringArray optional.Interface - EnumFormString optional.String +type ApiTestEnumParametersRequest struct { + ctx _context.Context + ApiService FakeApi + enumHeaderStringArray *[]string + enumHeaderString *string + enumQueryStringArray *[]string + enumQueryString *string + enumQueryInteger *int32 + enumQueryDouble *float64 + enumFormStringArray *[]string + enumFormString *string +} + +func (r ApiTestEnumParametersRequest) EnumHeaderStringArray(enumHeaderStringArray []string) ApiTestEnumParametersRequest { + r.enumHeaderStringArray = &enumHeaderStringArray + return r +} +func (r ApiTestEnumParametersRequest) EnumHeaderString(enumHeaderString string) ApiTestEnumParametersRequest { + r.enumHeaderString = &enumHeaderString + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryStringArray(enumQueryStringArray []string) ApiTestEnumParametersRequest { + r.enumQueryStringArray = &enumQueryStringArray + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryString(enumQueryString string) ApiTestEnumParametersRequest { + r.enumQueryString = &enumQueryString + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryInteger(enumQueryInteger int32) ApiTestEnumParametersRequest { + r.enumQueryInteger = &enumQueryInteger + return r +} +func (r ApiTestEnumParametersRequest) EnumQueryDouble(enumQueryDouble float64) ApiTestEnumParametersRequest { + r.enumQueryDouble = &enumQueryDouble + return r +} +func (r ApiTestEnumParametersRequest) EnumFormStringArray(enumFormStringArray []string) ApiTestEnumParametersRequest { + r.enumFormStringArray = &enumFormStringArray + return r +} +func (r ApiTestEnumParametersRequest) EnumFormString(enumFormString string) ApiTestEnumParametersRequest { + r.enumFormString = &enumFormString + return r +} + +func (r ApiTestEnumParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestEnumParametersExecute(r) } /* * TestEnumParameters To test enum parameters - * * To test enum parameters - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *TestEnumParametersOpts - Optional Parameters: - * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) - * @param "EnumHeaderString" (optional.String) - Header parameter enum test (string) - * @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array) - * @param "EnumQueryString" (optional.String) - Query parameter enum test (string) - * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) - * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) - * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) - * @param "EnumFormString" (optional.String) - Form parameter enum test (string) + * @return ApiTestEnumParametersRequest */ -func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx _context.Context) ApiTestEnumParametersRequest { + return ApiTestEnumParametersRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -963,14 +1374,19 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestEnumParameters") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { - t:=localVarOptionals.EnumQueryStringArray.Value() + if r.enumQueryStringArray != nil { + t := *r.enumQueryStringArray if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { @@ -980,14 +1396,14 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption localVarQueryParams.Add("enum_query_string_array", parameterToString(t, "multi")) } } - if localVarOptionals != nil && localVarOptionals.EnumQueryString.IsSet() { - localVarQueryParams.Add("enum_query_string", parameterToString(localVarOptionals.EnumQueryString.Value(), "")) + if r.enumQueryString != nil { + localVarQueryParams.Add("enum_query_string", parameterToString(*r.enumQueryString, "")) } - if localVarOptionals != nil && localVarOptionals.EnumQueryInteger.IsSet() { - localVarQueryParams.Add("enum_query_integer", parameterToString(localVarOptionals.EnumQueryInteger.Value(), "")) + if r.enumQueryInteger != nil { + localVarQueryParams.Add("enum_query_integer", parameterToString(*r.enumQueryInteger, "")) } - if localVarOptionals != nil && localVarOptionals.EnumQueryDouble.IsSet() { - localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), "")) + if r.enumQueryDouble != nil { + localVarQueryParams.Add("enum_query_double", parameterToString(*r.enumQueryDouble, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -1006,31 +1422,30 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { - localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") + if r.enumHeaderStringArray != nil { + localVarHeaderParams["enum_header_string_array"] = parameterToString(*r.enumHeaderStringArray, "csv") } - if localVarOptionals != nil && localVarOptionals.EnumHeaderString.IsSet() { - localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "") + if r.enumHeaderString != nil { + localVarHeaderParams["enum_header_string"] = parameterToString(*r.enumHeaderString, "") } - if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() { - localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "csv")) + if r.enumFormStringArray != nil { + localVarFormParams.Add("enum_form_string_array", parameterToString(*r.enumFormStringArray, "csv")) } - if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { - localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) + if r.enumFormString != nil { + localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1046,28 +1461,63 @@ func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOption return localVarHTTPResponse, nil } -// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' -type TestGroupParametersOpts struct { - StringGroup optional.Int32 - BooleanGroup optional.Bool - Int64Group optional.Int64 +type ApiTestGroupParametersRequest struct { + ctx _context.Context + ApiService FakeApi + requiredStringGroup *int32 + requiredBooleanGroup *bool + requiredInt64Group *int64 + stringGroup *int32 + booleanGroup *bool + int64Group *int64 +} + +func (r ApiTestGroupParametersRequest) RequiredStringGroup(requiredStringGroup int32) ApiTestGroupParametersRequest { + r.requiredStringGroup = &requiredStringGroup + return r +} +func (r ApiTestGroupParametersRequest) RequiredBooleanGroup(requiredBooleanGroup bool) ApiTestGroupParametersRequest { + r.requiredBooleanGroup = &requiredBooleanGroup + return r +} +func (r ApiTestGroupParametersRequest) RequiredInt64Group(requiredInt64Group int64) ApiTestGroupParametersRequest { + r.requiredInt64Group = &requiredInt64Group + return r +} +func (r ApiTestGroupParametersRequest) StringGroup(stringGroup int32) ApiTestGroupParametersRequest { + r.stringGroup = &stringGroup + return r +} +func (r ApiTestGroupParametersRequest) BooleanGroup(booleanGroup bool) ApiTestGroupParametersRequest { + r.booleanGroup = &booleanGroup + return r +} +func (r ApiTestGroupParametersRequest) Int64Group(int64Group int64) ApiTestGroupParametersRequest { + r.int64Group = &int64Group + return r +} + +func (r ApiTestGroupParametersRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestGroupParametersExecute(r) } /* * TestGroupParameters Fake endpoint to test group parameters (optional) - * * Fake endpoint to test group parameters (optional) - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requiredStringGroup Required String in group parameters - * @param requiredBooleanGroup Required Boolean in group parameters - * @param requiredInt64Group Required Integer in group parameters - * @param optional nil or *TestGroupParametersOpts - Optional Parameters: - * @param "StringGroup" (optional.Int32) - String in group parameters - * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters - * @param "Int64Group" (optional.Int64) - Integer in group parameters + * @return ApiTestGroupParametersRequest */ -func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { +func (a *FakeApiService) TestGroupParameters(ctx _context.Context) ApiTestGroupParametersRequest { + return ApiTestGroupParametersRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -1076,19 +1526,33 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestGroupParameters") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - - localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) - localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) - if localVarOptionals != nil && localVarOptionals.StringGroup.IsSet() { - localVarQueryParams.Add("string_group", parameterToString(localVarOptionals.StringGroup.Value(), "")) + if r.requiredStringGroup == nil { + return nil, reportError("requiredStringGroup is required and must be specified") } - if localVarOptionals != nil && localVarOptionals.Int64Group.IsSet() { - localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) + if r.requiredBooleanGroup == nil { + return nil, reportError("requiredBooleanGroup is required and must be specified") + } + if r.requiredInt64Group == nil { + return nil, reportError("requiredInt64Group is required and must be specified") + } + + localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, "")) + localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, "")) + if r.stringGroup != nil { + localVarQueryParams.Add("string_group", parameterToString(*r.stringGroup, "")) + } + if r.int64Group != nil { + localVarQueryParams.Add("int64_group", parameterToString(*r.int64Group, "")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1107,23 +1571,22 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") - if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { - localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") + localVarHeaderParams["required_boolean_group"] = parameterToString(*r.requiredBooleanGroup, "") + if r.booleanGroup != nil { + localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1139,13 +1602,37 @@ func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStrin return localVarHTTPResponse, nil } +type ApiTestInlineAdditionalPropertiesRequest struct { + ctx _context.Context + ApiService FakeApi + requestBody *map[string]string +} + +func (r ApiTestInlineAdditionalPropertiesRequest) RequestBody(requestBody map[string]string) ApiTestInlineAdditionalPropertiesRequest { + r.requestBody = &requestBody + return r +} + +func (r ApiTestInlineAdditionalPropertiesRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestInlineAdditionalPropertiesExecute(r) +} + /* * TestInlineAdditionalProperties test inline additionalProperties - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param requestBody request body + * @return ApiTestInlineAdditionalPropertiesRequest */ -func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, requestBody map[string]string) (*_nethttp.Response, error) { +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context) ApiTestInlineAdditionalPropertiesRequest { + return ApiTestInlineAdditionalPropertiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestInlineAdditionalPropertiesExecute(r ApiTestInlineAdditionalPropertiesRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -1154,11 +1641,19 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, re localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestInlineAdditionalProperties") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/inline-additionalProperties" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.requestBody == nil { + return nil, reportError("requestBody is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1178,20 +1673,19 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, re localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &requestBody - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.requestBody + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1207,14 +1701,42 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, re return localVarHTTPResponse, nil } +type ApiTestJsonFormDataRequest struct { + ctx _context.Context + ApiService FakeApi + param *string + param2 *string +} + +func (r ApiTestJsonFormDataRequest) Param(param string) ApiTestJsonFormDataRequest { + r.param = ¶m + return r +} +func (r ApiTestJsonFormDataRequest) Param2(param2 string) ApiTestJsonFormDataRequest { + r.param2 = ¶m2 + return r +} + +func (r ApiTestJsonFormDataRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestJsonFormDataExecute(r) +} + /* * TestJsonFormData test json serialization of form data - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param param field1 - * @param param2 field2 + * @return ApiTestJsonFormDataRequest */ -func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, param2 string) (*_nethttp.Response, error) { +func (a *FakeApiService) TestJsonFormData(ctx _context.Context) ApiTestJsonFormDataRequest { + return ApiTestJsonFormDataRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -1223,11 +1745,22 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestJsonFormData") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/jsonFormData" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.param == nil { + return nil, reportError("param is required and must be specified") + } + if r.param2 == nil { + return nil, reportError("param2 is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} @@ -1246,21 +1779,20 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - localVarFormParams.Add("param", parameterToString(param, "")) - localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarFormParams.Add("param", parameterToString(*r.param, "")) + localVarFormParams.Add("param2", parameterToString(*r.param2, "")) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -1276,19 +1808,58 @@ func (a *FakeApiService) TestJsonFormData(ctx _context.Context, param string, pa return localVarHTTPResponse, nil } +type ApiTestQueryParameterCollectionFormatRequest struct { + ctx _context.Context + ApiService FakeApi + pipe *[]string + ioutil *[]string + http *[]string + url *[]string + context *[]string +} + +func (r ApiTestQueryParameterCollectionFormatRequest) Pipe(pipe []string) ApiTestQueryParameterCollectionFormatRequest { + r.pipe = &pipe + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Ioutil(ioutil []string) ApiTestQueryParameterCollectionFormatRequest { + r.ioutil = &ioutil + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Http(http []string) ApiTestQueryParameterCollectionFormatRequest { + r.http = &http + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Url(url []string) ApiTestQueryParameterCollectionFormatRequest { + r.url = &url + return r +} +func (r ApiTestQueryParameterCollectionFormatRequest) Context(context []string) ApiTestQueryParameterCollectionFormatRequest { + r.context = &context + return r +} + +func (r ApiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.TestQueryParameterCollectionFormatExecute(r) +} + /* * TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat - * * To test the collection format in query parameters - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pipe - * @param ioutil - * @param http - * @param url - * @param context + * @return ApiTestQueryParameterCollectionFormatRequest */ -func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context) ApiTestQueryParameterCollectionFormatRequest { + return ApiTestQueryParameterCollectionFormatRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQueryParameterCollectionFormatRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -1297,14 +1868,34 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryParameterCollectionFormat") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/test-query-paramters" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.pipe == nil { + return nil, reportError("pipe is required and must be specified") + } + if r.ioutil == nil { + return nil, reportError("ioutil is required and must be specified") + } + if r.http == nil { + return nil, reportError("http is required and must be specified") + } + if r.url == nil { + return nil, reportError("url is required and must be specified") + } + if r.context == nil { + return nil, reportError("context is required and must be specified") + } { - t:=pipe + t := *r.pipe if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { @@ -1314,11 +1905,11 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("pipe", parameterToString(t, "multi")) } } - localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) - localVarQueryParams.Add("http", parameterToString(http, "ssv")) - localVarQueryParams.Add("url", parameterToString(url, "csv")) + localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(*r.http, "ssv")) + localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) { - t:=context + t := *r.context if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { @@ -1345,19 +1936,18 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go index c0d1668e791..f3aba54e388 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" ) // Linger please @@ -22,19 +21,59 @@ var ( _ _context.Context ) +type FakeClassnameTags123Api interface { + + /* + * TestClassname To test class name in snake case + * To test class name in snake case + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiTestClassnameRequest + */ + TestClassname(ctx _context.Context) ApiTestClassnameRequest + + /* + * TestClassnameExecute executes the request + * @return Client + */ + TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) +} + // FakeClassnameTags123ApiService FakeClassnameTags123Api service type FakeClassnameTags123ApiService service +type ApiTestClassnameRequest struct { + ctx _context.Context + ApiService FakeClassnameTags123Api + client *Client +} + +func (r ApiTestClassnameRequest) Client(client Client) ApiTestClassnameRequest { + r.client = &client + return r +} + +func (r ApiTestClassnameRequest) Execute() (Client, *_nethttp.Response, error) { + return r.ApiService.TestClassnameExecute(r) +} + /* * TestClassname To test class name in snake case - * * To test class name in snake case - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param client client model + * @return ApiTestClassnameRequest + */ +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context) ApiTestClassnameRequest { + return ApiTestClassnameRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Client */ -func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { +func (a *FakeClassnameTags123ApiService) TestClassnameExecute(r ApiTestClassnameRequest) (Client, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -44,11 +83,19 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, cli localVarReturnValue Client ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake_classname_test" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeClassnameTags123ApiService.TestClassname") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake_classname_test" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.client == nil { + return localVarReturnValue, nil, reportError("client is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -68,32 +115,33 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, cli localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &client - if ctx != nil { + localVarPostBody = r.client + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["api_key_query"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarQueryParams.Add("api_key_query", key) } - localVarQueryParams.Add("api_key_query", key) } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go index fb17f236110..092e48cda08 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_pet.go @@ -14,9 +14,7 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" "strings" - "github.com/antihax/optional" "os" ) @@ -25,16 +23,164 @@ var ( _ _context.Context ) +type PetApi interface { + + /* + * AddPet Add a new pet to the store + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiAddPetRequest + */ + AddPet(ctx _context.Context) ApiAddPetRequest + + /* + * AddPetExecute executes the request + */ + AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) + + /* + * DeletePet Deletes a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId Pet id to delete + * @return ApiDeletePetRequest + */ + DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest + + /* + * DeletePetExecute executes the request + */ + DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) + + /* + * FindPetsByStatus Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFindPetsByStatusRequest + */ + FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest + + /* + * FindPetsByStatusExecute executes the request + * @return []Pet + */ + FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) + + /* + * FindPetsByTags Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiFindPetsByTagsRequest + */ + FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest + + /* + * FindPetsByTagsExecute executes the request + * @return []Pet + */ + FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) + + /* + * GetPetById Find pet by ID + * Returns a single pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to return + * @return ApiGetPetByIdRequest + */ + GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest + + /* + * GetPetByIdExecute executes the request + * @return Pet + */ + GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) + + /* + * UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiUpdatePetRequest + */ + UpdatePet(ctx _context.Context) ApiUpdatePetRequest + + /* + * UpdatePetExecute executes the request + */ + UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) + + /* + * UpdatePetWithForm Updates a pet in the store with form data + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet that needs to be updated + * @return ApiUpdatePetWithFormRequest + */ + UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest + + /* + * UpdatePetWithFormExecute executes the request + */ + UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) + + /* + * UploadFile uploads an image + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to update + * @return ApiUploadFileRequest + */ + UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest + + /* + * UploadFileExecute executes the request + * @return ApiResponse + */ + UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) + + /* + * UploadFileWithRequiredFile uploads an image (required) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param petId ID of pet to update + * @return ApiUploadFileWithRequiredFileRequest + */ + UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest + + /* + * UploadFileWithRequiredFileExecute executes the request + * @return ApiResponse + */ + UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) +} + // PetApiService PetApi service type PetApiService service +type ApiAddPetRequest struct { + ctx _context.Context + ApiService PetApi + pet *Pet +} + +func (r ApiAddPetRequest) Pet(pet Pet) ApiAddPetRequest { + r.pet = &pet + return r +} + +func (r ApiAddPetRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.AddPetExecute(r) +} + /* * AddPet Add a new pet to the store - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pet Pet object that needs to be added to the store + * @return ApiAddPetRequest */ -func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) { +func (a *PetApiService) AddPet(ctx _context.Context) ApiAddPetRequest { + return ApiAddPetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) AddPetExecute(r ApiAddPetRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -43,11 +189,19 @@ func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Respons localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.AddPet") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.pet == nil { + return nil, reportError("pet is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -67,20 +221,19 @@ func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Respons localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.pet + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -96,20 +249,40 @@ func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Respons return localVarHTTPResponse, nil } -// DeletePetOpts Optional parameters for the method 'DeletePet' -type DeletePetOpts struct { - ApiKey optional.String +type ApiDeletePetRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + apiKey *string +} + +func (r ApiDeletePetRequest) ApiKey(apiKey string) ApiDeletePetRequest { + r.apiKey = &apiKey + return r +} + +func (r ApiDeletePetRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeletePetExecute(r) } /* * DeletePet Deletes a pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete - * @param optional nil or *DeletePetOpts - Optional Parameters: - * @param "ApiKey" (optional.String) - + * @return ApiDeletePetRequest */ -func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64) ApiDeletePetRequest { + return ApiDeletePetRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -118,9 +291,13 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.DeletePet") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -143,22 +320,21 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { - localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") + if r.apiKey != nil { + localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -174,16 +350,39 @@ func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOpt return localVarHTTPResponse, nil } +type ApiFindPetsByStatusRequest struct { + ctx _context.Context + ApiService PetApi + status *[]string +} + +func (r ApiFindPetsByStatusRequest) Status(status []string) ApiFindPetsByStatusRequest { + r.status = &status + return r +} + +func (r ApiFindPetsByStatusRequest) Execute() ([]Pet, *_nethttp.Response, error) { + return r.ApiService.FindPetsByStatusExecute(r) +} + /* * FindPetsByStatus Finds Pets by status - * * Multiple status values can be provided with comma separated strings - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param status Status values that need to be considered for filter + * @return ApiFindPetsByStatusRequest + */ +func (a *PetApiService) FindPetsByStatus(ctx _context.Context) ApiFindPetsByStatusRequest { + return ApiFindPetsByStatusRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([]Pet, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -193,13 +392,21 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) localVarReturnValue []Pet ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByStatus") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/findByStatus" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.status == nil { + return localVarReturnValue, nil, reportError("status is required and must be specified") + } - localVarQueryParams.Add("status", parameterToString(status, "csv")) + localVarQueryParams.Add("status", parameterToString(*r.status, "csv")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -217,19 +424,18 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -254,16 +460,39 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string) return localVarReturnValue, localVarHTTPResponse, nil } +type ApiFindPetsByTagsRequest struct { + ctx _context.Context + ApiService PetApi + tags *[]string +} + +func (r ApiFindPetsByTagsRequest) Tags(tags []string) ApiFindPetsByTagsRequest { + r.tags = &tags + return r +} + +func (r ApiFindPetsByTagsRequest) Execute() ([]Pet, *_nethttp.Response, error) { + return r.ApiService.FindPetsByTagsExecute(r) +} + /* * FindPetsByTags Finds Pets by tags - * * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param tags Tags to filter by + * @return ApiFindPetsByTagsRequest + */ +func (a *PetApiService) FindPetsByTags(ctx _context.Context) ApiFindPetsByTagsRequest { + return ApiFindPetsByTagsRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return []Pet */ -func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]Pet, *_nethttp.Response, error) { +func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -273,13 +502,21 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P localVarReturnValue []Pet ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/findByTags" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.FindPetsByTags") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/findByTags" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.tags == nil { + return localVarReturnValue, nil, reportError("tags is required and must be specified") + } - localVarQueryParams.Add("tags", parameterToString(tags, "csv")) + localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -297,19 +534,18 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -334,16 +570,37 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetPetByIdRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 +} + + +func (r ApiGetPetByIdRequest) Execute() (Pet, *_nethttp.Response, error) { + return r.ApiService.GetPetByIdExecute(r) +} + /* * GetPetById Find pet by ID - * * Returns a single pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to return + * @return ApiGetPetByIdRequest + */ +func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) ApiGetPetByIdRequest { + return ApiGetPetByIdRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request * @return Pet */ -func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_nethttp.Response, error) { +func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (Pet, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -353,9 +610,13 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne localVarReturnValue Pet ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.GetPetById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -378,31 +639,32 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if ctx != nil { + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["api_key"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["api_key"] = key } - localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -427,13 +689,37 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne return localVarReturnValue, localVarHTTPResponse, nil } +type ApiUpdatePetRequest struct { + ctx _context.Context + ApiService PetApi + pet *Pet +} + +func (r ApiUpdatePetRequest) Pet(pet Pet) ApiUpdatePetRequest { + r.pet = &pet + return r +} + +func (r ApiUpdatePetRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.UpdatePetExecute(r) +} + /* * UpdatePet Update an existing pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param pet Pet object that needs to be added to the store + * @return ApiUpdatePetRequest */ -func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePet(ctx _context.Context) ApiUpdatePetRequest { + return ApiUpdatePetRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) UpdatePetExecute(r ApiUpdatePetRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -442,11 +728,19 @@ func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Resp localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePet") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.pet == nil { + return nil, reportError("pet is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json", "application/xml"} @@ -466,20 +760,19 @@ func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Resp localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.pet + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -495,22 +788,45 @@ func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Resp return localVarHTTPResponse, nil } -// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' -type UpdatePetWithFormOpts struct { - Name optional.String - Status optional.String +type ApiUpdatePetWithFormRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + name *string + status *string +} + +func (r ApiUpdatePetWithFormRequest) Name(name string) ApiUpdatePetWithFormRequest { + r.name = &name + return r +} +func (r ApiUpdatePetWithFormRequest) Status(status string) ApiUpdatePetWithFormRequest { + r.status = &status + return r +} + +func (r ApiUpdatePetWithFormRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.UpdatePetWithFormExecute(r) } /* * UpdatePetWithForm Updates a pet in the store with form data - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated - * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: - * @param "Name" (optional.String) - Updated name of the pet - * @param "Status" (optional.String) - Updated status of the pet + * @return ApiUpdatePetWithFormRequest */ -func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64) ApiUpdatePetWithFormRequest { + return ApiUpdatePetWithFormRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request + */ +func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -519,9 +835,13 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, loc localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UpdatePetWithForm") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -544,25 +864,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, loc if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.Name.IsSet() { - localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + if r.name != nil { + localVarFormParams.Add("name", parameterToString(*r.name, "")) } - if localVarOptionals != nil && localVarOptionals.Status.IsSet() { - localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) + if r.status != nil { + localVarFormParams.Add("status", parameterToString(*r.status, "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -578,23 +897,46 @@ func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, loc return localVarHTTPResponse, nil } -// UploadFileOpts Optional parameters for the method 'UploadFile' -type UploadFileOpts struct { - AdditionalMetadata optional.String - File optional.Interface +type ApiUploadFileRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + additionalMetadata *string + file **os.File +} + +func (r ApiUploadFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileRequest { + r.additionalMetadata = &additionalMetadata + return r +} +func (r ApiUploadFileRequest) File(file *os.File) ApiUploadFileRequest { + r.file = &file + return r +} + +func (r ApiUploadFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFileExecute(r) } /* * UploadFile uploads an image - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param optional nil or *UploadFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server - * @param "File" (optional.Interface of *os.File) - file to upload + * @return ApiUploadFileRequest + */ +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64) ApiUploadFileRequest { + return ApiUploadFileRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (ApiResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -604,9 +946,13 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp localVarReturnValue ApiResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFile") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/pet/{petId}/uploadImage" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -629,17 +975,13 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { - localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + if r.additionalMetadata != nil { + localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } localVarFormFileName = "file" var localVarFile *os.File - if localVarOptionals != nil && localVarOptionals.File.IsSet() { - localVarFileOk := false - localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) - if !localVarFileOk { - return localVarReturnValue, nil, reportError("file should be *os.File") - } + if r.file != nil { + localVarFile = *r.file } if localVarFile != nil { fbs, _ := _ioutil.ReadAll(localVarFile) @@ -647,19 +989,18 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -684,22 +1025,46 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp return localVarReturnValue, localVarHTTPResponse, nil } -// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' -type UploadFileWithRequiredFileOpts struct { - AdditionalMetadata optional.String +type ApiUploadFileWithRequiredFileRequest struct { + ctx _context.Context + ApiService PetApi + petId int64 + requiredFile **os.File + additionalMetadata *string +} + +func (r ApiUploadFileWithRequiredFileRequest) RequiredFile(requiredFile *os.File) ApiUploadFileWithRequiredFileRequest { + r.requiredFile = &requiredFile + return r +} +func (r ApiUploadFileWithRequiredFileRequest) AdditionalMetadata(additionalMetadata string) ApiUploadFileWithRequiredFileRequest { + r.additionalMetadata = &additionalMetadata + return r +} + +func (r ApiUploadFileWithRequiredFileRequest) Execute() (ApiResponse, *_nethttp.Response, error) { + return r.ApiService.UploadFileWithRequiredFileExecute(r) } /* * UploadFileWithRequiredFile uploads an image (required) - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param requiredFile file to upload - * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: - * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server + * @return ApiUploadFileWithRequiredFileRequest + */ +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64) ApiUploadFileWithRequiredFileRequest { + return ApiUploadFileWithRequiredFileRequest{ + ApiService: a, + ctx: ctx, + petId: petId, + } +} + +/* + * Execute executes the request * @return ApiResponse */ -func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithRequiredFileRequest) (ApiResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -709,13 +1074,20 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i localVarReturnValue ApiResponse ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" - localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(petId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PetApiService.UploadFileWithRequiredFile") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.PathEscape(parameterToString(r.petId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.requiredFile == nil { + return localVarReturnValue, nil, reportError("requiredFile is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"multipart/form-data"} @@ -734,30 +1106,29 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { - localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + if r.additionalMetadata != nil { + localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, "")) } localVarFormFileName = "requiredFile" - localVarFile := requiredFile + localVarFile := *r.requiredFile if localVarFile != nil { fbs, _ := _ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_store.go b/samples/openapi3/client/petstore/go/go-petstore/api_store.go index f683edb1814..021b6ca7dcb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_store.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" "strings" ) @@ -23,18 +22,98 @@ var ( _ _context.Context ) +type StoreApi interface { + + /* + * DeleteOrder Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param orderId ID of the order that needs to be deleted + * @return ApiDeleteOrderRequest + */ + DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest + + /* + * DeleteOrderExecute executes the request + */ + DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) + + /* + * GetInventory Returns pet inventories by status + * Returns a map of status codes to quantities + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiGetInventoryRequest + */ + GetInventory(ctx _context.Context) ApiGetInventoryRequest + + /* + * GetInventoryExecute executes the request + * @return map[string]int32 + */ + GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) + + /* + * GetOrderById Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param orderId ID of pet that needs to be fetched + * @return ApiGetOrderByIdRequest + */ + GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest + + /* + * GetOrderByIdExecute executes the request + * @return Order + */ + GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) + + /* + * PlaceOrder Place an order for a pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiPlaceOrderRequest + */ + PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest + + /* + * PlaceOrderExecute executes the request + * @return Order + */ + PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) +} + // StoreApiService StoreApi service type StoreApiService service +type ApiDeleteOrderRequest struct { + ctx _context.Context + ApiService StoreApi + orderId string +} + + +func (r ApiDeleteOrderRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeleteOrderExecute(r) +} + /* * DeleteOrder Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of the order that needs to be deleted + * @return ApiDeleteOrderRequest */ -func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_nethttp.Response, error) { +func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) ApiDeleteOrderRequest { + return ApiDeleteOrderRequest{ + ApiService: a, + ctx: ctx, + orderId: orderId, + } +} + +/* + * Execute executes the request + */ +func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -43,9 +122,13 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(orderId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.DeleteOrder") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -68,19 +151,18 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -96,15 +178,34 @@ func (a *StoreApiService) DeleteOrder(ctx _context.Context, orderId string) (*_n return localVarHTTPResponse, nil } +type ApiGetInventoryRequest struct { + ctx _context.Context + ApiService StoreApi +} + + +func (r ApiGetInventoryRequest) Execute() (map[string]int32, *_nethttp.Response, error) { + return r.ApiService.GetInventoryExecute(r) +} + /* * GetInventory Returns pet inventories by status - * * Returns a map of status codes to quantities - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiGetInventoryRequest + */ +func (a *StoreApiService) GetInventory(ctx _context.Context) ApiGetInventoryRequest { + return ApiGetInventoryRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return map[string]int32 */ -func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, *_nethttp.Response, error) { +func (a *StoreApiService) GetInventoryExecute(r ApiGetInventoryRequest) (map[string]int32, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -114,8 +215,13 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, localVarReturnValue map[string]int32 ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/inventory" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetInventory") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/inventory" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -137,31 +243,32 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - if ctx != nil { + if r.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 + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["api_key"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["api_key"] = key } - localVarHeaderParams["api_key"] = key } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -186,16 +293,37 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32, return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetOrderByIdRequest struct { + ctx _context.Context + ApiService StoreApi + orderId int64 +} + + +func (r ApiGetOrderByIdRequest) Execute() (Order, *_nethttp.Response, error) { + return r.ApiService.GetOrderByIdExecute(r) +} + /* * GetOrderById Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param orderId ID of pet that needs to be fetched + * @return ApiGetOrderByIdRequest + */ +func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) ApiGetOrderByIdRequest { + return ApiGetOrderByIdRequest{ + ApiService: a, + ctx: ctx, + orderId: orderId, + } +} + +/* + * Execute executes the request * @return Order */ -func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (Order, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -205,17 +333,21 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord localVarReturnValue Order ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" - localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(orderId, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.GetOrderById") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.PathEscape(parameterToString(r.orderId, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if orderId < 1 { + if r.orderId < 1 { return localVarReturnValue, nil, reportError("orderId must be greater than 1") } - if orderId > 5 { + if r.orderId > 5 { return localVarReturnValue, nil, reportError("orderId must be less than 5") } @@ -236,19 +368,18 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -273,14 +404,38 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord return localVarReturnValue, localVarHTTPResponse, nil } +type ApiPlaceOrderRequest struct { + ctx _context.Context + ApiService StoreApi + order *Order +} + +func (r ApiPlaceOrderRequest) Order(order Order) ApiPlaceOrderRequest { + r.order = &order + return r +} + +func (r ApiPlaceOrderRequest) Execute() (Order, *_nethttp.Response, error) { + return r.ApiService.PlaceOrderExecute(r) +} + /* * PlaceOrder Place an order for a pet - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param order order placed for purchasing the pet + * @return ApiPlaceOrderRequest + */ +func (a *StoreApiService) PlaceOrder(ctx _context.Context) ApiPlaceOrderRequest { + return ApiPlaceOrderRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return Order */ -func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order, *_nethttp.Response, error) { +func (a *StoreApiService) PlaceOrderExecute(r ApiPlaceOrderRequest) (Order, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -290,11 +445,19 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order, localVarReturnValue Order ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/store/order" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StoreApiService.PlaceOrder") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/store/order" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.order == nil { + return localVarReturnValue, nil, reportError("order is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -314,20 +477,19 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order, localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &order - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.order + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_user.go b/samples/openapi3/client/petstore/go/go-petstore/api_user.go index ad3e4e42c14..4a6a8a991ec 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_user.go @@ -14,7 +14,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - _bytes "bytes" "strings" ) @@ -23,18 +22,148 @@ var ( _ _context.Context ) +type UserApi interface { + + /* + * CreateUser Create user + * This can only be done by the logged in user. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateUserRequest + */ + CreateUser(ctx _context.Context) ApiCreateUserRequest + + /* + * CreateUserExecute executes the request + */ + CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) + + /* + * CreateUsersWithArrayInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateUsersWithArrayInputRequest + */ + CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest + + /* + * CreateUsersWithArrayInputExecute executes the request + */ + CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) + + /* + * CreateUsersWithListInput Creates list of users with given input array + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiCreateUsersWithListInputRequest + */ + CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest + + /* + * CreateUsersWithListInputExecute executes the request + */ + CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) + + /* + * DeleteUser Delete user + * This can only be done by the logged in user. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The name that needs to be deleted + * @return ApiDeleteUserRequest + */ + DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest + + /* + * DeleteUserExecute executes the request + */ + DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) + + /* + * GetUserByName Get user by user name + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiGetUserByNameRequest + */ + GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest + + /* + * GetUserByNameExecute executes the request + * @return User + */ + GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) + + /* + * LoginUser Logs user into the system + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLoginUserRequest + */ + LoginUser(ctx _context.Context) ApiLoginUserRequest + + /* + * LoginUserExecute executes the request + * @return string + */ + LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) + + /* + * LogoutUser Logs out current logged in user session + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLogoutUserRequest + */ + LogoutUser(ctx _context.Context) ApiLogoutUserRequest + + /* + * LogoutUserExecute executes the request + */ + LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) + + /* + * UpdateUser Updated user + * This can only be done by the logged in user. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param username name that need to be deleted + * @return ApiUpdateUserRequest + */ + UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest + + /* + * UpdateUserExecute executes the request + */ + UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) +} + // UserApiService UserApi service type UserApiService service +type ApiCreateUserRequest struct { + ctx _context.Context + ApiService UserApi + user *User +} + +func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest { + r.user = &user + return r +} + +func (r ApiCreateUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateUserExecute(r) +} + /* * CreateUser Create user - * * This can only be done by the logged in user. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param user Created user object + * @return ApiCreateUserRequest */ -func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUser(ctx _context.Context) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) CreateUserExecute(r ApiCreateUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -43,11 +172,19 @@ func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp. localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.user == nil { + return nil, reportError("user is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -67,20 +204,19 @@ func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp. localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -96,13 +232,37 @@ func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp. return localVarHTTPResponse, nil } +type ApiCreateUsersWithArrayInputRequest struct { + ctx _context.Context + ApiService UserApi + user *[]User +} + +func (r ApiCreateUsersWithArrayInputRequest) User(user []User) ApiCreateUsersWithArrayInputRequest { + r.user = &user + return r +} + +func (r ApiCreateUsersWithArrayInputRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateUsersWithArrayInputExecute(r) +} + /* * CreateUsersWithArrayInput Creates list of users with given input array - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param user List of user object + * @return ApiCreateUsersWithArrayInputRequest */ -func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user []User) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context) ApiCreateUsersWithArrayInputRequest { + return ApiCreateUsersWithArrayInputRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) CreateUsersWithArrayInputExecute(r ApiCreateUsersWithArrayInputRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -111,11 +271,19 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user [] localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/createWithArray" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithArrayInput") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/createWithArray" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.user == nil { + return nil, reportError("user is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -135,20 +303,19 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user [] localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -164,13 +331,37 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user [] return localVarHTTPResponse, nil } +type ApiCreateUsersWithListInputRequest struct { + ctx _context.Context + ApiService UserApi + user *[]User +} + +func (r ApiCreateUsersWithListInputRequest) User(user []User) ApiCreateUsersWithListInputRequest { + r.user = &user + return r +} + +func (r ApiCreateUsersWithListInputRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.CreateUsersWithListInputExecute(r) +} + /* * CreateUsersWithListInput Creates list of users with given input array - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param user List of user object + * @return ApiCreateUsersWithListInputRequest */ -func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []User) (*_nethttp.Response, error) { +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context) ApiCreateUsersWithListInputRequest { + return ApiCreateUsersWithListInputRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) CreateUsersWithListInputExecute(r ApiCreateUsersWithListInputRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} @@ -179,11 +370,19 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []U localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/createWithList" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.CreateUsersWithListInput") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/createWithList" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.user == nil { + return nil, reportError("user is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -203,20 +402,19 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []U localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -232,15 +430,36 @@ func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []U return localVarHTTPResponse, nil } +type ApiDeleteUserRequest struct { + ctx _context.Context + ApiService UserApi + username string +} + + +func (r ApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + /* * DeleteUser Delete user - * * This can only be done by the logged in user. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be deleted + * @return ApiDeleteUserRequest */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_nethttp.Response, error) { +func (a *UserApiService) DeleteUser(ctx _context.Context, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -249,9 +468,13 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -274,19 +497,18 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -302,14 +524,36 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) (*_ne return localVarHTTPResponse, nil } +type ApiGetUserByNameRequest struct { + ctx _context.Context + ApiService UserApi + username string +} + + +func (r ApiGetUserByNameRequest) Execute() (User, *_nethttp.Response, error) { + return r.ApiService.GetUserByNameExecute(r) +} + /* * GetUserByName Get user by user name - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username The name that needs to be fetched. Use user1 for testing. + * @return ApiGetUserByNameRequest + */ +func (a *UserApiService) GetUserByName(ctx _context.Context, username string) ApiGetUserByNameRequest { + return ApiGetUserByNameRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +/* + * Execute executes the request * @return User */ -func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (User, *_nethttp.Response, error) { +func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (User, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -319,9 +563,13 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U localVarReturnValue User ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUserByName") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -344,19 +592,18 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -381,15 +628,43 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U return localVarReturnValue, localVarHTTPResponse, nil } +type ApiLoginUserRequest struct { + ctx _context.Context + ApiService UserApi + username *string + password *string +} + +func (r ApiLoginUserRequest) Username(username string) ApiLoginUserRequest { + r.username = &username + return r +} +func (r ApiLoginUserRequest) Password(password string) ApiLoginUserRequest { + r.password = &password + return r +} + +func (r ApiLoginUserRequest) Execute() (string, *_nethttp.Response, error) { + return r.ApiService.LoginUserExecute(r) +} + /* * LoginUser Logs user into the system - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param username The user name for login - * @param password The password for login in clear text + * @return ApiLoginUserRequest + */ +func (a *UserApiService) LoginUser(ctx _context.Context) ApiLoginUserRequest { + return ApiLoginUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request * @return string */ -func (a *UserApiService) LoginUser(ctx _context.Context, username string, password string) (string, *_nethttp.Response, error) { +func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -399,14 +674,25 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo localVarReturnValue string ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/login" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LoginUser") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/login" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.username == nil { + return localVarReturnValue, nil, reportError("username is required and must be specified") + } + if r.password == nil { + return localVarReturnValue, nil, reportError("password is required and must be specified") + } - localVarQueryParams.Add("username", parameterToString(username, "")) - localVarQueryParams.Add("password", parameterToString(password, "")) + localVarQueryParams.Add("username", parameterToString(*r.username, "")) + localVarQueryParams.Add("password", parameterToString(*r.password, "")) // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -424,19 +710,18 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } @@ -461,12 +746,32 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo return localVarReturnValue, localVarHTTPResponse, nil } +type ApiLogoutUserRequest struct { + ctx _context.Context + ApiService UserApi +} + + +func (r ApiLogoutUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.LogoutUserExecute(r) +} + /* * LogoutUser Logs out current logged in user session - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ApiLogoutUserRequest */ -func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, error) { +func (a *UserApiService) LogoutUser(ctx _context.Context) ApiLogoutUserRequest { + return ApiLogoutUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) LogoutUserExecute(r ApiLogoutUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -475,8 +780,13 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/logout" + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.LogoutUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/logout" + localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -498,19 +808,18 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } @@ -526,16 +835,41 @@ func (a *UserApiService) LogoutUser(ctx _context.Context) (*_nethttp.Response, e return localVarHTTPResponse, nil } +type ApiUpdateUserRequest struct { + ctx _context.Context + ApiService UserApi + username string + user *User +} + +func (r ApiUpdateUserRequest) User(user User) ApiUpdateUserRequest { + r.user = &user + return r +} + +func (r ApiUpdateUserRequest) Execute() (*_nethttp.Response, error) { + return r.ApiService.UpdateUserExecute(r) +} + /* * UpdateUser Updated user - * * This can only be done by the logged in user. - * * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param username name that need to be deleted - * @param user Updated user object + * @return ApiUpdateUserRequest */ -func (a *UserApiService) UpdateUser(ctx _context.Context, username string, user User) (*_nethttp.Response, error) { +func (a *UserApiService) UpdateUser(ctx _context.Context, username string) ApiUpdateUserRequest { + return ApiUpdateUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +/* + * Execute executes the request + */ +func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut localVarPostBody interface{} @@ -544,13 +878,20 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string, user localVarFileBytes []byte ) - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/user/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(username, "")) , -1) + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser") + if err != nil { + return nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")) , -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.user == nil { + return nil, reportError("user is required and must be specified") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -570,20 +911,19 @@ func (a *UserApiService) UpdateUser(ctx _context.Context, username string, user localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } - localVarHTTPResponse, err := a.client.callAPI(r) + localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } diff --git a/samples/openapi3/client/petstore/go/go-petstore/client.go b/samples/openapi3/client/petstore/go/go-petstore/client.go index 838b6e9d0e0..a0833f77d79 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/client.go @@ -17,7 +17,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "mime/multipart" "net/http" @@ -36,7 +35,7 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?(?:problem\+)?json)`) + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) ) @@ -48,19 +47,19 @@ type APIClient struct { // API Services - AnotherFakeApi *AnotherFakeApiService + AnotherFakeApi AnotherFakeApi - DefaultApi *DefaultApiService + DefaultApi DefaultApi - FakeApi *FakeApiService + FakeApi FakeApi - FakeClassnameTags123Api *FakeClassnameTags123ApiService + FakeClassnameTags123Api FakeClassnameTags123Api - PetApi *PetApiService + PetApi PetApi - StoreApi *StoreApiService + StoreApi StoreApi - UserApi *UserApiService + UserApi UserApi } type service struct { @@ -179,9 +178,9 @@ func parameterToJson(obj interface{}) (string, error) { // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } @@ -198,15 +197,9 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { } log.Printf("\n%s\n", string(dump)) } - return resp, err } -// ChangeBasePath changes base path to allow switching to mocks -func (c *APIClient) ChangeBasePath(path string) { - c.cfg.BasePath = path -} - // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior func (c *APIClient) GetConfig() *Configuration { @@ -373,7 +366,16 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - + if ctx != nil { + // HTTP Signature Authentication. All request headers must be set (including default headers) + // because the headers may be included in the signature. + if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { + err = SignRequest(ctx, localVarRequest, auth) + if err != nil { + return nil, err + } + } + } return localVarRequest, nil } @@ -385,15 +387,6 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } - if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - _, err = (*f).Seek(0, io.SeekStart) - return - } if xmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err @@ -401,7 +394,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return nil } if jsonCheck.MatchString(contentType) { - if err = json.Unmarshal(b, v); err != nil { + if actualObj, ok := v.(interface{GetActualInstance() interface{}}); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{UnmarshalJSON([]byte) error}); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err!= nil { + return err + } + } else { + errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model return err } return nil diff --git a/samples/openapi3/client/petstore/go/go-petstore/configuration.go b/samples/openapi3/client/petstore/go/go-petstore/configuration.go index 64ae25b4669..ddcea71eaf9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go/go-petstore/configuration.go @@ -10,6 +10,7 @@ package petstore import ( + "context" "fmt" "net/http" "strings" @@ -35,9 +36,23 @@ var ( // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -52,7 +67,6 @@ type APIKey struct { Prefix string } - // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -62,33 +76,35 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - Url string + URL string Description string Variables map[string]ServerVariable } +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + // Configuration stores the configuration of the API client type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers []ServerConfiguration - HTTPClient *http.Client + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client } // NewConfiguration returns a new Configuration object func NewConfiguration() *Configuration { cfg := &Configuration{ - BasePath: "http://petstore.swagger.io:80/v2", - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: []ServerConfiguration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ { - Url: "http://{server}.swagger.io:{port}/v2", + URL: "http://{server}.swagger.io:{port}/v2", Description: "petstore server", Variables: map[string]ServerVariable{ "server": ServerVariable{ @@ -111,7 +127,7 @@ func NewConfiguration() *Configuration { }, }, { - Url: "https://localhost:8080/{version}", + URL: "https://localhost:8080/{version}", Description: "The local server", Variables: map[string]ServerVariable{ "version": ServerVariable{ @@ -125,6 +141,28 @@ func NewConfiguration() *Configuration { }, }, }, + OperationServers: map[string]ServerConfigurations{ + "PetApiService.AddPet": { + { + URL: "http://petstore.swagger.io/v2", + Description: "No description provided", + }, + { + URL: "http://path-server-test.petstore.local/v2", + Description: "No description provided", + }, + }, + "PetApiService.UpdatePet": { + { + URL: "http://petstore.swagger.io/v2", + Description: "No description provided", + }, + { + URL: "http://path-server-test.petstore.local/v2", + Description: "No description provided", + }, + }, + }, } return cfg } @@ -134,13 +172,13 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } -// ServerUrl returns URL based on server settings -func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { - if index < 0 || len(c.Servers) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) } - server := c.Servers[index] - url := server.Url + server := sc[index] + url := server.URL // go through variables and replace placeholders for name, variable := range server.Variables { @@ -161,3 +199,84 @@ func (c *Configuration) ServerUrl(index int, variables map[string]string) (strin } return url, nil } + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md index 9668c3d6427..19719e709f8 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/AdditionalPropertiesClass.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapProperty** | **map[string]string** | | [optional] -**MapOfMapProperty** | [**map[string]map[string]string**](map.md) | | [optional] +**MapProperty** | Pointer to **map[string]string** | | [optional] +**MapOfMapProperty** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] + +## Methods + +### NewAdditionalPropertiesClass + +`func NewAdditionalPropertiesClass() *AdditionalPropertiesClass` + +NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdditionalPropertiesClassWithDefaults + +`func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass` + +NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMapProperty + +`func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string` + +GetMapProperty returns the MapProperty field if non-nil, zero value otherwise. + +### GetMapPropertyOk + +`func (o *AdditionalPropertiesClass) GetMapPropertyOk() (*map[string]string, bool)` + +GetMapPropertyOk returns a tuple with the MapProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapProperty + +`func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string)` + +SetMapProperty sets MapProperty field to given value. + +### HasMapProperty + +`func (o *AdditionalPropertiesClass) HasMapProperty() bool` + +HasMapProperty returns a boolean if a field has been set. + +### GetMapOfMapProperty + +`func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string` + +GetMapOfMapProperty returns the MapOfMapProperty field if non-nil, zero value otherwise. + +### GetMapOfMapPropertyOk + +`func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (*map[string]map[string]string, bool)` + +GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapOfMapProperty + +`func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string)` + +SetMapOfMapProperty sets MapOfMapProperty field to given value. + +### HasMapOfMapProperty + +`func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool` + +HasMapOfMapProperty returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Animal.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Animal.md index 02d23377da6..293f75c5171 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Animal.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Animal.md @@ -5,7 +5,72 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] +**Color** | Pointer to **string** | | [optional] [default to "red"] + +## Methods + +### NewAnimal + +`func NewAnimal(className string, ) *Animal` + +NewAnimal instantiates a new Animal object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAnimalWithDefaults + +`func NewAnimalWithDefaults() *Animal` + +NewAnimalWithDefaults instantiates a new Animal object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClassName + +`func (o *Animal) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Animal) GetClassNameOk() (*string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClassName + +`func (o *Animal) SetClassName(v string)` + +SetClassName sets ClassName field to given value. + + +### GetColor + +`func (o *Animal) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Animal) GetColorOk() (*string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetColor + +`func (o *Animal) SetColor(v string)` + +SetColor sets Color field to given value. + +### HasColor + +`func (o *Animal) HasColor() bool` + +HasColor returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md index fb674f202e1..2c63feecd21 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeApi.md @@ -10,19 +10,51 @@ Method | HTTP request | Description ## Call123TestSpecialTags -> Client Call123TestSpecialTags(ctx, client) +> Client Call123TestSpecialTags(ctx).Client(client).Execute() To test special tags -To test special tags and operation ID starting with number -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + client := openapiclient.Client{Client: "Client_example"} // Client | client model + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.AnotherFakeApi.Call123TestSpecialTags(context.Background(), client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeApi.Call123TestSpecialTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Call123TestSpecialTags`: Client + fmt.Fprintf(os.Stdout, "Response from `AnotherFakeApi.Call123TestSpecialTags`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCall123TestSpecialTagsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**client** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/ApiResponse.md b/samples/openapi3/client/petstore/go/go-petstore/docs/ApiResponse.md index 41d28fb578c..877dacb4293 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/ApiResponse.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int32** | | [optional] -**Type** | **string** | | [optional] -**Message** | **string** | | [optional] +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] + +## Methods + +### NewApiResponse + +`func NewApiResponse() *ApiResponse` + +NewApiResponse instantiates a new ApiResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewApiResponseWithDefaults + +`func NewApiResponseWithDefaults() *ApiResponse` + +NewApiResponseWithDefaults instantiates a new ApiResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *ApiResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *ApiResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *ApiResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *ApiResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetType + +`func (o *ApiResponse) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ApiResponse) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ApiResponse) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ApiResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetMessage + +`func (o *ApiResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ApiResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *ApiResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *ApiResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Apple.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Apple.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Apple.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/Apple.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AppleReq.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AppleReq.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AppleReq.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/AppleReq.md diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md index 555213013b2..cb46da598b1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfArrayOfNumberOnly.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | [**[][]float32**](array.md) | | [optional] +**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] + +## Methods + +### NewArrayOfArrayOfNumberOnly + +`func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly` + +NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayOfArrayOfNumberOnlyWithDefaults + +`func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly` + +NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32` + +GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. + +### GetArrayArrayNumberOk + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool)` + +GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32)` + +SetArrayArrayNumber sets ArrayArrayNumber field to given value. + +### HasArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool` + +HasArrayArrayNumber returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md index 56618756dd7..f0aaaa443b3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayOfNumberOnly.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **[]float32** | | [optional] +**ArrayNumber** | Pointer to **[]float32** | | [optional] + +## Methods + +### NewArrayOfNumberOnly + +`func NewArrayOfNumberOnly() *ArrayOfNumberOnly` + +NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayOfNumberOnlyWithDefaults + +`func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly` + +NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArrayNumber + +`func (o *ArrayOfNumberOnly) GetArrayNumber() []float32` + +GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. + +### GetArrayNumberOk + +`func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool)` + +GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayNumber + +`func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32)` + +SetArrayNumber sets ArrayNumber field to given value. + +### HasArrayNumber + +`func (o *ArrayOfNumberOnly) HasArrayNumber() bool` + +HasArrayNumber returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayTest.md index 0da0bc52d2d..a0f8d7528c3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/ArrayTest.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayOfString** | **[]string** | | [optional] -**ArrayArrayOfInteger** | [**[][]int64**](array.md) | | [optional] -**ArrayArrayOfModel** | [**[][]ReadOnlyFirst**](array.md) | | [optional] +**ArrayOfString** | Pointer to **[]string** | | [optional] +**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] +**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] + +## Methods + +### NewArrayTest + +`func NewArrayTest() *ArrayTest` + +NewArrayTest instantiates a new ArrayTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewArrayTestWithDefaults + +`func NewArrayTestWithDefaults() *ArrayTest` + +NewArrayTestWithDefaults instantiates a new ArrayTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetArrayOfString + +`func (o *ArrayTest) GetArrayOfString() []string` + +GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. + +### GetArrayOfStringOk + +`func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool)` + +GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayOfString + +`func (o *ArrayTest) SetArrayOfString(v []string)` + +SetArrayOfString sets ArrayOfString field to given value. + +### HasArrayOfString + +`func (o *ArrayTest) HasArrayOfString() bool` + +HasArrayOfString returns a boolean if a field has been set. + +### GetArrayArrayOfInteger + +`func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64` + +GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. + +### GetArrayArrayOfIntegerOk + +`func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool)` + +GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayArrayOfInteger + +`func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64)` + +SetArrayArrayOfInteger sets ArrayArrayOfInteger field to given value. + +### HasArrayArrayOfInteger + +`func (o *ArrayTest) HasArrayArrayOfInteger() bool` + +HasArrayArrayOfInteger returns a boolean if a field has been set. + +### GetArrayArrayOfModel + +`func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst` + +GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. + +### GetArrayArrayOfModelOk + +`func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool)` + +GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayArrayOfModel + +`func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst)` + +SetArrayArrayOfModel sets ArrayArrayOfModel field to given value. + +### HasArrayArrayOfModel + +`func (o *ArrayTest) HasArrayArrayOfModel() bool` + +HasArrayArrayOfModel returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Banana.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Banana.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Banana.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/Banana.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/BananaReq.md b/samples/openapi3/client/petstore/go/go-petstore/docs/BananaReq.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/BananaReq.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/BananaReq.md diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Capitalization.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Capitalization.md index 426b8eabd9b..3f37bb13e00 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Capitalization.md @@ -4,12 +4,182 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SmallCamel** | **string** | | [optional] -**CapitalCamel** | **string** | | [optional] -**SmallSnake** | **string** | | [optional] -**CapitalSnake** | **string** | | [optional] -**SCAETHFlowPoints** | **string** | | [optional] -**ATT_NAME** | **string** | Name of the pet | [optional] +**SmallCamel** | Pointer to **string** | | [optional] +**CapitalCamel** | Pointer to **string** | | [optional] +**SmallSnake** | Pointer to **string** | | [optional] +**CapitalSnake** | Pointer to **string** | | [optional] +**SCAETHFlowPoints** | Pointer to **string** | | [optional] +**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] + +## Methods + +### NewCapitalization + +`func NewCapitalization() *Capitalization` + +NewCapitalization instantiates a new Capitalization object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapitalizationWithDefaults + +`func NewCapitalizationWithDefaults() *Capitalization` + +NewCapitalizationWithDefaults instantiates a new Capitalization object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSmallCamel + +`func (o *Capitalization) GetSmallCamel() string` + +GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. + +### GetSmallCamelOk + +`func (o *Capitalization) GetSmallCamelOk() (*string, bool)` + +GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSmallCamel + +`func (o *Capitalization) SetSmallCamel(v string)` + +SetSmallCamel sets SmallCamel field to given value. + +### HasSmallCamel + +`func (o *Capitalization) HasSmallCamel() bool` + +HasSmallCamel returns a boolean if a field has been set. + +### GetCapitalCamel + +`func (o *Capitalization) GetCapitalCamel() string` + +GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. + +### GetCapitalCamelOk + +`func (o *Capitalization) GetCapitalCamelOk() (*string, bool)` + +GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapitalCamel + +`func (o *Capitalization) SetCapitalCamel(v string)` + +SetCapitalCamel sets CapitalCamel field to given value. + +### HasCapitalCamel + +`func (o *Capitalization) HasCapitalCamel() bool` + +HasCapitalCamel returns a boolean if a field has been set. + +### GetSmallSnake + +`func (o *Capitalization) GetSmallSnake() string` + +GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. + +### GetSmallSnakeOk + +`func (o *Capitalization) GetSmallSnakeOk() (*string, bool)` + +GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSmallSnake + +`func (o *Capitalization) SetSmallSnake(v string)` + +SetSmallSnake sets SmallSnake field to given value. + +### HasSmallSnake + +`func (o *Capitalization) HasSmallSnake() bool` + +HasSmallSnake returns a boolean if a field has been set. + +### GetCapitalSnake + +`func (o *Capitalization) GetCapitalSnake() string` + +GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. + +### GetCapitalSnakeOk + +`func (o *Capitalization) GetCapitalSnakeOk() (*string, bool)` + +GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapitalSnake + +`func (o *Capitalization) SetCapitalSnake(v string)` + +SetCapitalSnake sets CapitalSnake field to given value. + +### HasCapitalSnake + +`func (o *Capitalization) HasCapitalSnake() bool` + +HasCapitalSnake returns a boolean if a field has been set. + +### GetSCAETHFlowPoints + +`func (o *Capitalization) GetSCAETHFlowPoints() string` + +GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. + +### GetSCAETHFlowPointsOk + +`func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool)` + +GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSCAETHFlowPoints + +`func (o *Capitalization) SetSCAETHFlowPoints(v string)` + +SetSCAETHFlowPoints sets SCAETHFlowPoints field to given value. + +### HasSCAETHFlowPoints + +`func (o *Capitalization) HasSCAETHFlowPoints() bool` + +HasSCAETHFlowPoints returns a boolean if a field has been set. + +### GetATT_NAME + +`func (o *Capitalization) GetATT_NAME() string` + +GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. + +### GetATT_NAMEOk + +`func (o *Capitalization) GetATT_NAMEOk() (*string, bool)` + +GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetATT_NAME + +`func (o *Capitalization) SetATT_NAME(v string)` + +SetATT_NAME sets ATT_NAME field to given value. + +### HasATT_NAME + +`func (o *Capitalization) HasATT_NAME() bool` + +HasATT_NAME returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Cat.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Cat.md index 1ef1f095e94..9f7f4f783cb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Cat.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Cat.md @@ -4,9 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Declawed** | **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### NewCat + +`func NewCat() *Cat` + +NewCat instantiates a new Cat object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCatWithDefaults + +`func NewCatWithDefaults() *Cat` + +NewCatWithDefaults instantiates a new Cat object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeclawed + +`func (o *Cat) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *Cat) GetDeclawedOk() (*bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeclawed + +`func (o *Cat) SetDeclawed(v bool)` + +SetDeclawed sets Declawed field to given value. + +### HasDeclawed + +`func (o *Cat) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/CatAllOf.md b/samples/openapi3/client/petstore/go/go-petstore/docs/CatAllOf.md index c978cee0417..be0cc6c8519 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/CatAllOf.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/CatAllOf.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool** | | [optional] +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### NewCatAllOf + +`func NewCatAllOf() *CatAllOf` + +NewCatAllOf instantiates a new CatAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCatAllOfWithDefaults + +`func NewCatAllOfWithDefaults() *CatAllOf` + +NewCatAllOfWithDefaults instantiates a new CatAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeclawed + +`func (o *CatAllOf) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *CatAllOf) GetDeclawedOk() (*bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeclawed + +`func (o *CatAllOf) SetDeclawed(v bool)` + +SetDeclawed sets Declawed field to given value. + +### HasDeclawed + +`func (o *CatAllOf) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Category.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Category.md index 01e8344bd06..0d3f6d4ff22 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Category.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Category.md @@ -4,8 +4,73 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Name** | **string** | | [default to default-name] +**Id** | Pointer to **int64** | | [optional] +**Name** | **string** | | [default to "default-name"] + +## Methods + +### NewCategory + +`func NewCategory(name string, ) *Category` + +NewCategory instantiates a new Category object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCategoryWithDefaults + +`func NewCategoryWithDefaults() *Category` + +NewCategoryWithDefaults instantiates a new Category object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Category) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Category) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Category) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Category) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Category) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Category) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Category) SetName(v string)` + +SetName sets Name field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/ClassModel.md b/samples/openapi3/client/petstore/go/go-petstore/docs/ClassModel.md index 0b925cebb1f..51954107bc0 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/ClassModel.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Class** | **string** | | [optional] +**Class** | Pointer to **string** | | [optional] + +## Methods + +### NewClassModel + +`func NewClassModel() *ClassModel` + +NewClassModel instantiates a new ClassModel object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClassModelWithDefaults + +`func NewClassModelWithDefaults() *ClassModel` + +NewClassModelWithDefaults instantiates a new ClassModel object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClass + +`func (o *ClassModel) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *ClassModel) GetClassOk() (*string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClass + +`func (o *ClassModel) SetClass(v string)` + +SetClass sets Class field to given value. + +### HasClass + +`func (o *ClassModel) HasClass() bool` + +HasClass returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Client.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Client.md index 551da852eec..e24e7c05be5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Client.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Client.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Client** | **string** | | [optional] +**Client** | Pointer to **string** | | [optional] + +## Methods + +### NewClient + +`func NewClient() *Client` + +NewClient instantiates a new Client object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClientWithDefaults + +`func NewClientWithDefaults() *Client` + +NewClientWithDefaults instantiates a new Client object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClient + +`func (o *Client) GetClient() string` + +GetClient returns the Client field if non-nil, zero value otherwise. + +### GetClientOk + +`func (o *Client) GetClientOk() (*string, bool)` + +GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClient + +`func (o *Client) SetClient(v string)` + +SetClient sets Client field to given value. + +### HasClient + +`func (o *Client) HasClient() bool` + +HasClient returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md index daf779c8e3e..7a138d8df4a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultApi.md @@ -10,14 +10,45 @@ Method | HTTP request | Description ## FooGet -> InlineResponseDefault FooGet(ctx, ) +> InlineResponseDefault FooGet(ctx).Execute() -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.DefaultApi.FooGet(context.Background(), ).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.FooGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FooGet`: InlineResponseDefault + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.FooGet`: %v\n", resp) +} +``` + +### Path Parameters This endpoint does not need any parameter. +### Other Parameters + +Other parameters are passed through a pointer to a apiFooGetRequest struct via the builder pattern + + ### Return type [**InlineResponseDefault**](inline_response_default.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Dog.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Dog.md index ff35dd5cdca..edf746aaf55 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Dog.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Dog.md @@ -4,9 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | **string** | | -**Color** | **string** | | [optional] [default to red] -**Breed** | **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### NewDog + +`func NewDog() *Dog` + +NewDog instantiates a new Dog object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDogWithDefaults + +`func NewDogWithDefaults() *Dog` + +NewDogWithDefaults instantiates a new Dog object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBreed + +`func (o *Dog) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *Dog) GetBreedOk() (*string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBreed + +`func (o *Dog) SetBreed(v string)` + +SetBreed sets Breed field to given value. + +### HasBreed + +`func (o *Dog) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/DogAllOf.md b/samples/openapi3/client/petstore/go/go-petstore/docs/DogAllOf.md index b87153e9265..3ed4dfa5ea2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/DogAllOf.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/DogAllOf.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Breed** | **string** | | [optional] +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### NewDogAllOf + +`func NewDogAllOf() *DogAllOf` + +NewDogAllOf instantiates a new DogAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDogAllOfWithDefaults + +`func NewDogAllOfWithDefaults() *DogAllOf` + +NewDogAllOfWithDefaults instantiates a new DogAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBreed + +`func (o *DogAllOf) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *DogAllOf) GetBreedOk() (*string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBreed + +`func (o *DogAllOf) SetBreed(v string)` + +SetBreed sets Breed field to given value. + +### HasBreed + +`func (o *DogAllOf) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumArrays.md b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumArrays.md index 3021f881830..28011e23f56 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumArrays.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustSymbol** | **string** | | [optional] -**ArrayEnum** | **[]string** | | [optional] +**JustSymbol** | Pointer to **string** | | [optional] +**ArrayEnum** | Pointer to **[]string** | | [optional] + +## Methods + +### NewEnumArrays + +`func NewEnumArrays() *EnumArrays` + +NewEnumArrays instantiates a new EnumArrays object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnumArraysWithDefaults + +`func NewEnumArraysWithDefaults() *EnumArrays` + +NewEnumArraysWithDefaults instantiates a new EnumArrays object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetJustSymbol + +`func (o *EnumArrays) GetJustSymbol() string` + +GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. + +### GetJustSymbolOk + +`func (o *EnumArrays) GetJustSymbolOk() (*string, bool)` + +GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJustSymbol + +`func (o *EnumArrays) SetJustSymbol(v string)` + +SetJustSymbol sets JustSymbol field to given value. + +### HasJustSymbol + +`func (o *EnumArrays) HasJustSymbol() bool` + +HasJustSymbol returns a boolean if a field has been set. + +### GetArrayEnum + +`func (o *EnumArrays) GetArrayEnum() []string` + +GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. + +### GetArrayEnumOk + +`func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool)` + +GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayEnum + +`func (o *EnumArrays) SetArrayEnum(v []string)` + +SetArrayEnum sets ArrayEnum field to given value. + +### HasArrayEnum + +`func (o *EnumArrays) HasArrayEnum() bool` + +HasArrayEnum returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumClass.md b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumClass.md index c6932388c06..e231f94bd73 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md index 1a9a600a18a..a1761a7cd72 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md @@ -4,14 +4,239 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumString** | **string** | | [optional] +**EnumString** | Pointer to **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int32** | | [optional] -**EnumNumber** | **float64** | | [optional] -**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] -**OuterEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**OuterEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**OuterEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] +**EnumInteger** | Pointer to **int32** | | [optional] +**EnumNumber** | Pointer to **float64** | | [optional] +**OuterEnum** | Pointer to [**NullableOuterEnum**](OuterEnum.md) | | [optional] +**OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to "placed"] +**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OUTERENUMINTEGERDEFAULTVALUE__0] + +## Methods + +### NewEnumTest + +`func NewEnumTest(enumStringRequired string, ) *EnumTest` + +NewEnumTest instantiates a new EnumTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnumTestWithDefaults + +`func NewEnumTestWithDefaults() *EnumTest` + +NewEnumTestWithDefaults instantiates a new EnumTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEnumString + +`func (o *EnumTest) GetEnumString() string` + +GetEnumString returns the EnumString field if non-nil, zero value otherwise. + +### GetEnumStringOk + +`func (o *EnumTest) GetEnumStringOk() (*string, bool)` + +GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumString + +`func (o *EnumTest) SetEnumString(v string)` + +SetEnumString sets EnumString field to given value. + +### HasEnumString + +`func (o *EnumTest) HasEnumString() bool` + +HasEnumString returns a boolean if a field has been set. + +### GetEnumStringRequired + +`func (o *EnumTest) GetEnumStringRequired() string` + +GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. + +### GetEnumStringRequiredOk + +`func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool)` + +GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumStringRequired + +`func (o *EnumTest) SetEnumStringRequired(v string)` + +SetEnumStringRequired sets EnumStringRequired field to given value. + + +### GetEnumInteger + +`func (o *EnumTest) GetEnumInteger() int32` + +GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. + +### GetEnumIntegerOk + +`func (o *EnumTest) GetEnumIntegerOk() (*int32, bool)` + +GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumInteger + +`func (o *EnumTest) SetEnumInteger(v int32)` + +SetEnumInteger sets EnumInteger field to given value. + +### HasEnumInteger + +`func (o *EnumTest) HasEnumInteger() bool` + +HasEnumInteger returns a boolean if a field has been set. + +### GetEnumNumber + +`func (o *EnumTest) GetEnumNumber() float64` + +GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. + +### GetEnumNumberOk + +`func (o *EnumTest) GetEnumNumberOk() (*float64, bool)` + +GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumNumber + +`func (o *EnumTest) SetEnumNumber(v float64)` + +SetEnumNumber sets EnumNumber field to given value. + +### HasEnumNumber + +`func (o *EnumTest) HasEnumNumber() bool` + +HasEnumNumber returns a boolean if a field has been set. + +### GetOuterEnum + +`func (o *EnumTest) GetOuterEnum() OuterEnum` + +GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. + +### GetOuterEnumOk + +`func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool)` + +GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOuterEnum + +`func (o *EnumTest) SetOuterEnum(v OuterEnum)` + +SetOuterEnum sets OuterEnum field to given value. + +### HasOuterEnum + +`func (o *EnumTest) HasOuterEnum() bool` + +HasOuterEnum returns a boolean if a field has been set. + +### SetOuterEnumNil + +`func (o *EnumTest) SetOuterEnumNil(b bool)` + + SetOuterEnumNil sets the value for OuterEnum to be an explicit nil + +### UnsetOuterEnum +`func (o *EnumTest) UnsetOuterEnum()` + +UnsetOuterEnum ensures that no value is present for OuterEnum, not even an explicit nil +### GetOuterEnumInteger + +`func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger` + +GetOuterEnumInteger returns the OuterEnumInteger field if non-nil, zero value otherwise. + +### GetOuterEnumIntegerOk + +`func (o *EnumTest) GetOuterEnumIntegerOk() (*OuterEnumInteger, bool)` + +GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOuterEnumInteger + +`func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger)` + +SetOuterEnumInteger sets OuterEnumInteger field to given value. + +### HasOuterEnumInteger + +`func (o *EnumTest) HasOuterEnumInteger() bool` + +HasOuterEnumInteger returns a boolean if a field has been set. + +### GetOuterEnumDefaultValue + +`func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue` + +GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field if non-nil, zero value otherwise. + +### GetOuterEnumDefaultValueOk + +`func (o *EnumTest) GetOuterEnumDefaultValueOk() (*OuterEnumDefaultValue, bool)` + +GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOuterEnumDefaultValue + +`func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue)` + +SetOuterEnumDefaultValue sets OuterEnumDefaultValue field to given value. + +### HasOuterEnumDefaultValue + +`func (o *EnumTest) HasOuterEnumDefaultValue() bool` + +HasOuterEnumDefaultValue returns a boolean if a field has been set. + +### GetOuterEnumIntegerDefaultValue + +`func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue` + +GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field if non-nil, zero value otherwise. + +### GetOuterEnumIntegerDefaultValueOk + +`func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (*OuterEnumIntegerDefaultValue, bool)` + +GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOuterEnumIntegerDefaultValue + +`func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue)` + +SetOuterEnumIntegerDefaultValue sets OuterEnumIntegerDefaultValue field to given value. + +### HasOuterEnumIntegerDefaultValue + +`func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool` + +HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md index e0f01098a5d..6924101be1e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -5,7 +5,6 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**FakeHealthGet**](FakeApi.md#FakeHealthGet) | **Get** /fake/health | Health check endpoint -[**FakeHttpSignatureTest**](FakeApi.md#FakeHttpSignatureTest) | **Get** /fake/http-signature-test | test http signature authentication [**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | @@ -24,14 +23,45 @@ Method | HTTP request | Description ## FakeHealthGet -> HealthCheckResult FakeHealthGet(ctx, ) +> HealthCheckResult FakeHealthGet(ctx).Execute() Health check endpoint -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeHealthGet(context.Background(), ).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeHealthGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeHealthGet`: HealthCheckResult + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeHealthGet`: %v\n", resp) +} +``` + +### Path Parameters This endpoint does not need any parameter. +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeHealthGetRequest struct via the builder pattern + + ### Return type [**HealthCheckResult**](HealthCheckResult.md) @@ -50,74 +80,53 @@ No authorization required [[Back to README]](../README.md) -## FakeHttpSignatureTest - -> FakeHttpSignatureTest(ctx, pet, optional) - -test http signature authentication - -### Required Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **optional** | ***FakeHttpSignatureTestOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeHttpSignatureTestOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **query1** | **optional.String**| query parameter | - **header1** | **optional.String**| header parameter | - -### Return type - - (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - -- **Content-Type**: application/json, application/xml -- **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - ## FakeOuterBooleanSerialize -> bool FakeOuterBooleanSerialize(ctx, optional) +> bool FakeOuterBooleanSerialize(ctx).Body(body).Execute() -Test serialization of outer boolean types -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := true // bool | Input boolean as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterBooleanSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterBooleanSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterBooleanSerialize`: bool + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterBooleanSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterBooleanSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.Bool**| Input boolean as post body | + **body** | **bool** | Input boolean as post body | ### Return type @@ -139,28 +148,51 @@ No authorization required ## FakeOuterCompositeSerialize -> OuterComposite FakeOuterCompositeSerialize(ctx, optional) +> OuterComposite FakeOuterCompositeSerialize(ctx).OuterComposite(outerComposite).Execute() -Test serialization of object with outer number type -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + outerComposite := openapiclient.OuterComposite{MyNumber: 123, MyString: "MyString_example", MyBoolean: false} // OuterComposite | Input composite as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterCompositeSerialize(context.Background(), ).OuterComposite(outerComposite).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterCompositeSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterCompositeSerialize`: OuterComposite + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterCompositeSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterCompositeSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body | + **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | ### Return type @@ -182,28 +214,51 @@ No authorization required ## FakeOuterNumberSerialize -> float32 FakeOuterNumberSerialize(ctx, optional) +> float32 FakeOuterNumberSerialize(ctx).Body(body).Execute() -Test serialization of outer number types -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := 987 // float32 | Input number as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterNumberSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterNumberSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterNumberSerialize`: float32 + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterNumberSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterNumberSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.Float32**| Input number as post body | + **body** | **float32** | Input number as post body | ### Return type @@ -225,28 +280,51 @@ No authorization required ## FakeOuterStringSerialize -> string FakeOuterStringSerialize(ctx, optional) +> string FakeOuterStringSerialize(ctx).Body(body).Execute() -Test serialization of outer string types -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := "body_example" // string | Input string as post body (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.FakeOuterStringSerialize(context.Background(), ).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.FakeOuterStringSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterStringSerialize`: string + fmt.Fprintf(os.Stdout, "Response from `FakeApi.FakeOuterStringSerialize`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFakeOuterStringSerializeRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **optional.String**| Input string as post body | + **body** | **string** | Input string as post body | ### Return type @@ -268,19 +346,49 @@ No authorization required ## TestBodyWithFileSchema -> TestBodyWithFileSchema(ctx, fileSchemaTestClass) +> TestBodyWithFileSchema(ctx).FileSchemaTestClass(fileSchemaTestClass).Execute() -For this test, the body for this request much reference a schema named `File`. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + fileSchemaTestClass := openapiclient.FileSchemaTestClass{File: openapiclient.File{SourceURI: "SourceURI_example"}, Files: []File{openapiclient.File{SourceURI: "SourceURI_example"})} // FileSchemaTestClass | + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestBodyWithFileSchema(context.Background(), fileSchemaTestClass).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithFileSchema``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestBodyWithFileSchemaRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -302,18 +410,49 @@ No authorization required ## TestBodyWithQueryParams -> TestBodyWithQueryParams(ctx, query, user) +> TestBodyWithQueryParams(ctx).Query(query).User(user).Execute() -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + query := "query_example" // string | + user := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123, ArbitraryObject: 123, ArbitraryNullableObject: 123, ArbitraryTypeValue: 123, ArbitraryNullableTypeValue: 123} // User | + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestBodyWithQueryParams(context.Background(), query, user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestBodyWithQueryParams``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestBodyWithQueryParamsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**query** | **string**| | -**user** | [**User**](User.md)| | + **query** | **string** | | + **user** | [**User**](User.md) | | ### Return type @@ -335,19 +474,51 @@ No authorization required ## TestClientModel -> Client TestClientModel(ctx, client) +> Client TestClientModel(ctx).Client(client).Execute() To test \"client\" model -To test \"client\" model -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + client := openapiclient.Client{Client: "Client_example"} // Client | client model + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestClientModel(context.Background(), client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestClientModel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClientModel`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeApi.TestClientModel`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestClientModelRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**client** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md) | client model | ### Return type @@ -369,45 +540,75 @@ No authorization required ## TestEndpointParameters -> TestEndpointParameters(ctx, number, double, patternWithoutDelimiter, byte_, optional) +> TestEndpointParameters(ctx).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + number := 987 // float32 | None + double := 987 // float64 | None + patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None + byte_ := 987 // string | None + integer := 987 // int32 | None (optional) + int32_ := 987 // int32 | None (optional) + int64_ := 987 // int64 | None (optional) + float := 987 // float32 | None (optional) + string_ := "string__example" // string | None (optional) + binary := 987 // *os.File | None (optional) + date := Get-Date // string | None (optional) + dateTime := Get-Date // time.Time | None (optional) + password := "password_example" // string | None (optional) + callback := "callback_example" // string | None (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestEndpointParameters(context.Background(), number, double, patternWithoutDelimiter, byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEndpointParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestEndpointParametersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**number** | **float32**| None | -**double** | **float64**| None | -**patternWithoutDelimiter** | **string**| None | -**byte_** | **string**| None | - **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - - **integer** | **optional.Int32**| None | - **int32_** | **optional.Int32**| None | - **int64_** | **optional.Int64**| None | - **float** | **optional.Float32**| None | - **string_** | **optional.String**| None | - **binary** | **optional.Interface of *os.File****optional.*os.File**| None | - **date** | **optional.String**| None | - **dateTime** | **optional.Time**| None | - **password** | **optional.String**| None | - **callback** | **optional.String**| None | + **number** | **float32** | None | + **double** | **float64** | None | + **patternWithoutDelimiter** | **string** | None | + **byte_** | **string** | None | + **integer** | **int32** | None | + **int32_** | **int32** | None | + **int64_** | **int64** | None | + **float** | **float32** | None | + **string_** | **string** | None | + **binary** | ***os.File** | None | + **date** | **string** | None | + **dateTime** | **time.Time** | None | + **password** | **string** | None | + **callback** | **string** | None | ### Return type @@ -429,35 +630,63 @@ Name | Type | Description | Notes ## TestEnumParameters -> TestEnumParameters(ctx, optional) +> TestEnumParameters(ctx).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() To test enum parameters -To test enum parameters -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) + enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") + enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) + enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") + enumQueryInteger := 987 // int32 | Query parameter enum test (double) (optional) + enumQueryDouble := 987 // float64 | Query parameter enum test (double) (optional) + enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") + enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestEnumParameters(context.Background(), ).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestEnumParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestEnumParametersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestEnumParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**optional.Interface of []string**](string.md)| Header parameter enum test (string array) | - **enumHeaderString** | **optional.String**| Header parameter enum test (string) | [default to -efg] - **enumQueryStringArray** | [**optional.Interface of []string**](string.md)| Query parameter enum test (string array) | - **enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg] - **enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) | - **enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) | - **enumFormStringArray** | [**optional.Interface of []string**](string.md)| Form parameter enum test (string array) | [default to $] - **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] + **enumHeaderStringArray** | [**[]string**](string.md) | Header parameter enum test (string array) | + **enumHeaderString** | **string** | Header parameter enum test (string) | [default to "-efg"] + **enumQueryStringArray** | [**[]string**](string.md) | Query parameter enum test (string array) | + **enumQueryString** | **string** | Query parameter enum test (string) | [default to "-efg"] + **enumQueryInteger** | **int32** | Query parameter enum test (double) | + **enumQueryDouble** | **float64** | Query parameter enum test (double) | + **enumFormStringArray** | [**[]string**](string.md) | Form parameter enum test (string array) | [default to "$"] + **enumFormString** | **string** | Form parameter enum test (string) | [default to "-efg"] ### Return type @@ -479,36 +708,59 @@ No authorization required ## TestGroupParameters -> TestGroupParameters(ctx, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, optional) +> TestGroupParameters(ctx).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() Fake endpoint to test group parameters (optional) -Fake endpoint to test group parameters (optional) -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + requiredStringGroup := 987 // int32 | Required String in group parameters + requiredBooleanGroup := true // bool | Required Boolean in group parameters + requiredInt64Group := 987 // int64 | Required Integer in group parameters + stringGroup := 987 // int32 | String in group parameters (optional) + booleanGroup := true // bool | Boolean in group parameters (optional) + int64Group := 987 // int64 | Integer in group parameters (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestGroupParameters(context.Background(), requiredStringGroup, requiredBooleanGroup, requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestGroupParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestGroupParametersRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**requiredStringGroup** | **int32**| Required String in group parameters | -**requiredBooleanGroup** | **bool**| Required Boolean in group parameters | -**requiredInt64Group** | **int64**| Required Integer in group parameters | - **optional** | ***TestGroupParametersOpts** | optional parameters | nil if no parameters - -### Optional Parameters - -Optional parameters are passed through a pointer to a TestGroupParametersOpts struct - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **stringGroup** | **optional.Int32**| String in group parameters | - **booleanGroup** | **optional.Bool**| Boolean in group parameters | - **int64Group** | **optional.Int64**| Integer in group parameters | + **requiredStringGroup** | **int32** | Required String in group parameters | + **requiredBooleanGroup** | **bool** | Required Boolean in group parameters | + **requiredInt64Group** | **int64** | Required Integer in group parameters | + **stringGroup** | **int32** | String in group parameters | + **booleanGroup** | **bool** | Boolean in group parameters | + **int64Group** | **int64** | Integer in group parameters | ### Return type @@ -530,17 +782,47 @@ Name | Type | Description | Notes ## TestInlineAdditionalProperties -> TestInlineAdditionalProperties(ctx, requestBody) +> TestInlineAdditionalProperties(ctx).RequestBody(requestBody).Execute() test inline additionalProperties -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + requestBody := map[string]string{ "Key" = "Value" } // map[string]string | request body + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestInlineAdditionalProperties(context.Background(), requestBody).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestInlineAdditionalProperties``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestInlineAdditionalPropertiesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**requestBody** | [**map[string]string**](string.md)| request body | + **requestBody** | [**map[string]string**](string.md) | request body | ### Return type @@ -562,18 +844,49 @@ No authorization required ## TestJsonFormData -> TestJsonFormData(ctx, param, param2) +> TestJsonFormData(ctx).Param(param).Param2(param2).Execute() test json serialization of form data -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + param := "param_example" // string | field1 + param2 := "param2_example" // string | field2 + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestJsonFormData(context.Background(), param, param2).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestJsonFormData``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestJsonFormDataRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**param** | **string**| field1 | -**param2** | **string**| field2 | + **param** | **string** | field1 | + **param2** | **string** | field2 | ### Return type @@ -595,23 +908,57 @@ No authorization required ## TestQueryParameterCollectionFormat -> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) +> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() -To test the collection format in query parameters -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pipe := []string{"Inner_example"} // []string | + ioutil := []string{"Inner_example"} // []string | + http := []string{"Inner_example"} // []string | + url := []string{"Inner_example"} // []string | + context := []string{"Inner_example"} // []string | + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeApi.TestQueryParameterCollectionFormat(context.Background(), pipe, ioutil, http, url, context).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryParameterCollectionFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestQueryParameterCollectionFormatRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pipe** | [**[]string**](string.md)| | -**ioutil** | [**[]string**](string.md)| | -**http** | [**[]string**](string.md)| | -**url** | [**[]string**](string.md)| | -**context** | [**[]string**](string.md)| | + **pipe** | [**[]string**](string.md) | | + **ioutil** | [**[]string**](string.md) | | + **http** | [**[]string**](string.md) | | + **url** | [**[]string**](string.md) | | + **context** | [**[]string**](string.md) | | ### Return type diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md index b070326cc32..1898cc7411b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123Api.md @@ -10,19 +10,51 @@ Method | HTTP request | Description ## TestClassname -> Client TestClassname(ctx, client) +> Client TestClassname(ctx).Client(client).Execute() To test class name in snake case -To test class name in snake case -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + client := openapiclient.Client{Client: "Client_example"} // Client | client model + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.FakeClassnameTags123Api.TestClassname(context.Background(), client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123Api.TestClassname``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClassname`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123Api.TestClassname`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTestClassnameRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**client** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md) | client model | ### Return type diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/File.md b/samples/openapi3/client/petstore/go/go-petstore/docs/File.md index a113b0312cd..91fe90e06f1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/File.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/File.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SourceURI** | **string** | Test capitalization | [optional] +**SourceURI** | Pointer to **string** | Test capitalization | [optional] + +## Methods + +### NewFile + +`func NewFile() *File` + +NewFile instantiates a new File object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFileWithDefaults + +`func NewFileWithDefaults() *File` + +NewFileWithDefaults instantiates a new File object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSourceURI + +`func (o *File) GetSourceURI() string` + +GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. + +### GetSourceURIOk + +`func (o *File) GetSourceURIOk() (*string, bool)` + +GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSourceURI + +`func (o *File) SetSourceURI(v string)` + +SetSourceURI sets SourceURI field to given value. + +### HasSourceURI + +`func (o *File) HasSourceURI() bool` + +HasSourceURI returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md index ae51414dd6c..2db8eb31902 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FileSchemaTestClass.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**File** | [**File**](File.md) | | [optional] -**Files** | [**[]File**](File.md) | | [optional] +**File** | Pointer to [**File**](File.md) | | [optional] +**Files** | Pointer to [**[]File**](File.md) | | [optional] + +## Methods + +### NewFileSchemaTestClass + +`func NewFileSchemaTestClass() *FileSchemaTestClass` + +NewFileSchemaTestClass instantiates a new FileSchemaTestClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFileSchemaTestClassWithDefaults + +`func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass` + +NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFile + +`func (o *FileSchemaTestClass) GetFile() File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *FileSchemaTestClass) GetFileOk() (*File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFile + +`func (o *FileSchemaTestClass) SetFile(v File)` + +SetFile sets File field to given value. + +### HasFile + +`func (o *FileSchemaTestClass) HasFile() bool` + +HasFile returns a boolean if a field has been set. + +### GetFiles + +`func (o *FileSchemaTestClass) GetFiles() []File` + +GetFiles returns the Files field if non-nil, zero value otherwise. + +### GetFilesOk + +`func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool)` + +GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFiles + +`func (o *FileSchemaTestClass) SetFiles(v []File)` + +SetFiles sets Files field to given value. + +### HasFiles + +`func (o *FileSchemaTestClass) HasFiles() bool` + +HasFiles returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Foo.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Foo.md index a5f66bcf525..7f1593a87f4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Foo.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Foo.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [default to bar] +**Bar** | Pointer to **string** | | [optional] [default to "bar"] + +## Methods + +### NewFoo + +`func NewFoo() *Foo` + +NewFoo instantiates a new Foo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFooWithDefaults + +`func NewFooWithDefaults() *Foo` + +NewFooWithDefaults instantiates a new Foo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBar + +`func (o *Foo) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *Foo) GetBarOk() (*string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBar + +`func (o *Foo) SetBar(v string)` + +SetBar sets Bar field to given value. + +### HasBar + +`func (o *Foo) HasBar() bool` + +HasBar returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FormatTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FormatTest.md index 0bc27ab1c4b..f94ef3040f2 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FormatTest.md @@ -4,21 +4,396 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int32** | | [optional] -**Int32** | **int32** | | [optional] -**Int64** | **int64** | | [optional] +**Integer** | Pointer to **int32** | | [optional] +**Int32** | Pointer to **int32** | | [optional] +**Int64** | Pointer to **int64** | | [optional] **Number** | **float32** | | -**Float** | **float32** | | [optional] -**Double** | **float64** | | [optional] -**String** | **string** | | [optional] +**Float** | Pointer to **float32** | | [optional] +**Double** | Pointer to **float64** | | [optional] +**String** | Pointer to **string** | | [optional] **Byte** | **string** | | -**Binary** | [***os.File**](*os.File.md) | | [optional] +**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] **Date** | **string** | | -**DateTime** | [**time.Time**](time.Time.md) | | [optional] -**Uuid** | **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] **Password** | **string** | | -**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] +**PatternWithDigits** | Pointer to **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | Pointer to **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +## Methods + +### NewFormatTest + +`func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest` + +NewFormatTest instantiates a new FormatTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFormatTestWithDefaults + +`func NewFormatTestWithDefaults() *FormatTest` + +NewFormatTestWithDefaults instantiates a new FormatTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInteger + +`func (o *FormatTest) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *FormatTest) GetIntegerOk() (*int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInteger + +`func (o *FormatTest) SetInteger(v int32)` + +SetInteger sets Integer field to given value. + +### HasInteger + +`func (o *FormatTest) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### GetInt32 + +`func (o *FormatTest) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *FormatTest) GetInt32Ok() (*int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInt32 + +`func (o *FormatTest) SetInt32(v int32)` + +SetInt32 sets Int32 field to given value. + +### HasInt32 + +`func (o *FormatTest) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### GetInt64 + +`func (o *FormatTest) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *FormatTest) GetInt64Ok() (*int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInt64 + +`func (o *FormatTest) SetInt64(v int64)` + +SetInt64 sets Int64 field to given value. + +### HasInt64 + +`func (o *FormatTest) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### GetNumber + +`func (o *FormatTest) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *FormatTest) GetNumberOk() (*float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *FormatTest) SetNumber(v float32)` + +SetNumber sets Number field to given value. + + +### GetFloat + +`func (o *FormatTest) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *FormatTest) GetFloatOk() (*float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFloat + +`func (o *FormatTest) SetFloat(v float32)` + +SetFloat sets Float field to given value. + +### HasFloat + +`func (o *FormatTest) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### GetDouble + +`func (o *FormatTest) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *FormatTest) GetDoubleOk() (*float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDouble + +`func (o *FormatTest) SetDouble(v float64)` + +SetDouble sets Double field to given value. + +### HasDouble + +`func (o *FormatTest) HasDouble() bool` + +HasDouble returns a boolean if a field has been set. + +### GetString + +`func (o *FormatTest) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *FormatTest) GetStringOk() (*string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetString + +`func (o *FormatTest) SetString(v string)` + +SetString sets String field to given value. + +### HasString + +`func (o *FormatTest) HasString() bool` + +HasString returns a boolean if a field has been set. + +### GetByte + +`func (o *FormatTest) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *FormatTest) GetByteOk() (*string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetByte + +`func (o *FormatTest) SetByte(v string)` + +SetByte sets Byte field to given value. + + +### GetBinary + +`func (o *FormatTest) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *FormatTest) GetBinaryOk() (**os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBinary + +`func (o *FormatTest) SetBinary(v *os.File)` + +SetBinary sets Binary field to given value. + +### HasBinary + +`func (o *FormatTest) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### GetDate + +`func (o *FormatTest) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *FormatTest) GetDateOk() (*string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDate + +`func (o *FormatTest) SetDate(v string)` + +SetDate sets Date field to given value. + + +### GetDateTime + +`func (o *FormatTest) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *FormatTest) GetDateTimeOk() (*time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateTime + +`func (o *FormatTest) SetDateTime(v time.Time)` + +SetDateTime sets DateTime field to given value. + +### HasDateTime + +`func (o *FormatTest) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### GetUuid + +`func (o *FormatTest) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *FormatTest) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *FormatTest) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *FormatTest) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetPassword + +`func (o *FormatTest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *FormatTest) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *FormatTest) SetPassword(v string)` + +SetPassword sets Password field to given value. + + +### GetPatternWithDigits + +`func (o *FormatTest) GetPatternWithDigits() string` + +GetPatternWithDigits returns the PatternWithDigits field if non-nil, zero value otherwise. + +### GetPatternWithDigitsOk + +`func (o *FormatTest) GetPatternWithDigitsOk() (*string, bool)` + +GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPatternWithDigits + +`func (o *FormatTest) SetPatternWithDigits(v string)` + +SetPatternWithDigits sets PatternWithDigits field to given value. + +### HasPatternWithDigits + +`func (o *FormatTest) HasPatternWithDigits() bool` + +HasPatternWithDigits returns a boolean if a field has been set. + +### GetPatternWithDigitsAndDelimiter + +`func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string` + +GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field if non-nil, zero value otherwise. + +### GetPatternWithDigitsAndDelimiterOk + +`func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (*string, bool)` + +GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPatternWithDigitsAndDelimiter + +`func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string)` + +SetPatternWithDigitsAndDelimiter sets PatternWithDigitsAndDelimiter field to given value. + +### HasPatternWithDigitsAndDelimiter + +`func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool` + +HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Fruit.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Fruit.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Fruit.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/Fruit.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FruitReq.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FruitReq.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FruitReq.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/FruitReq.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/GmFruit.md b/samples/openapi3/client/petstore/go/go-petstore/docs/GmFruit.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/GmFruit.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/GmFruit.md diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md index 3b6ff48ab9f..7f54d772840 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/HasOnlyReadOnly.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [readonly] -**Foo** | **string** | | [optional] [readonly] +**Bar** | Pointer to **string** | | [optional] [readonly] +**Foo** | Pointer to **string** | | [optional] [readonly] + +## Methods + +### NewHasOnlyReadOnly + +`func NewHasOnlyReadOnly() *HasOnlyReadOnly` + +NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHasOnlyReadOnlyWithDefaults + +`func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly` + +NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBar + +`func (o *HasOnlyReadOnly) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *HasOnlyReadOnly) GetBarOk() (*string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBar + +`func (o *HasOnlyReadOnly) SetBar(v string)` + +SetBar sets Bar field to given value. + +### HasBar + +`func (o *HasOnlyReadOnly) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### GetFoo + +`func (o *HasOnlyReadOnly) GetFoo() string` + +GetFoo returns the Foo field if non-nil, zero value otherwise. + +### GetFooOk + +`func (o *HasOnlyReadOnly) GetFooOk() (*string, bool)` + +GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFoo + +`func (o *HasOnlyReadOnly) SetFoo(v string)` + +SetFoo sets Foo field to given value. + +### HasFoo + +`func (o *HasOnlyReadOnly) HasFoo() bool` + +HasFoo returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/go/go-petstore/docs/HealthCheckResult.md index 5c8c5861027..7f057faf717 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/HealthCheckResult.md @@ -4,7 +4,62 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**NullableMessage** | Pointer to **string** | | [optional] +**NullableMessage** | Pointer to **NullableString** | | [optional] + +## Methods + +### NewHealthCheckResult + +`func NewHealthCheckResult() *HealthCheckResult` + +NewHealthCheckResult instantiates a new HealthCheckResult object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHealthCheckResultWithDefaults + +`func NewHealthCheckResultWithDefaults() *HealthCheckResult` + +NewHealthCheckResultWithDefaults instantiates a new HealthCheckResult object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNullableMessage + +`func (o *HealthCheckResult) GetNullableMessage() string` + +GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise. + +### GetNullableMessageOk + +`func (o *HealthCheckResult) GetNullableMessageOk() (*string, bool)` + +GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNullableMessage + +`func (o *HealthCheckResult) SetNullableMessage(v string)` + +SetNullableMessage sets NullableMessage field to given value. + +### HasNullableMessage + +`func (o *HealthCheckResult) HasNullableMessage() bool` + +HasNullableMessage returns a boolean if a field has been set. + +### SetNullableMessageNil + +`func (o *HealthCheckResult) SetNullableMessageNil(b bool)` + + SetNullableMessageNil sets the value for NullableMessage to be an explicit nil + +### UnsetNullableMessage +`func (o *HealthCheckResult) UnsetNullableMessage()` + +UnsetNullableMessage ensures that no value is present for NullableMessage, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject.md index 3065b5f2433..4b0ad91e390 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Updated name of the pet | [optional] -**Status** | **string** | Updated status of the pet | [optional] +**Name** | Pointer to **string** | Updated name of the pet | [optional] +**Status** | Pointer to **string** | Updated status of the pet | [optional] + +## Methods + +### NewInlineObject + +`func NewInlineObject() *InlineObject` + +NewInlineObject instantiates a new InlineObject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineObjectWithDefaults + +`func NewInlineObjectWithDefaults() *InlineObject` + +NewInlineObjectWithDefaults instantiates a new InlineObject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *InlineObject) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InlineObject) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InlineObject) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *InlineObject) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetStatus + +`func (o *InlineObject) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InlineObject) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InlineObject) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InlineObject) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject1.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject1.md index 0e4f031ae78..ab137f8670f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject1.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject1.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] -**File** | [***os.File**](*os.File.md) | file to upload | [optional] +**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] +**File** | Pointer to [***os.File**](*os.File.md) | file to upload | [optional] + +## Methods + +### NewInlineObject1 + +`func NewInlineObject1() *InlineObject1` + +NewInlineObject1 instantiates a new InlineObject1 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineObject1WithDefaults + +`func NewInlineObject1WithDefaults() *InlineObject1` + +NewInlineObject1WithDefaults instantiates a new InlineObject1 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAdditionalMetadata + +`func (o *InlineObject1) GetAdditionalMetadata() string` + +GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. + +### GetAdditionalMetadataOk + +`func (o *InlineObject1) GetAdditionalMetadataOk() (*string, bool)` + +GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdditionalMetadata + +`func (o *InlineObject1) SetAdditionalMetadata(v string)` + +SetAdditionalMetadata sets AdditionalMetadata field to given value. + +### HasAdditionalMetadata + +`func (o *InlineObject1) HasAdditionalMetadata() bool` + +HasAdditionalMetadata returns a boolean if a field has been set. + +### GetFile + +`func (o *InlineObject1) GetFile() *os.File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *InlineObject1) GetFileOk() (**os.File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFile + +`func (o *InlineObject1) SetFile(v *os.File)` + +SetFile sets File field to given value. + +### HasFile + +`func (o *InlineObject1) HasFile() bool` + +HasFile returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject2.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject2.md index c7f889b63b5..0b6a0dbf0a4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject2.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EnumFormStringArray** | **[]string** | Form parameter enum test (string array) | [optional] -**EnumFormString** | **string** | Form parameter enum test (string) | [optional] [default to ENUM_FORM_STRING_EFG] +**EnumFormStringArray** | Pointer to **[]string** | Form parameter enum test (string array) | [optional] +**EnumFormString** | Pointer to **string** | Form parameter enum test (string) | [optional] [default to "-efg"] + +## Methods + +### NewInlineObject2 + +`func NewInlineObject2() *InlineObject2` + +NewInlineObject2 instantiates a new InlineObject2 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineObject2WithDefaults + +`func NewInlineObject2WithDefaults() *InlineObject2` + +NewInlineObject2WithDefaults instantiates a new InlineObject2 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEnumFormStringArray + +`func (o *InlineObject2) GetEnumFormStringArray() []string` + +GetEnumFormStringArray returns the EnumFormStringArray field if non-nil, zero value otherwise. + +### GetEnumFormStringArrayOk + +`func (o *InlineObject2) GetEnumFormStringArrayOk() (*[]string, bool)` + +GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumFormStringArray + +`func (o *InlineObject2) SetEnumFormStringArray(v []string)` + +SetEnumFormStringArray sets EnumFormStringArray field to given value. + +### HasEnumFormStringArray + +`func (o *InlineObject2) HasEnumFormStringArray() bool` + +HasEnumFormStringArray returns a boolean if a field has been set. + +### GetEnumFormString + +`func (o *InlineObject2) GetEnumFormString() string` + +GetEnumFormString returns the EnumFormString field if non-nil, zero value otherwise. + +### GetEnumFormStringOk + +`func (o *InlineObject2) GetEnumFormStringOk() (*string, bool)` + +GetEnumFormStringOk returns a tuple with the EnumFormString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnumFormString + +`func (o *InlineObject2) SetEnumFormString(v string)` + +SetEnumFormString sets EnumFormString field to given value. + +### HasEnumFormString + +`func (o *InlineObject2) HasEnumFormString() bool` + +HasEnumFormString returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject3.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject3.md index 8c5249fca4d..e0c1472b2f7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject3.md @@ -4,20 +4,370 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int32** | None | [optional] -**Int32** | **int32** | None | [optional] -**Int64** | **int64** | None | [optional] +**Integer** | Pointer to **int32** | None | [optional] +**Int32** | Pointer to **int32** | None | [optional] +**Int64** | Pointer to **int64** | None | [optional] **Number** | **float32** | None | -**Float** | **float32** | None | [optional] +**Float** | Pointer to **float32** | None | [optional] **Double** | **float64** | None | -**String** | **string** | None | [optional] +**String** | Pointer to **string** | None | [optional] **PatternWithoutDelimiter** | **string** | None | **Byte** | **string** | None | -**Binary** | [***os.File**](*os.File.md) | None | [optional] -**Date** | **string** | None | [optional] -**DateTime** | [**time.Time**](time.Time.md) | None | [optional] -**Password** | **string** | None | [optional] -**Callback** | **string** | None | [optional] +**Binary** | Pointer to [***os.File**](*os.File.md) | None | [optional] +**Date** | Pointer to **string** | None | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | None | [optional] +**Password** | Pointer to **string** | None | [optional] +**Callback** | Pointer to **string** | None | [optional] + +## Methods + +### NewInlineObject3 + +`func NewInlineObject3(number float32, double float64, patternWithoutDelimiter string, byte_ string, ) *InlineObject3` + +NewInlineObject3 instantiates a new InlineObject3 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineObject3WithDefaults + +`func NewInlineObject3WithDefaults() *InlineObject3` + +NewInlineObject3WithDefaults instantiates a new InlineObject3 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInteger + +`func (o *InlineObject3) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *InlineObject3) GetIntegerOk() (*int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInteger + +`func (o *InlineObject3) SetInteger(v int32)` + +SetInteger sets Integer field to given value. + +### HasInteger + +`func (o *InlineObject3) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### GetInt32 + +`func (o *InlineObject3) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *InlineObject3) GetInt32Ok() (*int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInt32 + +`func (o *InlineObject3) SetInt32(v int32)` + +SetInt32 sets Int32 field to given value. + +### HasInt32 + +`func (o *InlineObject3) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### GetInt64 + +`func (o *InlineObject3) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *InlineObject3) GetInt64Ok() (*int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInt64 + +`func (o *InlineObject3) SetInt64(v int64)` + +SetInt64 sets Int64 field to given value. + +### HasInt64 + +`func (o *InlineObject3) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### GetNumber + +`func (o *InlineObject3) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *InlineObject3) GetNumberOk() (*float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *InlineObject3) SetNumber(v float32)` + +SetNumber sets Number field to given value. + + +### GetFloat + +`func (o *InlineObject3) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *InlineObject3) GetFloatOk() (*float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFloat + +`func (o *InlineObject3) SetFloat(v float32)` + +SetFloat sets Float field to given value. + +### HasFloat + +`func (o *InlineObject3) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### GetDouble + +`func (o *InlineObject3) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *InlineObject3) GetDoubleOk() (*float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDouble + +`func (o *InlineObject3) SetDouble(v float64)` + +SetDouble sets Double field to given value. + + +### GetString + +`func (o *InlineObject3) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *InlineObject3) GetStringOk() (*string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetString + +`func (o *InlineObject3) SetString(v string)` + +SetString sets String field to given value. + +### HasString + +`func (o *InlineObject3) HasString() bool` + +HasString returns a boolean if a field has been set. + +### GetPatternWithoutDelimiter + +`func (o *InlineObject3) GetPatternWithoutDelimiter() string` + +GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field if non-nil, zero value otherwise. + +### GetPatternWithoutDelimiterOk + +`func (o *InlineObject3) GetPatternWithoutDelimiterOk() (*string, bool)` + +GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPatternWithoutDelimiter + +`func (o *InlineObject3) SetPatternWithoutDelimiter(v string)` + +SetPatternWithoutDelimiter sets PatternWithoutDelimiter field to given value. + + +### GetByte + +`func (o *InlineObject3) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *InlineObject3) GetByteOk() (*string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetByte + +`func (o *InlineObject3) SetByte(v string)` + +SetByte sets Byte field to given value. + + +### GetBinary + +`func (o *InlineObject3) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *InlineObject3) GetBinaryOk() (**os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBinary + +`func (o *InlineObject3) SetBinary(v *os.File)` + +SetBinary sets Binary field to given value. + +### HasBinary + +`func (o *InlineObject3) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### GetDate + +`func (o *InlineObject3) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *InlineObject3) GetDateOk() (*string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDate + +`func (o *InlineObject3) SetDate(v string)` + +SetDate sets Date field to given value. + +### HasDate + +`func (o *InlineObject3) HasDate() bool` + +HasDate returns a boolean if a field has been set. + +### GetDateTime + +`func (o *InlineObject3) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *InlineObject3) GetDateTimeOk() (*time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateTime + +`func (o *InlineObject3) SetDateTime(v time.Time)` + +SetDateTime sets DateTime field to given value. + +### HasDateTime + +`func (o *InlineObject3) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### GetPassword + +`func (o *InlineObject3) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *InlineObject3) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *InlineObject3) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *InlineObject3) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetCallback + +`func (o *InlineObject3) GetCallback() string` + +GetCallback returns the Callback field if non-nil, zero value otherwise. + +### GetCallbackOk + +`func (o *InlineObject3) GetCallbackOk() (*string, bool)` + +GetCallbackOk returns a tuple with the Callback field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCallback + +`func (o *InlineObject3) SetCallback(v string)` + +SetCallback sets Callback field to given value. + +### HasCallback + +`func (o *InlineObject3) HasCallback() bool` + +HasCallback returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject4.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject4.md index 988e4881314..e716f8dd913 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject4.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject4.md @@ -7,6 +7,66 @@ Name | Type | Description | Notes **Param** | **string** | field1 | **Param2** | **string** | field2 | +## Methods + +### NewInlineObject4 + +`func NewInlineObject4(param string, param2 string, ) *InlineObject4` + +NewInlineObject4 instantiates a new InlineObject4 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineObject4WithDefaults + +`func NewInlineObject4WithDefaults() *InlineObject4` + +NewInlineObject4WithDefaults instantiates a new InlineObject4 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetParam + +`func (o *InlineObject4) GetParam() string` + +GetParam returns the Param field if non-nil, zero value otherwise. + +### GetParamOk + +`func (o *InlineObject4) GetParamOk() (*string, bool)` + +GetParamOk returns a tuple with the Param field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParam + +`func (o *InlineObject4) SetParam(v string)` + +SetParam sets Param field to given value. + + +### GetParam2 + +`func (o *InlineObject4) GetParam2() string` + +GetParam2 returns the Param2 field if non-nil, zero value otherwise. + +### GetParam2Ok + +`func (o *InlineObject4) GetParam2Ok() (*string, bool)` + +GetParam2Ok returns a tuple with the Param2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParam2 + +`func (o *InlineObject4) SetParam2(v string)` + +SetParam2 sets Param2 field to given value. + + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject5.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject5.md index bcd135b5a97..a6a4f9367b5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineObject5.md @@ -4,9 +4,74 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**AdditionalMetadata** | **string** | Additional data to pass to server | [optional] +**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] **RequiredFile** | [***os.File**](*os.File.md) | file to upload | +## Methods + +### NewInlineObject5 + +`func NewInlineObject5(requiredFile *os.File, ) *InlineObject5` + +NewInlineObject5 instantiates a new InlineObject5 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineObject5WithDefaults + +`func NewInlineObject5WithDefaults() *InlineObject5` + +NewInlineObject5WithDefaults instantiates a new InlineObject5 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAdditionalMetadata + +`func (o *InlineObject5) GetAdditionalMetadata() string` + +GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. + +### GetAdditionalMetadataOk + +`func (o *InlineObject5) GetAdditionalMetadataOk() (*string, bool)` + +GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdditionalMetadata + +`func (o *InlineObject5) SetAdditionalMetadata(v string)` + +SetAdditionalMetadata sets AdditionalMetadata field to given value. + +### HasAdditionalMetadata + +`func (o *InlineObject5) HasAdditionalMetadata() bool` + +HasAdditionalMetadata returns a boolean if a field has been set. + +### GetRequiredFile + +`func (o *InlineObject5) GetRequiredFile() *os.File` + +GetRequiredFile returns the RequiredFile field if non-nil, zero value otherwise. + +### GetRequiredFileOk + +`func (o *InlineObject5) GetRequiredFileOk() (**os.File, bool)` + +GetRequiredFileOk returns a tuple with the RequiredFile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequiredFile + +`func (o *InlineObject5) SetRequiredFile(v *os.File)` + +SetRequiredFile sets RequiredFile field to given value. + + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineResponseDefault.md index 071a391fbf3..0736bb1fb42 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/InlineResponseDefault.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/InlineResponseDefault.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**String** | [**Foo**](Foo.md) | | [optional] +**String** | Pointer to [**Foo**](Foo.md) | | [optional] + +## Methods + +### NewInlineResponseDefault + +`func NewInlineResponseDefault() *InlineResponseDefault` + +NewInlineResponseDefault instantiates a new InlineResponseDefault object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponseDefaultWithDefaults + +`func NewInlineResponseDefaultWithDefaults() *InlineResponseDefault` + +NewInlineResponseDefaultWithDefaults instantiates a new InlineResponseDefault object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetString + +`func (o *InlineResponseDefault) GetString() Foo` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *InlineResponseDefault) GetStringOk() (*Foo, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetString + +`func (o *InlineResponseDefault) SetString(v Foo)` + +SetString sets String field to given value. + +### HasString + +`func (o *InlineResponseDefault) HasString() bool` + +HasString returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/List.md b/samples/openapi3/client/petstore/go/go-petstore/docs/List.md index bba2e529906..271c8236a8b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/List.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/List.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Var123List** | **string** | | [optional] +**Var123List** | Pointer to **string** | | [optional] + +## Methods + +### NewList + +`func NewList() *List` + +NewList instantiates a new List object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListWithDefaults + +`func NewListWithDefaults() *List` + +NewListWithDefaults instantiates a new List object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVar123List + +`func (o *List) GetVar123List() string` + +GetVar123List returns the Var123List field if non-nil, zero value otherwise. + +### GetVar123ListOk + +`func (o *List) GetVar123ListOk() (*string, bool)` + +GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVar123List + +`func (o *List) SetVar123List(v string)` + +SetVar123List sets Var123List field to given value. + +### HasVar123List + +`func (o *List) HasVar123List() bool` + +HasVar123List returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Mammal.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Mammal.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Mammal.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/Mammal.md diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/MapTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/MapTest.md index 6645e044658..6b35263c4e3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/MapTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/MapTest.md @@ -4,10 +4,130 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] -**MapOfEnumString** | **map[string]string** | | [optional] -**DirectMap** | **map[string]bool** | | [optional] -**IndirectMap** | **map[string]bool** | | [optional] +**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapOfEnumString** | Pointer to **map[string]string** | | [optional] +**DirectMap** | Pointer to **map[string]bool** | | [optional] +**IndirectMap** | Pointer to **map[string]bool** | | [optional] + +## Methods + +### NewMapTest + +`func NewMapTest() *MapTest` + +NewMapTest instantiates a new MapTest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMapTestWithDefaults + +`func NewMapTestWithDefaults() *MapTest` + +NewMapTestWithDefaults instantiates a new MapTest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMapMapOfString + +`func (o *MapTest) GetMapMapOfString() map[string]map[string]string` + +GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. + +### GetMapMapOfStringOk + +`func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool)` + +GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapMapOfString + +`func (o *MapTest) SetMapMapOfString(v map[string]map[string]string)` + +SetMapMapOfString sets MapMapOfString field to given value. + +### HasMapMapOfString + +`func (o *MapTest) HasMapMapOfString() bool` + +HasMapMapOfString returns a boolean if a field has been set. + +### GetMapOfEnumString + +`func (o *MapTest) GetMapOfEnumString() map[string]string` + +GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. + +### GetMapOfEnumStringOk + +`func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool)` + +GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapOfEnumString + +`func (o *MapTest) SetMapOfEnumString(v map[string]string)` + +SetMapOfEnumString sets MapOfEnumString field to given value. + +### HasMapOfEnumString + +`func (o *MapTest) HasMapOfEnumString() bool` + +HasMapOfEnumString returns a boolean if a field has been set. + +### GetDirectMap + +`func (o *MapTest) GetDirectMap() map[string]bool` + +GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. + +### GetDirectMapOk + +`func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool)` + +GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDirectMap + +`func (o *MapTest) SetDirectMap(v map[string]bool)` + +SetDirectMap sets DirectMap field to given value. + +### HasDirectMap + +`func (o *MapTest) HasDirectMap() bool` + +HasDirectMap returns a boolean if a field has been set. + +### GetIndirectMap + +`func (o *MapTest) GetIndirectMap() map[string]bool` + +GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. + +### GetIndirectMapOk + +`func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool)` + +GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndirectMap + +`func (o *MapTest) SetIndirectMap(v map[string]bool)` + +SetIndirectMap sets IndirectMap field to given value. + +### HasIndirectMap + +`func (o *MapTest) HasIndirectMap() bool` + +HasIndirectMap returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index a2ce1068b27..f726ffe63e1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **string** | | [optional] -**DateTime** | [**time.Time**](time.Time.md) | | [optional] -**Map** | [**map[string]Animal**](Animal.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] + +## Methods + +### NewMixedPropertiesAndAdditionalPropertiesClass + +`func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass` + +NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults + +`func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass` + +NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time)` + +SetDateTime sets DateTime field to given value. + +### HasDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### GetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal` + +GetMap returns the Map field if non-nil, zero value otherwise. + +### GetMapOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool)` + +GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal)` + +SetMap sets Map field to given value. + +### HasMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool` + +HasMap returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Model200Response.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Model200Response.md index 27b93bd1549..4e0d89fe88f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Model200Response.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int32** | | [optional] -**Class** | **string** | | [optional] +**Name** | Pointer to **int32** | | [optional] +**Class** | Pointer to **string** | | [optional] + +## Methods + +### NewModel200Response + +`func NewModel200Response() *Model200Response` + +NewModel200Response instantiates a new Model200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewModel200ResponseWithDefaults + +`func NewModel200ResponseWithDefaults() *Model200Response` + +NewModel200ResponseWithDefaults instantiates a new Model200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Model200Response) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Model200Response) GetNameOk() (*int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Model200Response) SetName(v int32)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Model200Response) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetClass + +`func (o *Model200Response) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *Model200Response) GetClassOk() (*string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClass + +`func (o *Model200Response) SetClass(v string)` + +SetClass sets Class field to given value. + +### HasClass + +`func (o *Model200Response) HasClass() bool` + +HasClass returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Name.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Name.md index 3e91109a16a..18cf04789d6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Name.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Name.md @@ -5,9 +5,124 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **int32** | | -**SnakeCase** | **int32** | | [optional] [readonly] -**Property** | **string** | | [optional] -**Var123Number** | **int32** | | [optional] [readonly] +**SnakeCase** | Pointer to **int32** | | [optional] [readonly] +**Property** | Pointer to **string** | | [optional] +**Var123Number** | Pointer to **int32** | | [optional] [readonly] + +## Methods + +### NewName + +`func NewName(name int32, ) *Name` + +NewName instantiates a new Name object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNameWithDefaults + +`func NewNameWithDefaults() *Name` + +NewNameWithDefaults instantiates a new Name object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Name) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Name) GetNameOk() (*int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Name) SetName(v int32)` + +SetName sets Name field to given value. + + +### GetSnakeCase + +`func (o *Name) GetSnakeCase() int32` + +GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. + +### GetSnakeCaseOk + +`func (o *Name) GetSnakeCaseOk() (*int32, bool)` + +GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSnakeCase + +`func (o *Name) SetSnakeCase(v int32)` + +SetSnakeCase sets SnakeCase field to given value. + +### HasSnakeCase + +`func (o *Name) HasSnakeCase() bool` + +HasSnakeCase returns a boolean if a field has been set. + +### GetProperty + +`func (o *Name) GetProperty() string` + +GetProperty returns the Property field if non-nil, zero value otherwise. + +### GetPropertyOk + +`func (o *Name) GetPropertyOk() (*string, bool)` + +GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperty + +`func (o *Name) SetProperty(v string)` + +SetProperty sets Property field to given value. + +### HasProperty + +`func (o *Name) HasProperty() bool` + +HasProperty returns a boolean if a field has been set. + +### GetVar123Number + +`func (o *Name) GetVar123Number() int32` + +GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. + +### GetVar123NumberOk + +`func (o *Name) GetVar123NumberOk() (*int32, bool)` + +GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVar123Number + +`func (o *Name) SetVar123Number(v int32)` + +SetVar123Number sets Var123Number field to given value. + +### HasVar123Number + +`func (o *Name) HasVar123Number() bool` + +HasVar123Number returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md b/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md index a5758169c98..e24e6447515 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/NullableClass.md @@ -4,18 +4,438 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**IntegerProp** | Pointer to **int32** | | [optional] -**NumberProp** | Pointer to **float32** | | [optional] -**BooleanProp** | Pointer to **bool** | | [optional] -**StringProp** | Pointer to **string** | | [optional] -**DateProp** | Pointer to **string** | | [optional] -**DatetimeProp** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**IntegerProp** | Pointer to **NullableInt32** | | [optional] +**NumberProp** | Pointer to **NullableFloat32** | | [optional] +**BooleanProp** | Pointer to **NullableBool** | | [optional] +**StringProp** | Pointer to **NullableString** | | [optional] +**DateProp** | Pointer to **NullableString** | | [optional] +**DatetimeProp** | Pointer to [**NullableTime**](time.Time.md) | | [optional] **ArrayNullableProp** | Pointer to **[]map[string]interface{}** | | [optional] **ArrayAndItemsNullableProp** | Pointer to **[]map[string]interface{}** | | [optional] -**ArrayItemsNullable** | **[]map[string]interface{}** | | [optional] +**ArrayItemsNullable** | Pointer to **[]map[string]interface{}** | | [optional] **ObjectNullableProp** | Pointer to **map[string]map[string]interface{}** | | [optional] **ObjectAndItemsNullableProp** | Pointer to **map[string]map[string]interface{}** | | [optional] -**ObjectItemsNullable** | **map[string]map[string]interface{}** | | [optional] +**ObjectItemsNullable** | Pointer to **map[string]map[string]interface{}** | | [optional] + +## Methods + +### NewNullableClass + +`func NewNullableClass() *NullableClass` + +NewNullableClass instantiates a new NullableClass object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNullableClassWithDefaults + +`func NewNullableClassWithDefaults() *NullableClass` + +NewNullableClassWithDefaults instantiates a new NullableClass object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIntegerProp + +`func (o *NullableClass) GetIntegerProp() int32` + +GetIntegerProp returns the IntegerProp field if non-nil, zero value otherwise. + +### GetIntegerPropOk + +`func (o *NullableClass) GetIntegerPropOk() (*int32, bool)` + +GetIntegerPropOk returns a tuple with the IntegerProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIntegerProp + +`func (o *NullableClass) SetIntegerProp(v int32)` + +SetIntegerProp sets IntegerProp field to given value. + +### HasIntegerProp + +`func (o *NullableClass) HasIntegerProp() bool` + +HasIntegerProp returns a boolean if a field has been set. + +### SetIntegerPropNil + +`func (o *NullableClass) SetIntegerPropNil(b bool)` + + SetIntegerPropNil sets the value for IntegerProp to be an explicit nil + +### UnsetIntegerProp +`func (o *NullableClass) UnsetIntegerProp()` + +UnsetIntegerProp ensures that no value is present for IntegerProp, not even an explicit nil +### GetNumberProp + +`func (o *NullableClass) GetNumberProp() float32` + +GetNumberProp returns the NumberProp field if non-nil, zero value otherwise. + +### GetNumberPropOk + +`func (o *NullableClass) GetNumberPropOk() (*float32, bool)` + +GetNumberPropOk returns a tuple with the NumberProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumberProp + +`func (o *NullableClass) SetNumberProp(v float32)` + +SetNumberProp sets NumberProp field to given value. + +### HasNumberProp + +`func (o *NullableClass) HasNumberProp() bool` + +HasNumberProp returns a boolean if a field has been set. + +### SetNumberPropNil + +`func (o *NullableClass) SetNumberPropNil(b bool)` + + SetNumberPropNil sets the value for NumberProp to be an explicit nil + +### UnsetNumberProp +`func (o *NullableClass) UnsetNumberProp()` + +UnsetNumberProp ensures that no value is present for NumberProp, not even an explicit nil +### GetBooleanProp + +`func (o *NullableClass) GetBooleanProp() bool` + +GetBooleanProp returns the BooleanProp field if non-nil, zero value otherwise. + +### GetBooleanPropOk + +`func (o *NullableClass) GetBooleanPropOk() (*bool, bool)` + +GetBooleanPropOk returns a tuple with the BooleanProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBooleanProp + +`func (o *NullableClass) SetBooleanProp(v bool)` + +SetBooleanProp sets BooleanProp field to given value. + +### HasBooleanProp + +`func (o *NullableClass) HasBooleanProp() bool` + +HasBooleanProp returns a boolean if a field has been set. + +### SetBooleanPropNil + +`func (o *NullableClass) SetBooleanPropNil(b bool)` + + SetBooleanPropNil sets the value for BooleanProp to be an explicit nil + +### UnsetBooleanProp +`func (o *NullableClass) UnsetBooleanProp()` + +UnsetBooleanProp ensures that no value is present for BooleanProp, not even an explicit nil +### GetStringProp + +`func (o *NullableClass) GetStringProp() string` + +GetStringProp returns the StringProp field if non-nil, zero value otherwise. + +### GetStringPropOk + +`func (o *NullableClass) GetStringPropOk() (*string, bool)` + +GetStringPropOk returns a tuple with the StringProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStringProp + +`func (o *NullableClass) SetStringProp(v string)` + +SetStringProp sets StringProp field to given value. + +### HasStringProp + +`func (o *NullableClass) HasStringProp() bool` + +HasStringProp returns a boolean if a field has been set. + +### SetStringPropNil + +`func (o *NullableClass) SetStringPropNil(b bool)` + + SetStringPropNil sets the value for StringProp to be an explicit nil + +### UnsetStringProp +`func (o *NullableClass) UnsetStringProp()` + +UnsetStringProp ensures that no value is present for StringProp, not even an explicit nil +### GetDateProp + +`func (o *NullableClass) GetDateProp() string` + +GetDateProp returns the DateProp field if non-nil, zero value otherwise. + +### GetDatePropOk + +`func (o *NullableClass) GetDatePropOk() (*string, bool)` + +GetDatePropOk returns a tuple with the DateProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDateProp + +`func (o *NullableClass) SetDateProp(v string)` + +SetDateProp sets DateProp field to given value. + +### HasDateProp + +`func (o *NullableClass) HasDateProp() bool` + +HasDateProp returns a boolean if a field has been set. + +### SetDatePropNil + +`func (o *NullableClass) SetDatePropNil(b bool)` + + SetDatePropNil sets the value for DateProp to be an explicit nil + +### UnsetDateProp +`func (o *NullableClass) UnsetDateProp()` + +UnsetDateProp ensures that no value is present for DateProp, not even an explicit nil +### GetDatetimeProp + +`func (o *NullableClass) GetDatetimeProp() time.Time` + +GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. + +### GetDatetimePropOk + +`func (o *NullableClass) GetDatetimePropOk() (*time.Time, bool)` + +GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatetimeProp + +`func (o *NullableClass) SetDatetimeProp(v time.Time)` + +SetDatetimeProp sets DatetimeProp field to given value. + +### HasDatetimeProp + +`func (o *NullableClass) HasDatetimeProp() bool` + +HasDatetimeProp returns a boolean if a field has been set. + +### SetDatetimePropNil + +`func (o *NullableClass) SetDatetimePropNil(b bool)` + + SetDatetimePropNil sets the value for DatetimeProp to be an explicit nil + +### UnsetDatetimeProp +`func (o *NullableClass) UnsetDatetimeProp()` + +UnsetDatetimeProp ensures that no value is present for DatetimeProp, not even an explicit nil +### GetArrayNullableProp + +`func (o *NullableClass) GetArrayNullableProp() []map[string]interface{}` + +GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. + +### GetArrayNullablePropOk + +`func (o *NullableClass) GetArrayNullablePropOk() (*[]map[string]interface{}, bool)` + +GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayNullableProp + +`func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{})` + +SetArrayNullableProp sets ArrayNullableProp field to given value. + +### HasArrayNullableProp + +`func (o *NullableClass) HasArrayNullableProp() bool` + +HasArrayNullableProp returns a boolean if a field has been set. + +### SetArrayNullablePropNil + +`func (o *NullableClass) SetArrayNullablePropNil(b bool)` + + SetArrayNullablePropNil sets the value for ArrayNullableProp to be an explicit nil + +### UnsetArrayNullableProp +`func (o *NullableClass) UnsetArrayNullableProp()` + +UnsetArrayNullableProp ensures that no value is present for ArrayNullableProp, not even an explicit nil +### GetArrayAndItemsNullableProp + +`func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{}` + +GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. + +### GetArrayAndItemsNullablePropOk + +`func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]map[string]interface{}, bool)` + +GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayAndItemsNullableProp + +`func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{})` + +SetArrayAndItemsNullableProp sets ArrayAndItemsNullableProp field to given value. + +### HasArrayAndItemsNullableProp + +`func (o *NullableClass) HasArrayAndItemsNullableProp() bool` + +HasArrayAndItemsNullableProp returns a boolean if a field has been set. + +### SetArrayAndItemsNullablePropNil + +`func (o *NullableClass) SetArrayAndItemsNullablePropNil(b bool)` + + SetArrayAndItemsNullablePropNil sets the value for ArrayAndItemsNullableProp to be an explicit nil + +### UnsetArrayAndItemsNullableProp +`func (o *NullableClass) UnsetArrayAndItemsNullableProp()` + +UnsetArrayAndItemsNullableProp ensures that no value is present for ArrayAndItemsNullableProp, not even an explicit nil +### GetArrayItemsNullable + +`func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{}` + +GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. + +### GetArrayItemsNullableOk + +`func (o *NullableClass) GetArrayItemsNullableOk() (*[]map[string]interface{}, bool)` + +GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArrayItemsNullable + +`func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{})` + +SetArrayItemsNullable sets ArrayItemsNullable field to given value. + +### HasArrayItemsNullable + +`func (o *NullableClass) HasArrayItemsNullable() bool` + +HasArrayItemsNullable returns a boolean if a field has been set. + +### GetObjectNullableProp + +`func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{}` + +GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. + +### GetObjectNullablePropOk + +`func (o *NullableClass) GetObjectNullablePropOk() (*map[string]map[string]interface{}, bool)` + +GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObjectNullableProp + +`func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{})` + +SetObjectNullableProp sets ObjectNullableProp field to given value. + +### HasObjectNullableProp + +`func (o *NullableClass) HasObjectNullableProp() bool` + +HasObjectNullableProp returns a boolean if a field has been set. + +### SetObjectNullablePropNil + +`func (o *NullableClass) SetObjectNullablePropNil(b bool)` + + SetObjectNullablePropNil sets the value for ObjectNullableProp to be an explicit nil + +### UnsetObjectNullableProp +`func (o *NullableClass) UnsetObjectNullableProp()` + +UnsetObjectNullableProp ensures that no value is present for ObjectNullableProp, not even an explicit nil +### GetObjectAndItemsNullableProp + +`func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{}` + +GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. + +### GetObjectAndItemsNullablePropOk + +`func (o *NullableClass) GetObjectAndItemsNullablePropOk() (*map[string]map[string]interface{}, bool)` + +GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObjectAndItemsNullableProp + +`func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{})` + +SetObjectAndItemsNullableProp sets ObjectAndItemsNullableProp field to given value. + +### HasObjectAndItemsNullableProp + +`func (o *NullableClass) HasObjectAndItemsNullableProp() bool` + +HasObjectAndItemsNullableProp returns a boolean if a field has been set. + +### SetObjectAndItemsNullablePropNil + +`func (o *NullableClass) SetObjectAndItemsNullablePropNil(b bool)` + + SetObjectAndItemsNullablePropNil sets the value for ObjectAndItemsNullableProp to be an explicit nil + +### UnsetObjectAndItemsNullableProp +`func (o *NullableClass) UnsetObjectAndItemsNullableProp()` + +UnsetObjectAndItemsNullableProp ensures that no value is present for ObjectAndItemsNullableProp, not even an explicit nil +### GetObjectItemsNullable + +`func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{}` + +GetObjectItemsNullable returns the ObjectItemsNullable field if non-nil, zero value otherwise. + +### GetObjectItemsNullableOk + +`func (o *NullableClass) GetObjectItemsNullableOk() (*map[string]map[string]interface{}, bool)` + +GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObjectItemsNullable + +`func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{})` + +SetObjectItemsNullable sets ObjectItemsNullable field to given value. + +### HasObjectItemsNullable + +`func (o *NullableClass) HasObjectItemsNullable() bool` + +HasObjectItemsNullable returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/NumberOnly.md b/samples/openapi3/client/petstore/go/go-petstore/docs/NumberOnly.md index 604cf37eede..81941828b62 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/NumberOnly.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **float32** | | [optional] +**JustNumber** | Pointer to **float32** | | [optional] + +## Methods + +### NewNumberOnly + +`func NewNumberOnly() *NumberOnly` + +NewNumberOnly instantiates a new NumberOnly object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNumberOnlyWithDefaults + +`func NewNumberOnlyWithDefaults() *NumberOnly` + +NewNumberOnlyWithDefaults instantiates a new NumberOnly object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetJustNumber + +`func (o *NumberOnly) GetJustNumber() float32` + +GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. + +### GetJustNumberOk + +`func (o *NumberOnly) GetJustNumberOk() (*float32, bool)` + +GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJustNumber + +`func (o *NumberOnly) SetJustNumber(v float32)` + +SetJustNumber sets JustNumber field to given value. + +### HasJustNumber + +`func (o *NumberOnly) HasJustNumber() bool` + +HasJustNumber returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Order.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Order.md index eeef0971005..78cace2f229 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Order.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Order.md @@ -4,12 +4,182 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**PetId** | **int64** | | [optional] -**Quantity** | **int32** | | [optional] -**ShipDate** | [**time.Time**](time.Time.md) | | [optional] -**Status** | **string** | Order Status | [optional] -**Complete** | **bool** | | [optional] [default to false] +**Id** | Pointer to **int64** | | [optional] +**PetId** | Pointer to **int64** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Status** | Pointer to **string** | Order Status | [optional] +**Complete** | Pointer to **bool** | | [optional] [default to false] + +## Methods + +### NewOrder + +`func NewOrder() *Order` + +NewOrder instantiates a new Order object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderWithDefaults + +`func NewOrderWithDefaults() *Order` + +NewOrderWithDefaults instantiates a new Order object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Order) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Order) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Order) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Order) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPetId + +`func (o *Order) GetPetId() int64` + +GetPetId returns the PetId field if non-nil, zero value otherwise. + +### GetPetIdOk + +`func (o *Order) GetPetIdOk() (*int64, bool)` + +GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPetId + +`func (o *Order) SetPetId(v int64)` + +SetPetId sets PetId field to given value. + +### HasPetId + +`func (o *Order) HasPetId() bool` + +HasPetId returns a boolean if a field has been set. + +### GetQuantity + +`func (o *Order) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *Order) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *Order) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *Order) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetShipDate + +`func (o *Order) GetShipDate() time.Time` + +GetShipDate returns the ShipDate field if non-nil, zero value otherwise. + +### GetShipDateOk + +`func (o *Order) GetShipDateOk() (*time.Time, bool)` + +GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShipDate + +`func (o *Order) SetShipDate(v time.Time)` + +SetShipDate sets ShipDate field to given value. + +### HasShipDate + +`func (o *Order) HasShipDate() bool` + +HasShipDate returns a boolean if a field has been set. + +### GetStatus + +`func (o *Order) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Order) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Order) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *Order) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetComplete + +`func (o *Order) GetComplete() bool` + +GetComplete returns the Complete field if non-nil, zero value otherwise. + +### GetCompleteOk + +`func (o *Order) GetCompleteOk() (*bool, bool)` + +GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComplete + +`func (o *Order) SetComplete(v bool)` + +SetComplete sets Complete field to given value. + +### HasComplete + +`func (o *Order) HasComplete() bool` + +HasComplete returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterComposite.md b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterComposite.md index df9bce1bd90..1ebf86c0a2e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterComposite.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterComposite.md @@ -4,9 +4,104 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **float32** | | [optional] -**MyString** | **string** | | [optional] -**MyBoolean** | **bool** | | [optional] +**MyNumber** | Pointer to **float32** | | [optional] +**MyString** | Pointer to **string** | | [optional] +**MyBoolean** | Pointer to **bool** | | [optional] + +## Methods + +### NewOuterComposite + +`func NewOuterComposite() *OuterComposite` + +NewOuterComposite instantiates a new OuterComposite object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOuterCompositeWithDefaults + +`func NewOuterCompositeWithDefaults() *OuterComposite` + +NewOuterCompositeWithDefaults instantiates a new OuterComposite object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMyNumber + +`func (o *OuterComposite) GetMyNumber() float32` + +GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. + +### GetMyNumberOk + +`func (o *OuterComposite) GetMyNumberOk() (*float32, bool)` + +GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyNumber + +`func (o *OuterComposite) SetMyNumber(v float32)` + +SetMyNumber sets MyNumber field to given value. + +### HasMyNumber + +`func (o *OuterComposite) HasMyNumber() bool` + +HasMyNumber returns a boolean if a field has been set. + +### GetMyString + +`func (o *OuterComposite) GetMyString() string` + +GetMyString returns the MyString field if non-nil, zero value otherwise. + +### GetMyStringOk + +`func (o *OuterComposite) GetMyStringOk() (*string, bool)` + +GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyString + +`func (o *OuterComposite) SetMyString(v string)` + +SetMyString sets MyString field to given value. + +### HasMyString + +`func (o *OuterComposite) HasMyString() bool` + +HasMyString returns a boolean if a field has been set. + +### GetMyBoolean + +`func (o *OuterComposite) GetMyBoolean() bool` + +GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. + +### GetMyBooleanOk + +`func (o *OuterComposite) GetMyBooleanOk() (*bool, bool)` + +GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMyBoolean + +`func (o *OuterComposite) SetMyBoolean(v bool)` + +SetMyBoolean sets MyBoolean field to given value. + +### HasMyBoolean + +`func (o *OuterComposite) HasMyBoolean() bool` + +HasMyBoolean returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnum.md b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnum.md index c97466159c5..13bed2d17fd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnum.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnum.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumDefaultValue.md index 823808a3d76..50f8ab0096c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumDefaultValue.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumDefaultValue.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumInteger.md index b48e6b759a7..eb033db7cc5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumInteger.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumInteger.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumIntegerDefaultValue.md index cdb350fc185..7a163432954 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumIntegerDefaultValue.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/OuterEnumIntegerDefaultValue.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Pet.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Pet.md index c48104c6397..a6eae34657d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Pet.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Pet.md @@ -4,12 +4,172 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Category** | [**Category**](Category.md) | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Category** | Pointer to [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **[]string** | | -**Tags** | [**[]Tag**](Tag.md) | | [optional] -**Status** | **string** | pet status in the store | [optional] +**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] +**Status** | Pointer to **string** | pet status in the store | [optional] + +## Methods + +### NewPet + +`func NewPet(name string, photoUrls []string, ) *Pet` + +NewPet instantiates a new Pet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPetWithDefaults + +`func NewPetWithDefaults() *Pet` + +NewPetWithDefaults instantiates a new Pet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Pet) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Pet) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Pet) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Pet) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetCategory + +`func (o *Pet) GetCategory() Category` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *Pet) GetCategoryOk() (*Category, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *Pet) SetCategory(v Category)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *Pet) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + +### GetName + +`func (o *Pet) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Pet) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Pet) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPhotoUrls + +`func (o *Pet) GetPhotoUrls() []string` + +GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. + +### GetPhotoUrlsOk + +`func (o *Pet) GetPhotoUrlsOk() (*[]string, bool)` + +GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhotoUrls + +`func (o *Pet) SetPhotoUrls(v []string)` + +SetPhotoUrls sets PhotoUrls field to given value. + + +### GetTags + +`func (o *Pet) GetTags() []Tag` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Pet) GetTagsOk() (*[]Tag, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Pet) SetTags(v []Tag)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Pet) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetStatus + +`func (o *Pet) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Pet) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Pet) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *Pet) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md index 8118df7009b..6fdd89f81ba 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/PetApi.md @@ -18,17 +18,47 @@ Method | HTTP request | Description ## AddPet -> AddPet(ctx, pet) +> AddPet(ctx).Pet(pet).Execute() Add a new pet to the store -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pet := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.AddPet(context.Background(), pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.AddPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddPetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -36,7 +66,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -50,28 +80,53 @@ Name | Type | Description | Notes ## DeletePet -> DeletePet(ctx, petId, optional) +> DeletePet(ctx, petId).ApiKey(apiKey).Execute() Deletes a pet -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | Pet id to delete + apiKey := "apiKey_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.DeletePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| Pet id to delete | - **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters +**petId** | **int64** | Pet id to delete | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a DeletePetOpts struct +Other parameters are passed through a pointer to a apiDeletePetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **apiKey** | **optional.String**| | + **apiKey** | **string** | | ### Return type @@ -93,19 +148,51 @@ Name | Type | Description | Notes ## FindPetsByStatus -> []Pet FindPetsByStatus(ctx, status) +> []Pet FindPetsByStatus(ctx).Status(status).Execute() Finds Pets by status -Multiple status values can be provided with comma separated strings -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + status := []string{"Status_example"} // []string | Status values that need to be considered for filter + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.FindPetsByStatus(context.Background(), status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByStatus`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByStatus`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPetsByStatusRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**status** | [**[]string**](string.md)| Status values that need to be considered for filter | + **status** | [**[]string**](string.md) | Status values that need to be considered for filter | ### Return type @@ -113,7 +200,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -127,19 +214,51 @@ Name | Type | Description | Notes ## FindPetsByTags -> []Pet FindPetsByTags(ctx, tags) +> []Pet FindPetsByTags(ctx).Tags(tags).Execute() Finds Pets by tags -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + tags := []string{"Inner_example"} // []string | Tags to filter by + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.FindPetsByTags(context.Background(), tags).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.FindPetsByTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByTags`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetApi.FindPetsByTags`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPetsByTagsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**tags** | [**[]string**](string.md)| Tags to filter by | + **tags** | [**[]string**](string.md) | Tags to filter by | ### Return type @@ -147,7 +266,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -161,19 +280,55 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById(ctx, petId) +> Pet GetPetById(ctx, petId).Execute() Find pet by ID -Returns a single pet -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet to return + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.GetPetById(context.Background(), petId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.GetPetById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPetById`: Pet + fmt.Fprintf(os.Stdout, "Response from `PetApi.GetPetById`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to return | +**petId** | **int64** | ID of pet to return | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPetByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -195,17 +350,47 @@ Name | Type | Description | Notes ## UpdatePet -> UpdatePet(ctx, pet) +> UpdatePet(ctx).Pet(pet).Execute() Update an existing pet -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pet := openapiclient.Pet{Id: int64(123), Category: openapiclient.Category{Id: int64(123), Name: "Name_example"}, Name: "Name_example", PhotoUrls: []string{"PhotoUrls_example"), Tags: []Tag{openapiclient.Tag{Id: int64(123), Name: "Name_example"}), Status: "Status_example"} // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UpdatePet(context.Background(), pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdatePetRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -213,7 +398,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -227,29 +412,55 @@ Name | Type | Description | Notes ## UpdatePetWithForm -> UpdatePetWithForm(ctx, petId, optional) +> UpdatePetWithForm(ctx, petId).Name(name).Status(status).Execute() Updates a pet in the store with form data -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet that needs to be updated + name := "name_example" // string | Updated name of the pet (optional) + status := "status_example" // string | Updated status of the pet (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UpdatePetWithForm``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet that needs to be updated | - **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters +**petId** | **int64** | ID of pet that needs to be updated | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct +Other parameters are passed through a pointer to a apiUpdatePetWithFormRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **optional.String**| Updated name of the pet | - **status** | **optional.String**| Updated status of the pet | + **name** | **string** | Updated name of the pet | + **status** | **string** | Updated status of the pet | ### Return type @@ -271,29 +482,57 @@ Name | Type | Description | Notes ## UploadFile -> ApiResponse UploadFile(ctx, petId, optional) +> ApiResponse UploadFile(ctx, petId).AdditionalMetadata(additionalMetadata).File(file).Execute() uploads an image -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet to update + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + file := 987 // *os.File | file to upload (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFile`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to update | - **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters +**petId** | **int64** | ID of pet to update | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a UploadFileOpts struct +Other parameters are passed through a pointer to a apiUploadFileRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **additionalMetadata** | **optional.String**| Additional data to pass to server | - **file** | **optional.Interface of *os.File****optional.*os.File**| file to upload | + **additionalMetadata** | **string** | Additional data to pass to server | + **file** | ***os.File** | file to upload | ### Return type @@ -315,30 +554,57 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile(ctx, petId, requiredFile, optional) +> ApiResponse UploadFileWithRequiredFile(ctx, petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() uploads an image (required) -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + petId := 987 // int64 | ID of pet to update + requiredFile := 987 // *os.File | file to upload + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.PetApi.UploadFileWithRequiredFile(context.Background(), petId, requiredFile).AdditionalMetadata(additionalMetadata).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetApi.UploadFileWithRequiredFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFileWithRequiredFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetApi.UploadFileWithRequiredFile`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**petId** | **int64**| ID of pet to update | -**requiredFile** | ***os.File*****os.File**| file to upload | - **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters +**petId** | **int64** | ID of pet to update | -### Optional Parameters +### Other Parameters -Optional parameters are passed through a pointer to a UploadFileWithRequiredFileOpts struct +Other parameters are passed through a pointer to a apiUploadFileWithRequiredFileRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - **additionalMetadata** | **optional.String**| Additional data to pass to server | + **requiredFile** | ***os.File** | file to upload | + **additionalMetadata** | **string** | Additional data to pass to server | ### Return type diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md index a86828404ec..2e25d6d230e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Bar** | **string** | | [optional] [readonly] -**Baz** | **string** | | [optional] +**Bar** | Pointer to **string** | | [optional] [readonly] +**Baz** | Pointer to **string** | | [optional] + +## Methods + +### NewReadOnlyFirst + +`func NewReadOnlyFirst() *ReadOnlyFirst` + +NewReadOnlyFirst instantiates a new ReadOnlyFirst object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReadOnlyFirstWithDefaults + +`func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst` + +NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBar + +`func (o *ReadOnlyFirst) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *ReadOnlyFirst) GetBarOk() (*string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBar + +`func (o *ReadOnlyFirst) SetBar(v string)` + +SetBar sets Bar field to given value. + +### HasBar + +`func (o *ReadOnlyFirst) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### GetBaz + +`func (o *ReadOnlyFirst) GetBaz() string` + +GetBaz returns the Baz field if non-nil, zero value otherwise. + +### GetBazOk + +`func (o *ReadOnlyFirst) GetBazOk() (*string, bool)` + +GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaz + +`func (o *ReadOnlyFirst) SetBaz(v string)` + +SetBaz sets Baz field to given value. + +### HasBaz + +`func (o *ReadOnlyFirst) HasBaz() bool` + +HasBaz returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Return.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Return.md index 11be0b27c50..d6be5a42f31 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Return.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Return.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Return** | **int32** | | [optional] +**Return** | Pointer to **int32** | | [optional] + +## Methods + +### NewReturn + +`func NewReturn() *Return` + +NewReturn instantiates a new Return object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReturnWithDefaults + +`func NewReturnWithDefaults() *Return` + +NewReturnWithDefaults instantiates a new Return object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReturn + +`func (o *Return) GetReturn() int32` + +GetReturn returns the Return field if non-nil, zero value otherwise. + +### GetReturnOk + +`func (o *Return) GetReturnOk() (*int32, bool)` + +GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReturn + +`func (o *Return) SetReturn(v int32)` + +SetReturn sets Return field to given value. + +### HasReturn + +`func (o *Return) HasReturn() bool` + +HasReturn returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/SpecialModelName.md b/samples/openapi3/client/petstore/go/go-petstore/docs/SpecialModelName.md index 96d7a28a409..3e5a187c1d1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/SpecialModelName.md @@ -4,7 +4,52 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **int64** | | [optional] +**SpecialPropertyName** | Pointer to **int64** | | [optional] + +## Methods + +### NewSpecialModelName + +`func NewSpecialModelName() *SpecialModelName` + +NewSpecialModelName instantiates a new SpecialModelName object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpecialModelNameWithDefaults + +`func NewSpecialModelNameWithDefaults() *SpecialModelName` + +NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSpecialPropertyName + +`func (o *SpecialModelName) GetSpecialPropertyName() int64` + +GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. + +### GetSpecialPropertyNameOk + +`func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool)` + +GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecialPropertyName + +`func (o *SpecialModelName) SetSpecialPropertyName(v int64)` + +SetSpecialPropertyName sets SpecialPropertyName field to given value. + +### HasSpecialPropertyName + +`func (o *SpecialModelName) HasSpecialPropertyName() bool` + +HasSpecialPropertyName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md index c24d87bbfd6..80617c8683b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreApi.md @@ -13,19 +13,53 @@ Method | HTTP request | Description ## DeleteOrder -> DeleteOrder(ctx, orderId) +> DeleteOrder(ctx, orderId).Execute() Delete purchase order by ID -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + orderId := "orderId_example" // string | ID of the order that needs to be deleted + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.DeleteOrder(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.DeleteOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **string**| ID of the order that needs to be deleted | +**orderId** | **string** | ID of the order that needs to be deleted | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteOrderRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -47,16 +81,47 @@ No authorization required ## GetInventory -> map[string]int32 GetInventory(ctx, ) +> map[string]int32 GetInventory(ctx).Execute() Returns pet inventories by status -Returns a map of status codes to quantities -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.GetInventory(context.Background(), ).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetInventory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInventory`: map[string]int32 + fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetInventory`: %v\n", resp) +} +``` + +### Path Parameters This endpoint does not need any parameter. +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInventoryRequest struct via the builder pattern + + ### Return type **map[string]int32** @@ -77,19 +142,55 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById(ctx, orderId) +> Order GetOrderById(ctx, orderId).Execute() Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + orderId := 987 // int64 | ID of pet that needs to be fetched + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.GetOrderById(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.GetOrderById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOrderById`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreApi.GetOrderById`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**orderId** | **int64**| ID of pet that needs to be fetched | +**orderId** | **int64** | ID of pet that needs to be fetched | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetOrderByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -111,17 +212,49 @@ No authorization required ## PlaceOrder -> Order PlaceOrder(ctx, order) +> Order PlaceOrder(ctx).Order(order).Execute() Place an order for a pet -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + order := openapiclient.Order{Id: int64(123), PetId: int64(123), Quantity: 123, ShipDate: "TODO", Status: "Status_example", Complete: false} // Order | order placed for purchasing the pet + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.StoreApi.PlaceOrder(context.Background(), order).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreApi.PlaceOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PlaceOrder`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreApi.PlaceOrder`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPlaceOrderRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**order** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/Tag.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Tag.md index d6b3cc117b5..391be6b4900 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/Tag.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/Tag.md @@ -4,8 +4,78 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Name** | **string** | | [optional] +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewTag + +`func NewTag() *Tag` + +NewTag instantiates a new Tag object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTagWithDefaults + +`func NewTagWithDefaults() *Tag` + +NewTagWithDefaults instantiates a new Tag object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Tag) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Tag) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Tag) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Tag) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Tag) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Tag) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Tag) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Tag) HasName() bool` + +HasName returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/User.md b/samples/openapi3/client/petstore/go/go-petstore/docs/User.md index 7675d7ff701..26c9305363e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/User.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/User.md @@ -4,14 +4,368 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **int64** | | [optional] -**Username** | **string** | | [optional] -**FirstName** | **string** | | [optional] -**LastName** | **string** | | [optional] -**Email** | **string** | | [optional] -**Password** | **string** | | [optional] -**Phone** | **string** | | [optional] -**UserStatus** | **int32** | User Status | [optional] +**Id** | Pointer to **int64** | | [optional] +**Username** | Pointer to **string** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**UserStatus** | Pointer to **int32** | User Status | [optional] +**ArbitraryObject** | Pointer to **map[string]interface{}** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] +**ArbitraryNullableObject** | Pointer to **map[string]interface{}** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] +**ArbitraryTypeValue** | Pointer to **interface{}** | test code generation for any type Value can be any type - string, number, boolean, array or object. | [optional] +**ArbitraryNullableTypeValue** | Pointer to **interface{}** | test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. | [optional] + +## Methods + +### NewUser + +`func NewUser() *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *User) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *User) GetIdOk() (*int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *User) SetId(v int64)` + +SetId sets Id field to given value. + +### HasId + +`func (o *User) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetUsername + +`func (o *User) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *User) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *User) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *User) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetEmail + +`func (o *User) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *User) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *User) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *User) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetPassword + +`func (o *User) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *User) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *User) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *User) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetPhone + +`func (o *User) GetPhone() string` + +GetPhone returns the Phone field if non-nil, zero value otherwise. + +### GetPhoneOk + +`func (o *User) GetPhoneOk() (*string, bool)` + +GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhone + +`func (o *User) SetPhone(v string)` + +SetPhone sets Phone field to given value. + +### HasPhone + +`func (o *User) HasPhone() bool` + +HasPhone returns a boolean if a field has been set. + +### GetUserStatus + +`func (o *User) GetUserStatus() int32` + +GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. + +### GetUserStatusOk + +`func (o *User) GetUserStatusOk() (*int32, bool)` + +GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserStatus + +`func (o *User) SetUserStatus(v int32)` + +SetUserStatus sets UserStatus field to given value. + +### HasUserStatus + +`func (o *User) HasUserStatus() bool` + +HasUserStatus returns a boolean if a field has been set. + +### GetArbitraryObject + +`func (o *User) GetArbitraryObject() map[string]interface{}` + +GetArbitraryObject returns the ArbitraryObject field if non-nil, zero value otherwise. + +### GetArbitraryObjectOk + +`func (o *User) GetArbitraryObjectOk() (*map[string]interface{}, bool)` + +GetArbitraryObjectOk returns a tuple with the ArbitraryObject field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArbitraryObject + +`func (o *User) SetArbitraryObject(v map[string]interface{})` + +SetArbitraryObject sets ArbitraryObject field to given value. + +### HasArbitraryObject + +`func (o *User) HasArbitraryObject() bool` + +HasArbitraryObject returns a boolean if a field has been set. + +### GetArbitraryNullableObject + +`func (o *User) GetArbitraryNullableObject() map[string]interface{}` + +GetArbitraryNullableObject returns the ArbitraryNullableObject field if non-nil, zero value otherwise. + +### GetArbitraryNullableObjectOk + +`func (o *User) GetArbitraryNullableObjectOk() (*map[string]interface{}, bool)` + +GetArbitraryNullableObjectOk returns a tuple with the ArbitraryNullableObject field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArbitraryNullableObject + +`func (o *User) SetArbitraryNullableObject(v map[string]interface{})` + +SetArbitraryNullableObject sets ArbitraryNullableObject field to given value. + +### HasArbitraryNullableObject + +`func (o *User) HasArbitraryNullableObject() bool` + +HasArbitraryNullableObject returns a boolean if a field has been set. + +### SetArbitraryNullableObjectNil + +`func (o *User) SetArbitraryNullableObjectNil(b bool)` + + SetArbitraryNullableObjectNil sets the value for ArbitraryNullableObject to be an explicit nil + +### UnsetArbitraryNullableObject +`func (o *User) UnsetArbitraryNullableObject()` + +UnsetArbitraryNullableObject ensures that no value is present for ArbitraryNullableObject, not even an explicit nil +### GetArbitraryTypeValue + +`func (o *User) GetArbitraryTypeValue() interface{}` + +GetArbitraryTypeValue returns the ArbitraryTypeValue field if non-nil, zero value otherwise. + +### GetArbitraryTypeValueOk + +`func (o *User) GetArbitraryTypeValueOk() (*interface{}, bool)` + +GetArbitraryTypeValueOk returns a tuple with the ArbitraryTypeValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArbitraryTypeValue + +`func (o *User) SetArbitraryTypeValue(v interface{})` + +SetArbitraryTypeValue sets ArbitraryTypeValue field to given value. + +### HasArbitraryTypeValue + +`func (o *User) HasArbitraryTypeValue() bool` + +HasArbitraryTypeValue returns a boolean if a field has been set. + +### SetArbitraryTypeValueNil + +`func (o *User) SetArbitraryTypeValueNil(b bool)` + + SetArbitraryTypeValueNil sets the value for ArbitraryTypeValue to be an explicit nil + +### UnsetArbitraryTypeValue +`func (o *User) UnsetArbitraryTypeValue()` + +UnsetArbitraryTypeValue ensures that no value is present for ArbitraryTypeValue, not even an explicit nil +### GetArbitraryNullableTypeValue + +`func (o *User) GetArbitraryNullableTypeValue() interface{}` + +GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field if non-nil, zero value otherwise. + +### GetArbitraryNullableTypeValueOk + +`func (o *User) GetArbitraryNullableTypeValueOk() (*interface{}, bool)` + +GetArbitraryNullableTypeValueOk returns a tuple with the ArbitraryNullableTypeValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetArbitraryNullableTypeValue + +`func (o *User) SetArbitraryNullableTypeValue(v interface{})` + +SetArbitraryNullableTypeValue sets ArbitraryNullableTypeValue field to given value. + +### HasArbitraryNullableTypeValue + +`func (o *User) HasArbitraryNullableTypeValue() bool` + +HasArbitraryNullableTypeValue returns a boolean if a field has been set. + +### SetArbitraryNullableTypeValueNil + +`func (o *User) SetArbitraryNullableTypeValueNil(b bool)` + + SetArbitraryNullableTypeValueNil sets the value for ArbitraryNullableTypeValue to be an explicit nil + +### UnsetArbitraryNullableTypeValue +`func (o *User) UnsetArbitraryNullableTypeValue()` + +UnsetArbitraryNullableTypeValue ensures that no value is present for ArbitraryNullableTypeValue, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md index 01d05d555cf..71205efd786 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/UserApi.md @@ -17,19 +17,49 @@ Method | HTTP request | Description ## CreateUser -> CreateUser(ctx, user) +> CreateUser(ctx).User(user).Execute() Create user -This can only be done by the logged in user. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + user := openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123, ArbitraryObject: 123, ArbitraryNullableObject: 123, ArbitraryTypeValue: 123, ArbitraryNullableTypeValue: 123} // User | Created user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.CreateUser(context.Background(), user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**user** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md) | Created user object | ### Return type @@ -51,17 +81,47 @@ No authorization required ## CreateUsersWithArrayInput -> CreateUsersWithArrayInput(ctx, user) +> CreateUsersWithArrayInput(ctx).User(user).Execute() Creates list of users with given input array -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + user := []User{openapiclient.User{Id: int64(123), Username: "Username_example", FirstName: "FirstName_example", LastName: "LastName_example", Email: "Email_example", Password: "Password_example", Phone: "Phone_example", UserStatus: 123, ArbitraryObject: 123, ArbitraryNullableObject: 123, ArbitraryTypeValue: 123, ArbitraryNullableTypeValue: 123}} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.CreateUsersWithArrayInput(context.Background(), user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithArrayInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUsersWithArrayInputRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**user** | [**[]User**](User.md)| List of user object | + **user** | [**[]User**](User.md) | List of user object | ### Return type @@ -83,17 +143,47 @@ No authorization required ## CreateUsersWithListInput -> CreateUsersWithListInput(ctx, user) +> CreateUsersWithListInput(ctx).User(user).Execute() Creates list of users with given input array -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + user := []User{} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.CreateUsersWithListInput(context.Background(), user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.CreateUsersWithListInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUsersWithListInputRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**user** | [**[]User**](User.md)| List of user object | + **user** | [**[]User**](User.md) | List of user object | ### Return type @@ -115,19 +205,53 @@ No authorization required ## DeleteUser -> DeleteUser(ctx, username) +> DeleteUser(ctx, username).Execute() Delete user -This can only be done by the logged in user. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The name that needs to be deleted + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The name that needs to be deleted | +**username** | **string** | The name that needs to be deleted | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -149,17 +273,53 @@ No authorization required ## GetUserByName -> User GetUserByName(ctx, username) +> User GetUserByName(ctx, username).Execute() Get user by user name -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.GetUserByName(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUserByName``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUserByName`: User + fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUserByName`: %v\n", resp) +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The name that needs to be fetched. Use user1 for testing. | +**username** | **string** | The name that needs to be fetched. Use user1 for testing. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUserByNameRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + ### Return type @@ -181,18 +341,51 @@ No authorization required ## LoginUser -> string LoginUser(ctx, username, password) +> string LoginUser(ctx).Username(username).Password(password).Execute() Logs user into the system -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | The user name for login + password := "password_example" // string | The password for login in clear text + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.LoginUser(context.Background(), username, password).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LoginUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `LoginUser`: string + fmt.Fprintf(os.Stdout, "Response from `UserApi.LoginUser`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiLoginUserRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| The user name for login | -**password** | **string**| The password for login in clear text | + **username** | **string** | The user name for login | + **password** | **string** | The password for login in clear text | ### Return type @@ -214,14 +407,43 @@ No authorization required ## LogoutUser -> LogoutUser(ctx, ) +> LogoutUser(ctx).Execute() Logs out current logged in user session -### Required Parameters +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.LogoutUser(context.Background(), ).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.LogoutUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters This endpoint does not need any parameter. +### Other Parameters + +Other parameters are passed through a pointer to a apiLogoutUserRequest struct via the builder pattern + + ### Return type (empty response body) @@ -242,20 +464,55 @@ No authorization required ## UpdateUser -> UpdateUser(ctx, username, user) +> UpdateUser(ctx, username).User(user).Execute() Updated user -This can only be done by the logged in user. -### Required Parameters + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + username := "username_example" // string | name that need to be deleted + user := // User | Updated user object + + configuration := openapiclient.NewConfiguration() + api_client := openapiclient.NewAPIClient(configuration) + resp, r, err := api_client.UserApi.UpdateUser(context.Background(), username, user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserApi.UpdateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**username** | **string**| name that need to be deleted | -**user** | [**User**](User.md)| Updated user object | +**username** | **string** | name that need to be deleted | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **user** | [**User**](User.md) | Updated user object | ### Return type diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Whale.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Whale.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Whale.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/Whale.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Zebra.md b/samples/openapi3/client/petstore/go/go-petstore/docs/Zebra.md similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Zebra.md rename to samples/openapi3/client/petstore/go/go-petstore/docs/Zebra.md diff --git a/samples/openapi3/client/petstore/go/go-petstore/go.mod b/samples/openapi3/client/petstore/go/go-petstore/go.mod index 1af1846f985..f9811556cc5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/go.mod +++ b/samples/openapi3/client/petstore/go/go-petstore/go.mod @@ -1,6 +1,7 @@ module github.com/GIT_USER_ID/GIT_REPO_ID +go 1.13 + require ( - github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/go.sum b/samples/openapi3/client/petstore/go/go-petstore/go.sum index ee695202297..ce55b3c6a08 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/go.sum +++ b/samples/openapi3/client/petstore/go/go-petstore/go.sum @@ -1,8 +1,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= -github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go index 8ae5118c9fd..f1dcea6f973 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_200_response.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // Model200Response Model for testing model name starting with number type Model200Response struct { - Name int32 `json:"name,omitempty"` - Class string `json:"class,omitempty"` + Name *int32 `json:"name,omitempty"` + Class *string `json:"class,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Model200Response Model200Response + +// NewModel200Response instantiates a new Model200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModel200Response() *Model200Response { + this := Model200Response{} + return &this +} + +// NewModel200ResponseWithDefaults instantiates a new Model200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModel200ResponseWithDefaults() *Model200Response { + this := Model200Response{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Model200Response) GetName() int32 { + if o == nil || o.Name == nil { + var ret int32 + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetNameOk() (*int32, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Model200Response) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given int32 and assigns it to the Name field. +func (o *Model200Response) SetName(v int32) { + o.Name = &v +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Model200Response) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetClassOk() (*string, bool) { + if o == nil || o.Class == nil { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Model200Response) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Model200Response) SetClass(v string) { + o.Class = &v +} + +func (o Model200Response) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Class != nil { + toSerialize["class"] = o.Class + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Model200Response) UnmarshalJSON(bytes []byte) (err error) { + varModel200Response := _Model200Response{} + + if err = json.Unmarshal(bytes, &varModel200Response); err == nil { + *o = Model200Response(varModel200Response) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "class") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModel200Response struct { + value *Model200Response + isSet bool +} + +func (v NullableModel200Response) Get() *Model200Response { + return v.value +} + +func (v *NullableModel200Response) Set(val *Model200Response) { + v.value = val + v.isSet = true +} + +func (v NullableModel200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableModel200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModel200Response(val *Model200Response) *NullableModel200Response { + return &NullableModel200Response{value: val, isSet: true} +} + +func (v NullableModel200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModel200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go index e36ceb38e5f..83aea0db4ea 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model__special_model_name_.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // SpecialModelName struct for SpecialModelName type SpecialModelName struct { - SpecialPropertyName int64 `json:"$special[property.name],omitempty"` + SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` + AdditionalProperties map[string]interface{} } + +type _SpecialModelName SpecialModelName + +// NewSpecialModelName instantiates a new SpecialModelName object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpecialModelName() *SpecialModelName { + this := SpecialModelName{} + return &this +} + +// NewSpecialModelNameWithDefaults instantiates a new SpecialModelName object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpecialModelNameWithDefaults() *SpecialModelName { + this := SpecialModelName{} + return &this +} + +// GetSpecialPropertyName returns the SpecialPropertyName field value if set, zero value otherwise. +func (o *SpecialModelName) GetSpecialPropertyName() int64 { + if o == nil || o.SpecialPropertyName == nil { + var ret int64 + return ret + } + return *o.SpecialPropertyName +} + +// GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialModelName) GetSpecialPropertyNameOk() (*int64, bool) { + if o == nil || o.SpecialPropertyName == nil { + return nil, false + } + return o.SpecialPropertyName, true +} + +// HasSpecialPropertyName returns a boolean if a field has been set. +func (o *SpecialModelName) HasSpecialPropertyName() bool { + if o != nil && o.SpecialPropertyName != nil { + return true + } + + return false +} + +// SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. +func (o *SpecialModelName) SetSpecialPropertyName(v int64) { + o.SpecialPropertyName = &v +} + +func (o SpecialModelName) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SpecialPropertyName != nil { + toSerialize["$special[property.name]"] = o.SpecialPropertyName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *SpecialModelName) UnmarshalJSON(bytes []byte) (err error) { + varSpecialModelName := _SpecialModelName{} + + if err = json.Unmarshal(bytes, &varSpecialModelName); err == nil { + *o = SpecialModelName(varSpecialModelName) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "$special[property.name]") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpecialModelName struct { + value *SpecialModelName + isSet bool +} + +func (v NullableSpecialModelName) Get() *SpecialModelName { + return v.value +} + +func (v *NullableSpecialModelName) Set(val *SpecialModelName) { + v.value = val + v.isSet = true +} + +func (v NullableSpecialModelName) IsSet() bool { + return v.isSet +} + +func (v *NullableSpecialModelName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpecialModelName(val *SpecialModelName) *NullableSpecialModelName { + return &NullableSpecialModelName{value: val, isSet: true} +} + +func (v NullableSpecialModelName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpecialModelName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go index 3401a3fb266..927cd61dc49 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_additional_properties_class.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // AdditionalPropertiesClass struct for AdditionalPropertiesClass type AdditionalPropertiesClass struct { - MapProperty map[string]string `json:"map_property,omitempty"` - MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"` + MapProperty *map[string]string `json:"map_property,omitempty"` + MapOfMapProperty *map[string]map[string]string `json:"map_of_map_property,omitempty"` + AdditionalProperties map[string]interface{} } + +type _AdditionalPropertiesClass AdditionalPropertiesClass + +// NewAdditionalPropertiesClass instantiates a new AdditionalPropertiesClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdditionalPropertiesClass() *AdditionalPropertiesClass { + this := AdditionalPropertiesClass{} + return &this +} + +// NewAdditionalPropertiesClassWithDefaults instantiates a new AdditionalPropertiesClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdditionalPropertiesClassWithDefaults() *AdditionalPropertiesClass { + this := AdditionalPropertiesClass{} + return &this +} + +// GetMapProperty returns the MapProperty field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string { + if o == nil || o.MapProperty == nil { + var ret map[string]string + return ret + } + return *o.MapProperty +} + +// GetMapPropertyOk returns a tuple with the MapProperty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapPropertyOk() (*map[string]string, bool) { + if o == nil || o.MapProperty == nil { + return nil, false + } + return o.MapProperty, true +} + +// HasMapProperty returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapProperty() bool { + if o != nil && o.MapProperty != nil { + return true + } + + return false +} + +// SetMapProperty gets a reference to the given map[string]string and assigns it to the MapProperty field. +func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string) { + o.MapProperty = &v +} + +// GetMapOfMapProperty returns the MapOfMapProperty field value if set, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string { + if o == nil || o.MapOfMapProperty == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapOfMapProperty +} + +// GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (*map[string]map[string]string, bool) { + if o == nil || o.MapOfMapProperty == nil { + return nil, false + } + return o.MapOfMapProperty, true +} + +// HasMapOfMapProperty returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool { + if o != nil && o.MapOfMapProperty != nil { + return true + } + + return false +} + +// SetMapOfMapProperty gets a reference to the given map[string]map[string]string and assigns it to the MapOfMapProperty field. +func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string) { + o.MapOfMapProperty = &v +} + +func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapProperty != nil { + toSerialize["map_property"] = o.MapProperty + } + if o.MapOfMapProperty != nil { + toSerialize["map_of_map_property"] = o.MapOfMapProperty + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *AdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) { + varAdditionalPropertiesClass := _AdditionalPropertiesClass{} + + if err = json.Unmarshal(bytes, &varAdditionalPropertiesClass); err == nil { + *o = AdditionalPropertiesClass(varAdditionalPropertiesClass) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "map_property") + delete(additionalProperties, "map_of_map_property") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAdditionalPropertiesClass struct { + value *AdditionalPropertiesClass + isSet bool +} + +func (v NullableAdditionalPropertiesClass) Get() *AdditionalPropertiesClass { + return v.value +} + +func (v *NullableAdditionalPropertiesClass) Set(val *AdditionalPropertiesClass) { + v.value = val + v.isSet = true +} + +func (v NullableAdditionalPropertiesClass) IsSet() bool { + return v.isSet +} + +func (v *NullableAdditionalPropertiesClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdditionalPropertiesClass(val *AdditionalPropertiesClass) *NullableAdditionalPropertiesClass { + return &NullableAdditionalPropertiesClass{value: val, isSet: true} +} + +func (v NullableAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go index 1c09a9ddb7f..de5e106e58b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go @@ -8,8 +8,166 @@ */ package petstore + +import ( + "encoding/json" +) + // Animal struct for Animal type Animal struct { ClassName string `json:"className"` - Color string `json:"color,omitempty"` + Color *string `json:"color,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Animal Animal + +// NewAnimal instantiates a new Animal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAnimal(className string, ) *Animal { + this := Animal{} + this.ClassName = className + var color string = "red" + this.Color = &color + return &this +} + +// NewAnimalWithDefaults instantiates a new Animal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAnimalWithDefaults() *Animal { + this := Animal{} + var color string = "red" + this.Color = &color + return &this +} + +// GetClassName returns the ClassName field value +func (o *Animal) GetClassName() string { + if o == nil { + var ret string + return ret + } + + return o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field value +// and a boolean to check if the value has been set. +func (o *Animal) GetClassNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClassName, true +} + +// SetClassName sets field value +func (o *Animal) SetClassName(v string) { + o.ClassName = v +} + +// GetColor returns the Color field value if set, zero value otherwise. +func (o *Animal) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Animal) GetColorOk() (*string, bool) { + if o == nil || o.Color == nil { + return nil, false + } + return o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Animal) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Animal) SetColor(v string) { + o.Color = &v +} + +func (o Animal) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Animal) UnmarshalJSON(bytes []byte) (err error) { + varAnimal := _Animal{} + + if err = json.Unmarshal(bytes, &varAnimal); err == nil { + *o = Animal(varAnimal) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "className") + delete(additionalProperties, "color") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAnimal struct { + value *Animal + isSet bool +} + +func (v NullableAnimal) Get() *Animal { + return v.value +} + +func (v *NullableAnimal) Set(val *Animal) { + v.value = val + v.isSet = true +} + +func (v NullableAnimal) IsSet() bool { + return v.isSet +} + +func (v *NullableAnimal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAnimal(val *Animal) *NullableAnimal { + return &NullableAnimal{value: val, isSet: true} +} + +func (v NullableAnimal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAnimal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go index de022a0afac..c73431ad186 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_api_response.go @@ -8,9 +8,206 @@ */ package petstore + +import ( + "encoding/json" +) + // ApiResponse struct for ApiResponse type ApiResponse struct { - Code int32 `json:"code,omitempty"` - Type string `json:"type,omitempty"` - Message string `json:"message,omitempty"` + Code *int32 `json:"code,omitempty"` + Type *string `json:"type,omitempty"` + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} } + +type _ApiResponse ApiResponse + +// NewApiResponse instantiates a new ApiResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApiResponse() *ApiResponse { + this := ApiResponse{} + return &this +} + +// NewApiResponseWithDefaults instantiates a new ApiResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApiResponseWithDefaults() *ApiResponse { + this := ApiResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ApiResponse) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetCodeOk() (*int32, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiResponse) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiResponse) SetCode(v int32) { + o.Code = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ApiResponse) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ApiResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ApiResponse) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ApiResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiResponse) SetMessage(v string) { + o.Message = &v +} + +func (o ApiResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *ApiResponse) UnmarshalJSON(bytes []byte) (err error) { + varApiResponse := _ApiResponse{} + + if err = json.Unmarshal(bytes, &varApiResponse); err == nil { + *o = ApiResponse(varApiResponse) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "type") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApiResponse struct { + value *ApiResponse + isSet bool +} + +func (v NullableApiResponse) Get() *ApiResponse { + return v.value +} + +func (v *NullableApiResponse) Set(val *ApiResponse) { + v.value = val + v.isSet = true +} + +func (v NullableApiResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableApiResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApiResponse(val *ApiResponse) *NullableApiResponse { + return &NullableApiResponse{value: val, isSet: true} +} + +func (v NullableApiResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApiResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple.go b/samples/openapi3/client/petstore/go/go-petstore/model_apple.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple.go rename to samples/openapi3/client/petstore/go/go-petstore/model_apple.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_apple_req.go rename to samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go index a0818c18147..1af9a061306 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_array_of_number_only.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly type ArrayOfArrayOfNumberOnly struct { - ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` + ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` + AdditionalProperties map[string]interface{} } + +type _ArrayOfArrayOfNumberOnly ArrayOfArrayOfNumberOnly + +// NewArrayOfArrayOfNumberOnly instantiates a new ArrayOfArrayOfNumberOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArrayOfArrayOfNumberOnly() *ArrayOfArrayOfNumberOnly { + this := ArrayOfArrayOfNumberOnly{} + return &this +} + +// NewArrayOfArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfArrayOfNumberOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArrayOfArrayOfNumberOnlyWithDefaults() *ArrayOfArrayOfNumberOnly { + this := ArrayOfArrayOfNumberOnly{} + return &this +} + +// GetArrayArrayNumber returns the ArrayArrayNumber field value if set, zero value otherwise. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { + if o == nil || o.ArrayArrayNumber == nil { + var ret [][]float32 + return ret + } + return *o.ArrayArrayNumber +} + +// GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() (*[][]float32, bool) { + if o == nil || o.ArrayArrayNumber == nil { + return nil, false + } + return o.ArrayArrayNumber, true +} + +// HasArrayArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { + if o != nil && o.ArrayArrayNumber != nil { + return true + } + + return false +} + +// SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. +func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { + o.ArrayArrayNumber = &v +} + +func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayArrayNumber != nil { + toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *ArrayOfArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) { + varArrayOfArrayOfNumberOnly := _ArrayOfArrayOfNumberOnly{} + + if err = json.Unmarshal(bytes, &varArrayOfArrayOfNumberOnly); err == nil { + *o = ArrayOfArrayOfNumberOnly(varArrayOfArrayOfNumberOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ArrayArrayNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableArrayOfArrayOfNumberOnly struct { + value *ArrayOfArrayOfNumberOnly + isSet bool +} + +func (v NullableArrayOfArrayOfNumberOnly) Get() *ArrayOfArrayOfNumberOnly { + return v.value +} + +func (v *NullableArrayOfArrayOfNumberOnly) Set(val *ArrayOfArrayOfNumberOnly) { + v.value = val + v.isSet = true +} + +func (v NullableArrayOfArrayOfNumberOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayOfArrayOfNumberOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayOfArrayOfNumberOnly(val *ArrayOfArrayOfNumberOnly) *NullableArrayOfArrayOfNumberOnly { + return &NullableArrayOfArrayOfNumberOnly{value: val, isSet: true} +} + +func (v NullableArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayOfArrayOfNumberOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go index 521dd4a778c..7dcd1f46d30 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_of_number_only.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // ArrayOfNumberOnly struct for ArrayOfNumberOnly type ArrayOfNumberOnly struct { - ArrayNumber []float32 `json:"ArrayNumber,omitempty"` + ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` + AdditionalProperties map[string]interface{} } + +type _ArrayOfNumberOnly ArrayOfNumberOnly + +// NewArrayOfNumberOnly instantiates a new ArrayOfNumberOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArrayOfNumberOnly() *ArrayOfNumberOnly { + this := ArrayOfNumberOnly{} + return &this +} + +// NewArrayOfNumberOnlyWithDefaults instantiates a new ArrayOfNumberOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArrayOfNumberOnlyWithDefaults() *ArrayOfNumberOnly { + this := ArrayOfNumberOnly{} + return &this +} + +// GetArrayNumber returns the ArrayNumber field value if set, zero value otherwise. +func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { + if o == nil || o.ArrayNumber == nil { + var ret []float32 + return ret + } + return *o.ArrayNumber +} + +// GetArrayNumberOk returns a tuple with the ArrayNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfNumberOnly) GetArrayNumberOk() (*[]float32, bool) { + if o == nil || o.ArrayNumber == nil { + return nil, false + } + return o.ArrayNumber, true +} + +// HasArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfNumberOnly) HasArrayNumber() bool { + if o != nil && o.ArrayNumber != nil { + return true + } + + return false +} + +// SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. +func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { + o.ArrayNumber = &v +} + +func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayNumber != nil { + toSerialize["ArrayNumber"] = o.ArrayNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *ArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) { + varArrayOfNumberOnly := _ArrayOfNumberOnly{} + + if err = json.Unmarshal(bytes, &varArrayOfNumberOnly); err == nil { + *o = ArrayOfNumberOnly(varArrayOfNumberOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ArrayNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableArrayOfNumberOnly struct { + value *ArrayOfNumberOnly + isSet bool +} + +func (v NullableArrayOfNumberOnly) Get() *ArrayOfNumberOnly { + return v.value +} + +func (v *NullableArrayOfNumberOnly) Set(val *ArrayOfNumberOnly) { + v.value = val + v.isSet = true +} + +func (v NullableArrayOfNumberOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayOfNumberOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayOfNumberOnly(val *ArrayOfNumberOnly) *NullableArrayOfNumberOnly { + return &NullableArrayOfNumberOnly{value: val, isSet: true} +} + +func (v NullableArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayOfNumberOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go index 2ea7b84212b..40428c66d45 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_array_test_.go @@ -8,9 +8,206 @@ */ package petstore + +import ( + "encoding/json" +) + // ArrayTest struct for ArrayTest type ArrayTest struct { - ArrayOfString []string `json:"array_of_string,omitempty"` - ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` - ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + ArrayOfString *[]string `json:"array_of_string,omitempty"` + ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` + ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + AdditionalProperties map[string]interface{} } + +type _ArrayTest ArrayTest + +// NewArrayTest instantiates a new ArrayTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArrayTest() *ArrayTest { + this := ArrayTest{} + return &this +} + +// NewArrayTestWithDefaults instantiates a new ArrayTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewArrayTestWithDefaults() *ArrayTest { + this := ArrayTest{} + return &this +} + +// GetArrayOfString returns the ArrayOfString field value if set, zero value otherwise. +func (o *ArrayTest) GetArrayOfString() []string { + if o == nil || o.ArrayOfString == nil { + var ret []string + return ret + } + return *o.ArrayOfString +} + +// GetArrayOfStringOk returns a tuple with the ArrayOfString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayOfStringOk() (*[]string, bool) { + if o == nil || o.ArrayOfString == nil { + return nil, false + } + return o.ArrayOfString, true +} + +// HasArrayOfString returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayOfString() bool { + if o != nil && o.ArrayOfString != nil { + return true + } + + return false +} + +// SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. +func (o *ArrayTest) SetArrayOfString(v []string) { + o.ArrayOfString = &v +} + +// GetArrayArrayOfInteger returns the ArrayArrayOfInteger field value if set, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { + if o == nil || o.ArrayArrayOfInteger == nil { + var ret [][]int64 + return ret + } + return *o.ArrayArrayOfInteger +} + +// GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfIntegerOk() (*[][]int64, bool) { + if o == nil || o.ArrayArrayOfInteger == nil { + return nil, false + } + return o.ArrayArrayOfInteger, true +} + +// HasArrayArrayOfInteger returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfInteger() bool { + if o != nil && o.ArrayArrayOfInteger != nil { + return true + } + + return false +} + +// SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. +func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { + o.ArrayArrayOfInteger = &v +} + +// GetArrayArrayOfModel returns the ArrayArrayOfModel field value if set, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { + if o == nil || o.ArrayArrayOfModel == nil { + var ret [][]ReadOnlyFirst + return ret + } + return *o.ArrayArrayOfModel +} + +// GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfModelOk() (*[][]ReadOnlyFirst, bool) { + if o == nil || o.ArrayArrayOfModel == nil { + return nil, false + } + return o.ArrayArrayOfModel, true +} + +// HasArrayArrayOfModel returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfModel() bool { + if o != nil && o.ArrayArrayOfModel != nil { + return true + } + + return false +} + +// SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. +func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { + o.ArrayArrayOfModel = &v +} + +func (o ArrayTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayOfString != nil { + toSerialize["array_of_string"] = o.ArrayOfString + } + if o.ArrayArrayOfInteger != nil { + toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger + } + if o.ArrayArrayOfModel != nil { + toSerialize["array_array_of_model"] = o.ArrayArrayOfModel + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *ArrayTest) UnmarshalJSON(bytes []byte) (err error) { + varArrayTest := _ArrayTest{} + + if err = json.Unmarshal(bytes, &varArrayTest); err == nil { + *o = ArrayTest(varArrayTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "array_of_string") + delete(additionalProperties, "array_array_of_integer") + delete(additionalProperties, "array_array_of_model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableArrayTest struct { + value *ArrayTest + isSet bool +} + +func (v NullableArrayTest) Get() *ArrayTest { + return v.value +} + +func (v *NullableArrayTest) Set(val *ArrayTest) { + v.value = val + v.isSet = true +} + +func (v NullableArrayTest) IsSet() bool { + return v.isSet +} + +func (v *NullableArrayTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArrayTest(val *ArrayTest) *NullableArrayTest { + return &NullableArrayTest{value: val, isSet: true} +} + +func (v NullableArrayTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArrayTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana.go b/samples/openapi3/client/petstore/go/go-petstore/model_banana.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana.go rename to samples/openapi3/client/petstore/go/go-petstore/model_banana.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_banana_req.go rename to samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go index 97d5a4733f2..8cf8aa20b0d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_capitalization.go @@ -8,13 +8,318 @@ */ package petstore + +import ( + "encoding/json" +) + // Capitalization struct for Capitalization type Capitalization struct { - SmallCamel string `json:"smallCamel,omitempty"` - CapitalCamel string `json:"CapitalCamel,omitempty"` - SmallSnake string `json:"small_Snake,omitempty"` - CapitalSnake string `json:"Capital_Snake,omitempty"` - SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"` + SmallCamel *string `json:"smallCamel,omitempty"` + CapitalCamel *string `json:"CapitalCamel,omitempty"` + SmallSnake *string `json:"small_Snake,omitempty"` + CapitalSnake *string `json:"Capital_Snake,omitempty"` + SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` // Name of the pet - ATT_NAME string `json:"ATT_NAME,omitempty"` + ATT_NAME *string `json:"ATT_NAME,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Capitalization Capitalization + +// NewCapitalization instantiates a new Capitalization object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapitalization() *Capitalization { + this := Capitalization{} + return &this +} + +// NewCapitalizationWithDefaults instantiates a new Capitalization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapitalizationWithDefaults() *Capitalization { + this := Capitalization{} + return &this +} + +// GetSmallCamel returns the SmallCamel field value if set, zero value otherwise. +func (o *Capitalization) GetSmallCamel() string { + if o == nil || o.SmallCamel == nil { + var ret string + return ret + } + return *o.SmallCamel +} + +// GetSmallCamelOk returns a tuple with the SmallCamel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallCamelOk() (*string, bool) { + if o == nil || o.SmallCamel == nil { + return nil, false + } + return o.SmallCamel, true +} + +// HasSmallCamel returns a boolean if a field has been set. +func (o *Capitalization) HasSmallCamel() bool { + if o != nil && o.SmallCamel != nil { + return true + } + + return false +} + +// SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. +func (o *Capitalization) SetSmallCamel(v string) { + o.SmallCamel = &v +} + +// GetCapitalCamel returns the CapitalCamel field value if set, zero value otherwise. +func (o *Capitalization) GetCapitalCamel() string { + if o == nil || o.CapitalCamel == nil { + var ret string + return ret + } + return *o.CapitalCamel +} + +// GetCapitalCamelOk returns a tuple with the CapitalCamel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalCamelOk() (*string, bool) { + if o == nil || o.CapitalCamel == nil { + return nil, false + } + return o.CapitalCamel, true +} + +// HasCapitalCamel returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalCamel() bool { + if o != nil && o.CapitalCamel != nil { + return true + } + + return false +} + +// SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. +func (o *Capitalization) SetCapitalCamel(v string) { + o.CapitalCamel = &v +} + +// GetSmallSnake returns the SmallSnake field value if set, zero value otherwise. +func (o *Capitalization) GetSmallSnake() string { + if o == nil || o.SmallSnake == nil { + var ret string + return ret + } + return *o.SmallSnake +} + +// GetSmallSnakeOk returns a tuple with the SmallSnake field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallSnakeOk() (*string, bool) { + if o == nil || o.SmallSnake == nil { + return nil, false + } + return o.SmallSnake, true +} + +// HasSmallSnake returns a boolean if a field has been set. +func (o *Capitalization) HasSmallSnake() bool { + if o != nil && o.SmallSnake != nil { + return true + } + + return false +} + +// SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. +func (o *Capitalization) SetSmallSnake(v string) { + o.SmallSnake = &v +} + +// GetCapitalSnake returns the CapitalSnake field value if set, zero value otherwise. +func (o *Capitalization) GetCapitalSnake() string { + if o == nil || o.CapitalSnake == nil { + var ret string + return ret + } + return *o.CapitalSnake +} + +// GetCapitalSnakeOk returns a tuple with the CapitalSnake field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalSnakeOk() (*string, bool) { + if o == nil || o.CapitalSnake == nil { + return nil, false + } + return o.CapitalSnake, true +} + +// HasCapitalSnake returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalSnake() bool { + if o != nil && o.CapitalSnake != nil { + return true + } + + return false +} + +// SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. +func (o *Capitalization) SetCapitalSnake(v string) { + o.CapitalSnake = &v +} + +// GetSCAETHFlowPoints returns the SCAETHFlowPoints field value if set, zero value otherwise. +func (o *Capitalization) GetSCAETHFlowPoints() string { + if o == nil || o.SCAETHFlowPoints == nil { + var ret string + return ret + } + return *o.SCAETHFlowPoints +} + +// GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSCAETHFlowPointsOk() (*string, bool) { + if o == nil || o.SCAETHFlowPoints == nil { + return nil, false + } + return o.SCAETHFlowPoints, true +} + +// HasSCAETHFlowPoints returns a boolean if a field has been set. +func (o *Capitalization) HasSCAETHFlowPoints() bool { + if o != nil && o.SCAETHFlowPoints != nil { + return true + } + + return false +} + +// SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. +func (o *Capitalization) SetSCAETHFlowPoints(v string) { + o.SCAETHFlowPoints = &v +} + +// GetATT_NAME returns the ATT_NAME field value if set, zero value otherwise. +func (o *Capitalization) GetATT_NAME() string { + if o == nil || o.ATT_NAME == nil { + var ret string + return ret + } + return *o.ATT_NAME +} + +// GetATT_NAMEOk returns a tuple with the ATT_NAME field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetATT_NAMEOk() (*string, bool) { + if o == nil || o.ATT_NAME == nil { + return nil, false + } + return o.ATT_NAME, true +} + +// HasATT_NAME returns a boolean if a field has been set. +func (o *Capitalization) HasATT_NAME() bool { + if o != nil && o.ATT_NAME != nil { + return true + } + + return false +} + +// SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. +func (o *Capitalization) SetATT_NAME(v string) { + o.ATT_NAME = &v +} + +func (o Capitalization) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SmallCamel != nil { + toSerialize["smallCamel"] = o.SmallCamel + } + if o.CapitalCamel != nil { + toSerialize["CapitalCamel"] = o.CapitalCamel + } + if o.SmallSnake != nil { + toSerialize["small_Snake"] = o.SmallSnake + } + if o.CapitalSnake != nil { + toSerialize["Capital_Snake"] = o.CapitalSnake + } + if o.SCAETHFlowPoints != nil { + toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints + } + if o.ATT_NAME != nil { + toSerialize["ATT_NAME"] = o.ATT_NAME + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Capitalization) UnmarshalJSON(bytes []byte) (err error) { + varCapitalization := _Capitalization{} + + if err = json.Unmarshal(bytes, &varCapitalization); err == nil { + *o = Capitalization(varCapitalization) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "smallCamel") + delete(additionalProperties, "CapitalCamel") + delete(additionalProperties, "small_Snake") + delete(additionalProperties, "Capital_Snake") + delete(additionalProperties, "SCA_ETH_Flow_Points") + delete(additionalProperties, "ATT_NAME") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapitalization struct { + value *Capitalization + isSet bool +} + +func (v NullableCapitalization) Get() *Capitalization { + return v.value +} + +func (v *NullableCapitalization) Set(val *Capitalization) { + v.value = val + v.isSet = true +} + +func (v NullableCapitalization) IsSet() bool { + return v.isSet +} + +func (v *NullableCapitalization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapitalization(val *Capitalization) *NullableCapitalization { + return &NullableCapitalization{value: val, isSet: true} +} + +func (v NullableCapitalization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapitalization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go index 54374bcfebb..5bd129f1f76 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go @@ -8,9 +8,180 @@ */ package petstore + +import ( + "encoding/json" + "reflect" + "strings" +) + // Cat struct for Cat type Cat struct { - ClassName string `json:"className"` - Color string `json:"color,omitempty"` - Declawed bool `json:"declawed,omitempty"` + Animal + Declawed *bool `json:"declawed,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Cat Cat + +// NewCat instantiates a new Cat object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCat() *Cat { + this := Cat{} + return &this +} + +// NewCatWithDefaults instantiates a new Cat object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCatWithDefaults() *Cat { + this := Cat{} + return &this +} + +// GetDeclawed returns the Declawed field value if set, zero value otherwise. +func (o *Cat) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetDeclawedOk() (*bool, bool) { + if o == nil || o.Declawed == nil { + return nil, false + } + return o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *Cat) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *Cat) SetDeclawed(v bool) { + o.Declawed = &v +} + +func (o Cat) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + serializedAnimal, errAnimal := json.Marshal(o.Animal) + if errAnimal != nil { + return []byte{}, errAnimal + } + errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) + if errAnimal != nil { + return []byte{}, errAnimal + } + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Cat) UnmarshalJSON(bytes []byte) (err error) { + type CatWithoutEmbeddedStruct struct { + Declawed *bool `json:"declawed,omitempty"` + } + + varCatWithoutEmbeddedStruct := CatWithoutEmbeddedStruct{} + + err = json.Unmarshal(bytes, &varCatWithoutEmbeddedStruct) + if err == nil { + varCat := _Cat{} + varCat.Declawed = varCatWithoutEmbeddedStruct.Declawed + *o = Cat(varCat) + } else { + return err + } + + varCat := _Cat{} + + err = json.Unmarshal(bytes, &varCat) + if err == nil { + o.Animal = varCat.Animal + } else { + return err + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "declawed") + + // remove fields from embedded structs + reflectAnimal := reflect.ValueOf(o.Animal) + for i := 0; i < reflectAnimal.Type().NumField(); i++ { + t := reflectAnimal.Type().Field(i) + + if jsonTag := t.Tag.Get("json"); jsonTag != "" { + fieldName := "" + if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { + fieldName = jsonTag[:commaIdx] + } else { + fieldName = jsonTag + } + if fieldName != "AdditionalProperties" { + delete(additionalProperties, fieldName) + } + } + } + + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCat struct { + value *Cat + isSet bool +} + +func (v NullableCat) Get() *Cat { + return v.value +} + +func (v *NullableCat) Set(val *Cat) { + v.value = val + v.isSet = true +} + +func (v NullableCat) IsSet() bool { + return v.isSet +} + +func (v *NullableCat) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCat(val *Cat) *NullableCat { + return &NullableCat{value: val, isSet: true} +} + +func (v NullableCat) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCat) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go index b7550adb91a..ba8ba01e4eb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat_all_of.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // CatAllOf struct for CatAllOf type CatAllOf struct { - Declawed bool `json:"declawed,omitempty"` + Declawed *bool `json:"declawed,omitempty"` + AdditionalProperties map[string]interface{} } + +type _CatAllOf CatAllOf + +// NewCatAllOf instantiates a new CatAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCatAllOf() *CatAllOf { + this := CatAllOf{} + return &this +} + +// NewCatAllOfWithDefaults instantiates a new CatAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCatAllOfWithDefaults() *CatAllOf { + this := CatAllOf{} + return &this +} + +// GetDeclawed returns the Declawed field value if set, zero value otherwise. +func (o *CatAllOf) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CatAllOf) GetDeclawedOk() (*bool, bool) { + if o == nil || o.Declawed == nil { + return nil, false + } + return o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *CatAllOf) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *CatAllOf) SetDeclawed(v bool) { + o.Declawed = &v +} + +func (o CatAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *CatAllOf) UnmarshalJSON(bytes []byte) (err error) { + varCatAllOf := _CatAllOf{} + + if err = json.Unmarshal(bytes, &varCatAllOf); err == nil { + *o = CatAllOf(varCatAllOf) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "declawed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCatAllOf struct { + value *CatAllOf + isSet bool +} + +func (v NullableCatAllOf) Get() *CatAllOf { + return v.value +} + +func (v *NullableCatAllOf) Set(val *CatAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableCatAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableCatAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCatAllOf(val *CatAllOf) *NullableCatAllOf { + return &NullableCatAllOf{value: val, isSet: true} +} + +func (v NullableCatAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCatAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_category.go b/samples/openapi3/client/petstore/go/go-petstore/model_category.go index 104410a316a..6844fcaa2a6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_category.go @@ -8,8 +8,164 @@ */ package petstore + +import ( + "encoding/json" +) + // Category struct for Category type Category struct { - Id int64 `json:"id,omitempty"` + Id *int64 `json:"id,omitempty"` Name string `json:"name"` + AdditionalProperties map[string]interface{} } + +type _Category Category + +// NewCategory instantiates a new Category object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCategory(name string, ) *Category { + this := Category{} + this.Name = name + return &this +} + +// NewCategoryWithDefaults instantiates a new Category object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCategoryWithDefaults() *Category { + this := Category{} + var name string = "default-name" + this.Name = name + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Category) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Category) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Category) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Category) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field value +func (o *Category) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Category) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Category) SetName(v string) { + o.Name = v +} + +func (o Category) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if true { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Category) UnmarshalJSON(bytes []byte) (err error) { + varCategory := _Category{} + + if err = json.Unmarshal(bytes, &varCategory); err == nil { + *o = Category(varCategory) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCategory struct { + value *Category + isSet bool +} + +func (v NullableCategory) Get() *Category { + return v.value +} + +func (v *NullableCategory) Set(val *Category) { + v.value = val + v.isSet = true +} + +func (v NullableCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCategory(val *Category) *NullableCategory { + return &NullableCategory{value: val, isSet: true} +} + +func (v NullableCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go index c87910e3dc6..dd0e8da5128 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_class_model.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // ClassModel Model for testing model with \"_class\" property type ClassModel struct { - Class string `json:"_class,omitempty"` + Class *string `json:"_class,omitempty"` + AdditionalProperties map[string]interface{} } + +type _ClassModel ClassModel + +// NewClassModel instantiates a new ClassModel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClassModel() *ClassModel { + this := ClassModel{} + return &this +} + +// NewClassModelWithDefaults instantiates a new ClassModel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClassModelWithDefaults() *ClassModel { + this := ClassModel{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *ClassModel) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ClassModel) GetClassOk() (*string, bool) { + if o == nil || o.Class == nil { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *ClassModel) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *ClassModel) SetClass(v string) { + o.Class = &v +} + +func (o ClassModel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Class != nil { + toSerialize["_class"] = o.Class + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *ClassModel) UnmarshalJSON(bytes []byte) (err error) { + varClassModel := _ClassModel{} + + if err = json.Unmarshal(bytes, &varClassModel); err == nil { + *o = ClassModel(varClassModel) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "_class") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClassModel struct { + value *ClassModel + isSet bool +} + +func (v NullableClassModel) Get() *ClassModel { + return v.value +} + +func (v *NullableClassModel) Set(val *ClassModel) { + v.value = val + v.isSet = true +} + +func (v NullableClassModel) IsSet() bool { + return v.isSet +} + +func (v *NullableClassModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClassModel(val *ClassModel) *NullableClassModel { + return &NullableClassModel{value: val, isSet: true} +} + +func (v NullableClassModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClassModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_client.go b/samples/openapi3/client/petstore/go/go-petstore/model_client.go index f7c449d2bc6..4fa9c5c9613 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_client.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_client.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // Client struct for Client type Client struct { - Client string `json:"client,omitempty"` + Client *string `json:"client,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Client Client + +// NewClient instantiates a new Client object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewClient() *Client { + this := Client{} + return &this +} + +// NewClientWithDefaults instantiates a new Client object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewClientWithDefaults() *Client { + this := Client{} + return &this +} + +// GetClient returns the Client field value if set, zero value otherwise. +func (o *Client) GetClient() string { + if o == nil || o.Client == nil { + var ret string + return ret + } + return *o.Client +} + +// GetClientOk returns a tuple with the Client field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Client) GetClientOk() (*string, bool) { + if o == nil || o.Client == nil { + return nil, false + } + return o.Client, true +} + +// HasClient returns a boolean if a field has been set. +func (o *Client) HasClient() bool { + if o != nil && o.Client != nil { + return true + } + + return false +} + +// SetClient gets a reference to the given string and assigns it to the Client field. +func (o *Client) SetClient(v string) { + o.Client = &v +} + +func (o Client) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Client != nil { + toSerialize["client"] = o.Client + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Client) UnmarshalJSON(bytes []byte) (err error) { + varClient := _Client{} + + if err = json.Unmarshal(bytes, &varClient); err == nil { + *o = Client(varClient) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "client") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableClient struct { + value *Client + isSet bool +} + +func (v NullableClient) Get() *Client { + return v.value +} + +func (v *NullableClient) Set(val *Client) { + v.value = val + v.isSet = true +} + +func (v NullableClient) IsSet() bool { + return v.isSet +} + +func (v *NullableClient) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClient(val *Client) *NullableClient { + return &NullableClient{value: val, isSet: true} +} + +func (v NullableClient) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClient) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go index 6bc685afe29..b3a1dcf1a6b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go @@ -8,9 +8,180 @@ */ package petstore + +import ( + "encoding/json" + "reflect" + "strings" +) + // Dog struct for Dog type Dog struct { - ClassName string `json:"className"` - Color string `json:"color,omitempty"` - Breed string `json:"breed,omitempty"` + Animal + Breed *string `json:"breed,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Dog Dog + +// NewDog instantiates a new Dog object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDog() *Dog { + this := Dog{} + return &this +} + +// NewDogWithDefaults instantiates a new Dog object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDogWithDefaults() *Dog { + this := Dog{} + return &this +} + +// GetBreed returns the Breed field value if set, zero value otherwise. +func (o *Dog) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetBreedOk() (*string, bool) { + if o == nil || o.Breed == nil { + return nil, false + } + return o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *Dog) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *Dog) SetBreed(v string) { + o.Breed = &v +} + +func (o Dog) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + serializedAnimal, errAnimal := json.Marshal(o.Animal) + if errAnimal != nil { + return []byte{}, errAnimal + } + errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize) + if errAnimal != nil { + return []byte{}, errAnimal + } + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Dog) UnmarshalJSON(bytes []byte) (err error) { + type DogWithoutEmbeddedStruct struct { + Breed *string `json:"breed,omitempty"` + } + + varDogWithoutEmbeddedStruct := DogWithoutEmbeddedStruct{} + + err = json.Unmarshal(bytes, &varDogWithoutEmbeddedStruct) + if err == nil { + varDog := _Dog{} + varDog.Breed = varDogWithoutEmbeddedStruct.Breed + *o = Dog(varDog) + } else { + return err + } + + varDog := _Dog{} + + err = json.Unmarshal(bytes, &varDog) + if err == nil { + o.Animal = varDog.Animal + } else { + return err + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "breed") + + // remove fields from embedded structs + reflectAnimal := reflect.ValueOf(o.Animal) + for i := 0; i < reflectAnimal.Type().NumField(); i++ { + t := reflectAnimal.Type().Field(i) + + if jsonTag := t.Tag.Get("json"); jsonTag != "" { + fieldName := "" + if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 { + fieldName = jsonTag[:commaIdx] + } else { + fieldName = jsonTag + } + if fieldName != "AdditionalProperties" { + delete(additionalProperties, fieldName) + } + } + } + + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDog struct { + value *Dog + isSet bool +} + +func (v NullableDog) Get() *Dog { + return v.value +} + +func (v *NullableDog) Set(val *Dog) { + v.value = val + v.isSet = true +} + +func (v NullableDog) IsSet() bool { + return v.isSet +} + +func (v *NullableDog) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDog(val *Dog) *NullableDog { + return &NullableDog{value: val, isSet: true} +} + +func (v NullableDog) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDog) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go index 758c5cc45f7..5a63ff7ab1f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog_all_of.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // DogAllOf struct for DogAllOf type DogAllOf struct { - Breed string `json:"breed,omitempty"` + Breed *string `json:"breed,omitempty"` + AdditionalProperties map[string]interface{} } + +type _DogAllOf DogAllOf + +// NewDogAllOf instantiates a new DogAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDogAllOf() *DogAllOf { + this := DogAllOf{} + return &this +} + +// NewDogAllOfWithDefaults instantiates a new DogAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDogAllOfWithDefaults() *DogAllOf { + this := DogAllOf{} + return &this +} + +// GetBreed returns the Breed field value if set, zero value otherwise. +func (o *DogAllOf) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DogAllOf) GetBreedOk() (*string, bool) { + if o == nil || o.Breed == nil { + return nil, false + } + return o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *DogAllOf) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *DogAllOf) SetBreed(v string) { + o.Breed = &v +} + +func (o DogAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *DogAllOf) UnmarshalJSON(bytes []byte) (err error) { + varDogAllOf := _DogAllOf{} + + if err = json.Unmarshal(bytes, &varDogAllOf); err == nil { + *o = DogAllOf(varDogAllOf) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "breed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDogAllOf struct { + value *DogAllOf + isSet bool +} + +func (v NullableDogAllOf) Get() *DogAllOf { + return v.value +} + +func (v *NullableDogAllOf) Set(val *DogAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableDogAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableDogAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDogAllOf(val *DogAllOf) *NullableDogAllOf { + return &NullableDogAllOf{value: val, isSet: true} +} + +func (v NullableDogAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDogAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go index 64df54568b4..5db0ec9b52b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_arrays.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // EnumArrays struct for EnumArrays type EnumArrays struct { - JustSymbol string `json:"just_symbol,omitempty"` - ArrayEnum []string `json:"array_enum,omitempty"` + JustSymbol *string `json:"just_symbol,omitempty"` + ArrayEnum *[]string `json:"array_enum,omitempty"` + AdditionalProperties map[string]interface{} } + +type _EnumArrays EnumArrays + +// NewEnumArrays instantiates a new EnumArrays object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnumArrays() *EnumArrays { + this := EnumArrays{} + return &this +} + +// NewEnumArraysWithDefaults instantiates a new EnumArrays object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnumArraysWithDefaults() *EnumArrays { + this := EnumArrays{} + return &this +} + +// GetJustSymbol returns the JustSymbol field value if set, zero value otherwise. +func (o *EnumArrays) GetJustSymbol() string { + if o == nil || o.JustSymbol == nil { + var ret string + return ret + } + return *o.JustSymbol +} + +// GetJustSymbolOk returns a tuple with the JustSymbol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetJustSymbolOk() (*string, bool) { + if o == nil || o.JustSymbol == nil { + return nil, false + } + return o.JustSymbol, true +} + +// HasJustSymbol returns a boolean if a field has been set. +func (o *EnumArrays) HasJustSymbol() bool { + if o != nil && o.JustSymbol != nil { + return true + } + + return false +} + +// SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. +func (o *EnumArrays) SetJustSymbol(v string) { + o.JustSymbol = &v +} + +// GetArrayEnum returns the ArrayEnum field value if set, zero value otherwise. +func (o *EnumArrays) GetArrayEnum() []string { + if o == nil || o.ArrayEnum == nil { + var ret []string + return ret + } + return *o.ArrayEnum +} + +// GetArrayEnumOk returns a tuple with the ArrayEnum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetArrayEnumOk() (*[]string, bool) { + if o == nil || o.ArrayEnum == nil { + return nil, false + } + return o.ArrayEnum, true +} + +// HasArrayEnum returns a boolean if a field has been set. +func (o *EnumArrays) HasArrayEnum() bool { + if o != nil && o.ArrayEnum != nil { + return true + } + + return false +} + +// SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. +func (o *EnumArrays) SetArrayEnum(v []string) { + o.ArrayEnum = &v +} + +func (o EnumArrays) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustSymbol != nil { + toSerialize["just_symbol"] = o.JustSymbol + } + if o.ArrayEnum != nil { + toSerialize["array_enum"] = o.ArrayEnum + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *EnumArrays) UnmarshalJSON(bytes []byte) (err error) { + varEnumArrays := _EnumArrays{} + + if err = json.Unmarshal(bytes, &varEnumArrays); err == nil { + *o = EnumArrays(varEnumArrays) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "just_symbol") + delete(additionalProperties, "array_enum") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnumArrays struct { + value *EnumArrays + isSet bool +} + +func (v NullableEnumArrays) Get() *EnumArrays { + return v.value +} + +func (v *NullableEnumArrays) Set(val *EnumArrays) { + v.value = val + v.isSet = true +} + +func (v NullableEnumArrays) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumArrays) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumArrays(val *EnumArrays) *NullableEnumArrays { + return &NullableEnumArrays{value: val, isSet: true} +} + +func (v NullableEnumArrays) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumArrays) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go index 7470d644d0a..9c03714608c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // EnumClass the model 'EnumClass' type EnumClass string @@ -17,3 +23,62 @@ const ( ENUMCLASS_EFG EnumClass = "-efg" ENUMCLASS_XYZ EnumClass = "(xyz)" ) + +func (v *EnumClass) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumClass(value) + for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumClass", value) +} + +// Ptr returns reference to EnumClass value +func (v EnumClass) Ptr() *EnumClass { + return &v +} + +type NullableEnumClass struct { + value *EnumClass + isSet bool +} + +func (v NullableEnumClass) Get() *EnumClass { + return v.value +} + +func (v *NullableEnumClass) Set(val *EnumClass) { + v.value = val + v.isSet = true +} + +func (v NullableEnumClass) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumClass(val *EnumClass) *NullableEnumClass { + return &NullableEnumClass{value: val, isSet: true} +} + +func (v NullableEnumClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go index 2ade64ebee9..bc208327afa 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go @@ -8,14 +8,402 @@ */ package petstore + +import ( + "encoding/json" +) + // EnumTest struct for EnumTest type EnumTest struct { - EnumString string `json:"enum_string,omitempty"` + EnumString *string `json:"enum_string,omitempty"` EnumStringRequired string `json:"enum_string_required"` - EnumInteger int32 `json:"enum_integer,omitempty"` - EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum *OuterEnum `json:"outerEnum,omitempty"` - OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` - OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` - OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` + EnumInteger *int32 `json:"enum_integer,omitempty"` + EnumNumber *float64 `json:"enum_number,omitempty"` + OuterEnum NullableOuterEnum `json:"outerEnum,omitempty"` + OuterEnumInteger *OuterEnumInteger `json:"outerEnumInteger,omitempty"` + OuterEnumDefaultValue *OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` + OuterEnumIntegerDefaultValue *OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` + AdditionalProperties map[string]interface{} } + +type _EnumTest EnumTest + +// NewEnumTest instantiates a new EnumTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnumTest(enumStringRequired string, ) *EnumTest { + this := EnumTest{} + this.EnumStringRequired = enumStringRequired + var outerEnumDefaultValue OuterEnumDefaultValue = "placed" + this.OuterEnumDefaultValue = &outerEnumDefaultValue + var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 + this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue + return &this +} + +// NewEnumTestWithDefaults instantiates a new EnumTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnumTestWithDefaults() *EnumTest { + this := EnumTest{} + var outerEnumDefaultValue OuterEnumDefaultValue = "placed" + this.OuterEnumDefaultValue = &outerEnumDefaultValue + var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 + this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue + return &this +} + +// GetEnumString returns the EnumString field value if set, zero value otherwise. +func (o *EnumTest) GetEnumString() string { + if o == nil || o.EnumString == nil { + var ret string + return ret + } + return *o.EnumString +} + +// GetEnumStringOk returns a tuple with the EnumString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringOk() (*string, bool) { + if o == nil || o.EnumString == nil { + return nil, false + } + return o.EnumString, true +} + +// HasEnumString returns a boolean if a field has been set. +func (o *EnumTest) HasEnumString() bool { + if o != nil && o.EnumString != nil { + return true + } + + return false +} + +// SetEnumString gets a reference to the given string and assigns it to the EnumString field. +func (o *EnumTest) SetEnumString(v string) { + o.EnumString = &v +} + +// GetEnumStringRequired returns the EnumStringRequired field value +func (o *EnumTest) GetEnumStringRequired() string { + if o == nil { + var ret string + return ret + } + + return o.EnumStringRequired +} + +// GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field value +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringRequiredOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EnumStringRequired, true +} + +// SetEnumStringRequired sets field value +func (o *EnumTest) SetEnumStringRequired(v string) { + o.EnumStringRequired = v +} + +// GetEnumInteger returns the EnumInteger field value if set, zero value otherwise. +func (o *EnumTest) GetEnumInteger() int32 { + if o == nil || o.EnumInteger == nil { + var ret int32 + return ret + } + return *o.EnumInteger +} + +// GetEnumIntegerOk returns a tuple with the EnumInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumIntegerOk() (*int32, bool) { + if o == nil || o.EnumInteger == nil { + return nil, false + } + return o.EnumInteger, true +} + +// HasEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasEnumInteger() bool { + if o != nil && o.EnumInteger != nil { + return true + } + + return false +} + +// SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. +func (o *EnumTest) SetEnumInteger(v int32) { + o.EnumInteger = &v +} + +// GetEnumNumber returns the EnumNumber field value if set, zero value otherwise. +func (o *EnumTest) GetEnumNumber() float64 { + if o == nil || o.EnumNumber == nil { + var ret float64 + return ret + } + return *o.EnumNumber +} + +// GetEnumNumberOk returns a tuple with the EnumNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumNumberOk() (*float64, bool) { + if o == nil || o.EnumNumber == nil { + return nil, false + } + return o.EnumNumber, true +} + +// HasEnumNumber returns a boolean if a field has been set. +func (o *EnumTest) HasEnumNumber() bool { + if o != nil && o.EnumNumber != nil { + return true + } + + return false +} + +// SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. +func (o *EnumTest) SetEnumNumber(v float64) { + o.EnumNumber = &v +} + +// GetOuterEnum returns the OuterEnum field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnumTest) GetOuterEnum() OuterEnum { + if o == nil || o.OuterEnum.Get() == nil { + var ret OuterEnum + return ret + } + return *o.OuterEnum.Get() +} + +// GetOuterEnumOk returns a tuple with the OuterEnum field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EnumTest) GetOuterEnumOk() (*OuterEnum, bool) { + if o == nil { + return nil, false + } + return o.OuterEnum.Get(), o.OuterEnum.IsSet() +} + +// HasOuterEnum returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnum() bool { + if o != nil && o.OuterEnum.IsSet() { + return true + } + + return false +} + +// SetOuterEnum gets a reference to the given NullableOuterEnum and assigns it to the OuterEnum field. +func (o *EnumTest) SetOuterEnum(v OuterEnum) { + o.OuterEnum.Set(&v) +} +// SetOuterEnumNil sets the value for OuterEnum to be an explicit nil +func (o *EnumTest) SetOuterEnumNil() { + o.OuterEnum.Set(nil) +} + +// UnsetOuterEnum ensures that no value is present for OuterEnum, not even an explicit nil +func (o *EnumTest) UnsetOuterEnum() { + o.OuterEnum.Unset() +} + +// GetOuterEnumInteger returns the OuterEnumInteger field value if set, zero value otherwise. +func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger { + if o == nil || o.OuterEnumInteger == nil { + var ret OuterEnumInteger + return ret + } + return *o.OuterEnumInteger +} + +// GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumIntegerOk() (*OuterEnumInteger, bool) { + if o == nil || o.OuterEnumInteger == nil { + return nil, false + } + return o.OuterEnumInteger, true +} + +// HasOuterEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumInteger() bool { + if o != nil && o.OuterEnumInteger != nil { + return true + } + + return false +} + +// SetOuterEnumInteger gets a reference to the given OuterEnumInteger and assigns it to the OuterEnumInteger field. +func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger) { + o.OuterEnumInteger = &v +} + +// GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field value if set, zero value otherwise. +func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue { + if o == nil || o.OuterEnumDefaultValue == nil { + var ret OuterEnumDefaultValue + return ret + } + return *o.OuterEnumDefaultValue +} + +// GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumDefaultValueOk() (*OuterEnumDefaultValue, bool) { + if o == nil || o.OuterEnumDefaultValue == nil { + return nil, false + } + return o.OuterEnumDefaultValue, true +} + +// HasOuterEnumDefaultValue returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumDefaultValue() bool { + if o != nil && o.OuterEnumDefaultValue != nil { + return true + } + + return false +} + +// SetOuterEnumDefaultValue gets a reference to the given OuterEnumDefaultValue and assigns it to the OuterEnumDefaultValue field. +func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue) { + o.OuterEnumDefaultValue = &v +} + +// GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field value if set, zero value otherwise. +func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue { + if o == nil || o.OuterEnumIntegerDefaultValue == nil { + var ret OuterEnumIntegerDefaultValue + return ret + } + return *o.OuterEnumIntegerDefaultValue +} + +// GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (*OuterEnumIntegerDefaultValue, bool) { + if o == nil || o.OuterEnumIntegerDefaultValue == nil { + return nil, false + } + return o.OuterEnumIntegerDefaultValue, true +} + +// HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool { + if o != nil && o.OuterEnumIntegerDefaultValue != nil { + return true + } + + return false +} + +// SetOuterEnumIntegerDefaultValue gets a reference to the given OuterEnumIntegerDefaultValue and assigns it to the OuterEnumIntegerDefaultValue field. +func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue) { + o.OuterEnumIntegerDefaultValue = &v +} + +func (o EnumTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumString != nil { + toSerialize["enum_string"] = o.EnumString + } + if true { + toSerialize["enum_string_required"] = o.EnumStringRequired + } + if o.EnumInteger != nil { + toSerialize["enum_integer"] = o.EnumInteger + } + if o.EnumNumber != nil { + toSerialize["enum_number"] = o.EnumNumber + } + if o.OuterEnum.IsSet() { + toSerialize["outerEnum"] = o.OuterEnum.Get() + } + if o.OuterEnumInteger != nil { + toSerialize["outerEnumInteger"] = o.OuterEnumInteger + } + if o.OuterEnumDefaultValue != nil { + toSerialize["outerEnumDefaultValue"] = o.OuterEnumDefaultValue + } + if o.OuterEnumIntegerDefaultValue != nil { + toSerialize["outerEnumIntegerDefaultValue"] = o.OuterEnumIntegerDefaultValue + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) { + varEnumTest := _EnumTest{} + + if err = json.Unmarshal(bytes, &varEnumTest); err == nil { + *o = EnumTest(varEnumTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "enum_string") + delete(additionalProperties, "enum_string_required") + delete(additionalProperties, "enum_integer") + delete(additionalProperties, "enum_number") + delete(additionalProperties, "outerEnum") + delete(additionalProperties, "outerEnumInteger") + delete(additionalProperties, "outerEnumDefaultValue") + delete(additionalProperties, "outerEnumIntegerDefaultValue") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnumTest struct { + value *EnumTest + isSet bool +} + +func (v NullableEnumTest) Get() *EnumTest { + return v.value +} + +func (v *NullableEnumTest) Set(val *EnumTest) { + v.value = val + v.isSet = true +} + +func (v NullableEnumTest) IsSet() bool { + return v.isSet +} + +func (v *NullableEnumTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnumTest(val *EnumTest) *NullableEnumTest { + return &NullableEnumTest{value: val, isSet: true} +} + +func (v NullableEnumTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnumTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file.go b/samples/openapi3/client/petstore/go/go-petstore/model_file.go index b07c65dcc42..edb530ef383 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file.go @@ -8,8 +8,133 @@ */ package petstore + +import ( + "encoding/json" +) + // File Must be named `File` for test. type File struct { // Test capitalization - SourceURI string `json:"sourceURI,omitempty"` + SourceURI *string `json:"sourceURI,omitempty"` + AdditionalProperties map[string]interface{} } + +type _File File + +// NewFile instantiates a new File object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFile() *File { + this := File{} + return &this +} + +// NewFileWithDefaults instantiates a new File object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileWithDefaults() *File { + this := File{} + return &this +} + +// GetSourceURI returns the SourceURI field value if set, zero value otherwise. +func (o *File) GetSourceURI() string { + if o == nil || o.SourceURI == nil { + var ret string + return ret + } + return *o.SourceURI +} + +// GetSourceURIOk returns a tuple with the SourceURI field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *File) GetSourceURIOk() (*string, bool) { + if o == nil || o.SourceURI == nil { + return nil, false + } + return o.SourceURI, true +} + +// HasSourceURI returns a boolean if a field has been set. +func (o *File) HasSourceURI() bool { + if o != nil && o.SourceURI != nil { + return true + } + + return false +} + +// SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. +func (o *File) SetSourceURI(v string) { + o.SourceURI = &v +} + +func (o File) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SourceURI != nil { + toSerialize["sourceURI"] = o.SourceURI + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *File) UnmarshalJSON(bytes []byte) (err error) { + varFile := _File{} + + if err = json.Unmarshal(bytes, &varFile); err == nil { + *o = File(varFile) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "sourceURI") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFile struct { + value *File + isSet bool +} + +func (v NullableFile) Get() *File { + return v.value +} + +func (v *NullableFile) Set(val *File) { + v.value = val + v.isSet = true +} + +func (v NullableFile) IsSet() bool { + return v.isSet +} + +func (v *NullableFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFile(val *File) *NullableFile { + return &NullableFile{value: val, isSet: true} +} + +func (v NullableFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go index 29b051e77a8..389de1c9252 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_file_schema_test_class.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // FileSchemaTestClass struct for FileSchemaTestClass type FileSchemaTestClass struct { - File File `json:"file,omitempty"` - Files []File `json:"files,omitempty"` + File *File `json:"file,omitempty"` + Files *[]File `json:"files,omitempty"` + AdditionalProperties map[string]interface{} } + +type _FileSchemaTestClass FileSchemaTestClass + +// NewFileSchemaTestClass instantiates a new FileSchemaTestClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFileSchemaTestClass() *FileSchemaTestClass { + this := FileSchemaTestClass{} + return &this +} + +// NewFileSchemaTestClassWithDefaults instantiates a new FileSchemaTestClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileSchemaTestClassWithDefaults() *FileSchemaTestClass { + this := FileSchemaTestClass{} + return &this +} + +// GetFile returns the File field value if set, zero value otherwise. +func (o *FileSchemaTestClass) GetFile() File { + if o == nil || o.File == nil { + var ret File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFileOk() (*File, bool) { + if o == nil || o.File == nil { + return nil, false + } + return o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given File and assigns it to the File field. +func (o *FileSchemaTestClass) SetFile(v File) { + o.File = &v +} + +// GetFiles returns the Files field value if set, zero value otherwise. +func (o *FileSchemaTestClass) GetFiles() []File { + if o == nil || o.Files == nil { + var ret []File + return ret + } + return *o.Files +} + +// GetFilesOk returns a tuple with the Files field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFilesOk() (*[]File, bool) { + if o == nil || o.Files == nil { + return nil, false + } + return o.Files, true +} + +// HasFiles returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFiles() bool { + if o != nil && o.Files != nil { + return true + } + + return false +} + +// SetFiles gets a reference to the given []File and assigns it to the Files field. +func (o *FileSchemaTestClass) SetFiles(v []File) { + o.Files = &v +} + +func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.File != nil { + toSerialize["file"] = o.File + } + if o.Files != nil { + toSerialize["files"] = o.Files + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *FileSchemaTestClass) UnmarshalJSON(bytes []byte) (err error) { + varFileSchemaTestClass := _FileSchemaTestClass{} + + if err = json.Unmarshal(bytes, &varFileSchemaTestClass); err == nil { + *o = FileSchemaTestClass(varFileSchemaTestClass) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "file") + delete(additionalProperties, "files") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFileSchemaTestClass struct { + value *FileSchemaTestClass + isSet bool +} + +func (v NullableFileSchemaTestClass) Get() *FileSchemaTestClass { + return v.value +} + +func (v *NullableFileSchemaTestClass) Set(val *FileSchemaTestClass) { + v.value = val + v.isSet = true +} + +func (v NullableFileSchemaTestClass) IsSet() bool { + return v.isSet +} + +func (v *NullableFileSchemaTestClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFileSchemaTestClass(val *FileSchemaTestClass) *NullableFileSchemaTestClass { + return &NullableFileSchemaTestClass{value: val, isSet: true} +} + +func (v NullableFileSchemaTestClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFileSchemaTestClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go/go-petstore/model_foo.go index e4e448f3b3a..d60c4a1c017 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_foo.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_foo.go @@ -8,7 +8,136 @@ */ package petstore + +import ( + "encoding/json" +) + // Foo struct for Foo type Foo struct { - Bar string `json:"bar,omitempty"` + Bar *string `json:"bar,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Foo Foo + +// NewFoo instantiates a new Foo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFoo() *Foo { + this := Foo{} + var bar string = "bar" + this.Bar = &bar + return &this +} + +// NewFooWithDefaults instantiates a new Foo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFooWithDefaults() *Foo { + this := Foo{} + var bar string = "bar" + this.Bar = &bar + return &this +} + +// GetBar returns the Bar field value if set, zero value otherwise. +func (o *Foo) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Foo) GetBarOk() (*string, bool) { + if o == nil || o.Bar == nil { + return nil, false + } + return o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *Foo) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *Foo) SetBar(v string) { + o.Bar = &v +} + +func (o Foo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Foo) UnmarshalJSON(bytes []byte) (err error) { + varFoo := _Foo{} + + if err = json.Unmarshal(bytes, &varFoo); err == nil { + *o = Foo(varFoo) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bar") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFoo struct { + value *Foo + isSet bool +} + +func (v NullableFoo) Get() *Foo { + return v.value +} + +func (v *NullableFoo) Set(val *Foo) { + v.value = val + v.isSet = true +} + +func (v NullableFoo) IsSet() bool { + return v.isSet +} + +func (v *NullableFoo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFoo(val *Foo) *NullableFoo { + return &NullableFoo{value: val, isSet: true} +} + +func (v NullableFoo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFoo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go index 52f04657bcb..bbc76b1285c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go @@ -8,27 +8,626 @@ */ package petstore + import ( + "encoding/json" "os" "time" ) + // FormatTest struct for FormatTest type FormatTest struct { - Integer int32 `json:"integer,omitempty"` - Int32 int32 `json:"int32,omitempty"` - Int64 int64 `json:"int64,omitempty"` + Integer *int32 `json:"integer,omitempty"` + Int32 *int32 `json:"int32,omitempty"` + Int64 *int64 `json:"int64,omitempty"` Number float32 `json:"number"` - Float float32 `json:"float,omitempty"` - Double float64 `json:"double,omitempty"` - String string `json:"string,omitempty"` + Float *float32 `json:"float,omitempty"` + Double *float64 `json:"double,omitempty"` + String *string `json:"string,omitempty"` Byte string `json:"byte"` - Binary *os.File `json:"binary,omitempty"` + Binary **os.File `json:"binary,omitempty"` Date string `json:"date"` - DateTime time.Time `json:"dateTime,omitempty"` - Uuid string `json:"uuid,omitempty"` + DateTime *time.Time `json:"dateTime,omitempty"` + Uuid *string `json:"uuid,omitempty"` Password string `json:"password"` // A string that is a 10 digit number. Can have leading zeros. - PatternWithDigits string `json:"pattern_with_digits,omitempty"` + PatternWithDigits *string `json:"pattern_with_digits,omitempty"` // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - PatternWithDigitsAndDelimiter string `json:"pattern_with_digits_and_delimiter,omitempty"` + PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty"` + AdditionalProperties map[string]interface{} } + +type _FormatTest FormatTest + +// NewFormatTest instantiates a new FormatTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFormatTest(number float32, byte_ string, date string, password string, ) *FormatTest { + this := FormatTest{} + this.Number = number + this.Byte = byte_ + this.Date = date + this.Password = password + return &this +} + +// NewFormatTestWithDefaults instantiates a new FormatTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFormatTestWithDefaults() *FormatTest { + this := FormatTest{} + return &this +} + +// GetInteger returns the Integer field value if set, zero value otherwise. +func (o *FormatTest) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetIntegerOk() (*int32, bool) { + if o == nil || o.Integer == nil { + return nil, false + } + return o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *FormatTest) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *FormatTest) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field value if set, zero value otherwise. +func (o *FormatTest) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt32Ok() (*int32, bool) { + if o == nil || o.Int32 == nil { + return nil, false + } + return o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *FormatTest) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *FormatTest) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field value if set, zero value otherwise. +func (o *FormatTest) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt64Ok() (*int64, bool) { + if o == nil || o.Int64 == nil { + return nil, false + } + return o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *FormatTest) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *FormatTest) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field value +func (o *FormatTest) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *FormatTest) SetNumber(v float32) { + o.Number = v +} + +// GetFloat returns the Float field value if set, zero value otherwise. +func (o *FormatTest) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetFloatOk() (*float32, bool) { + if o == nil || o.Float == nil { + return nil, false + } + return o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *FormatTest) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *FormatTest) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field value if set, zero value otherwise. +func (o *FormatTest) GetDouble() float64 { + if o == nil || o.Double == nil { + var ret float64 + return ret + } + return *o.Double +} + +// GetDoubleOk returns a tuple with the Double field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDoubleOk() (*float64, bool) { + if o == nil || o.Double == nil { + return nil, false + } + return o.Double, true +} + +// HasDouble returns a boolean if a field has been set. +func (o *FormatTest) HasDouble() bool { + if o != nil && o.Double != nil { + return true + } + + return false +} + +// SetDouble gets a reference to the given float64 and assigns it to the Double field. +func (o *FormatTest) SetDouble(v float64) { + o.Double = &v +} + +// GetString returns the String field value if set, zero value otherwise. +func (o *FormatTest) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetStringOk() (*string, bool) { + if o == nil || o.String == nil { + return nil, false + } + return o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *FormatTest) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *FormatTest) SetString(v string) { + o.String = &v +} + +// GetByte returns the Byte field value +func (o *FormatTest) GetByte() string { + if o == nil { + var ret string + return ret + } + + return o.Byte +} + +// GetByteOk returns a tuple with the Byte field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetByteOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Byte, true +} + +// SetByte sets field value +func (o *FormatTest) SetByte(v string) { + o.Byte = v +} + +// GetBinary returns the Binary field value if set, zero value otherwise. +func (o *FormatTest) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetBinaryOk() (**os.File, bool) { + if o == nil || o.Binary == nil { + return nil, false + } + return o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *FormatTest) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *FormatTest) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field value +func (o *FormatTest) GetDate() string { + if o == nil { + var ret string + return ret + } + + return o.Date +} + +// GetDateOk returns a tuple with the Date field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Date, true +} + +// SetDate sets field value +func (o *FormatTest) SetDate(v string) { + o.Date = v +} + +// GetDateTime returns the DateTime field value if set, zero value otherwise. +func (o *FormatTest) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateTimeOk() (*time.Time, bool) { + if o == nil || o.DateTime == nil { + return nil, false + } + return o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *FormatTest) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *FormatTest) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *FormatTest) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetUuidOk() (*string, bool) { + if o == nil || o.Uuid == nil { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *FormatTest) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *FormatTest) SetUuid(v string) { + o.Uuid = &v +} + +// GetPassword returns the Password field value +func (o *FormatTest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *FormatTest) SetPassword(v string) { + o.Password = v +} + +// GetPatternWithDigits returns the PatternWithDigits field value if set, zero value otherwise. +func (o *FormatTest) GetPatternWithDigits() string { + if o == nil || o.PatternWithDigits == nil { + var ret string + return ret + } + return *o.PatternWithDigits +} + +// GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPatternWithDigitsOk() (*string, bool) { + if o == nil || o.PatternWithDigits == nil { + return nil, false + } + return o.PatternWithDigits, true +} + +// HasPatternWithDigits returns a boolean if a field has been set. +func (o *FormatTest) HasPatternWithDigits() bool { + if o != nil && o.PatternWithDigits != nil { + return true + } + + return false +} + +// SetPatternWithDigits gets a reference to the given string and assigns it to the PatternWithDigits field. +func (o *FormatTest) SetPatternWithDigits(v string) { + o.PatternWithDigits = &v +} + +// GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field value if set, zero value otherwise. +func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string { + if o == nil || o.PatternWithDigitsAndDelimiter == nil { + var ret string + return ret + } + return *o.PatternWithDigitsAndDelimiter +} + +// GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (*string, bool) { + if o == nil || o.PatternWithDigitsAndDelimiter == nil { + return nil, false + } + return o.PatternWithDigitsAndDelimiter, true +} + +// HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. +func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool { + if o != nil && o.PatternWithDigitsAndDelimiter != nil { + return true + } + + return false +} + +// SetPatternWithDigitsAndDelimiter gets a reference to the given string and assigns it to the PatternWithDigitsAndDelimiter field. +func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string) { + o.PatternWithDigitsAndDelimiter = &v +} + +func (o FormatTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if true { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if o.Double != nil { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if true { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if true { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if true { + toSerialize["password"] = o.Password + } + if o.PatternWithDigits != nil { + toSerialize["pattern_with_digits"] = o.PatternWithDigits + } + if o.PatternWithDigitsAndDelimiter != nil { + toSerialize["pattern_with_digits_and_delimiter"] = o.PatternWithDigitsAndDelimiter + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) { + varFormatTest := _FormatTest{} + + if err = json.Unmarshal(bytes, &varFormatTest); err == nil { + *o = FormatTest(varFormatTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "integer") + delete(additionalProperties, "int32") + delete(additionalProperties, "int64") + delete(additionalProperties, "number") + delete(additionalProperties, "float") + delete(additionalProperties, "double") + delete(additionalProperties, "string") + delete(additionalProperties, "byte") + delete(additionalProperties, "binary") + delete(additionalProperties, "date") + delete(additionalProperties, "dateTime") + delete(additionalProperties, "uuid") + delete(additionalProperties, "password") + delete(additionalProperties, "pattern_with_digits") + delete(additionalProperties, "pattern_with_digits_and_delimiter") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFormatTest struct { + value *FormatTest + isSet bool +} + +func (v NullableFormatTest) Get() *FormatTest { + return v.value +} + +func (v *NullableFormatTest) Set(val *FormatTest) { + v.value = val + v.isSet = true +} + +func (v NullableFormatTest) IsSet() bool { + return v.isSet +} + +func (v *NullableFormatTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFormatTest(val *FormatTest) *NullableFormatTest { + return &NullableFormatTest{value: val, isSet: true} +} + +func (v NullableFormatTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFormatTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go rename to samples/openapi3/client/petstore/go/go-petstore/model_fruit.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go rename to samples/openapi3/client/petstore/go/go-petstore/model_fruit_req.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_gm_fruit.go b/samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_gm_fruit.go rename to samples/openapi3/client/petstore/go/go-petstore/model_gm_fruit.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go index c0b9818dcdd..4eb331e77eb 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_has_only_read_only.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // HasOnlyReadOnly struct for HasOnlyReadOnly type HasOnlyReadOnly struct { - Bar string `json:"bar,omitempty"` - Foo string `json:"foo,omitempty"` + Bar *string `json:"bar,omitempty"` + Foo *string `json:"foo,omitempty"` + AdditionalProperties map[string]interface{} } + +type _HasOnlyReadOnly HasOnlyReadOnly + +// NewHasOnlyReadOnly instantiates a new HasOnlyReadOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHasOnlyReadOnly() *HasOnlyReadOnly { + this := HasOnlyReadOnly{} + return &this +} + +// NewHasOnlyReadOnlyWithDefaults instantiates a new HasOnlyReadOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHasOnlyReadOnlyWithDefaults() *HasOnlyReadOnly { + this := HasOnlyReadOnly{} + return &this +} + +// GetBar returns the Bar field value if set, zero value otherwise. +func (o *HasOnlyReadOnly) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetBarOk() (*string, bool) { + if o == nil || o.Bar == nil { + return nil, false + } + return o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *HasOnlyReadOnly) SetBar(v string) { + o.Bar = &v +} + +// GetFoo returns the Foo field value if set, zero value otherwise. +func (o *HasOnlyReadOnly) GetFoo() string { + if o == nil || o.Foo == nil { + var ret string + return ret + } + return *o.Foo +} + +// GetFooOk returns a tuple with the Foo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetFooOk() (*string, bool) { + if o == nil || o.Foo == nil { + return nil, false + } + return o.Foo, true +} + +// HasFoo returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasFoo() bool { + if o != nil && o.Foo != nil { + return true + } + + return false +} + +// SetFoo gets a reference to the given string and assigns it to the Foo field. +func (o *HasOnlyReadOnly) SetFoo(v string) { + o.Foo = &v +} + +func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Foo != nil { + toSerialize["foo"] = o.Foo + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *HasOnlyReadOnly) UnmarshalJSON(bytes []byte) (err error) { + varHasOnlyReadOnly := _HasOnlyReadOnly{} + + if err = json.Unmarshal(bytes, &varHasOnlyReadOnly); err == nil { + *o = HasOnlyReadOnly(varHasOnlyReadOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bar") + delete(additionalProperties, "foo") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHasOnlyReadOnly struct { + value *HasOnlyReadOnly + isSet bool +} + +func (v NullableHasOnlyReadOnly) Get() *HasOnlyReadOnly { + return v.value +} + +func (v *NullableHasOnlyReadOnly) Set(val *HasOnlyReadOnly) { + v.value = val + v.isSet = true +} + +func (v NullableHasOnlyReadOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableHasOnlyReadOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHasOnlyReadOnly(val *HasOnlyReadOnly) *NullableHasOnlyReadOnly { + return &NullableHasOnlyReadOnly{value: val, isSet: true} +} + +func (v NullableHasOnlyReadOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHasOnlyReadOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go index 30e012281b5..db44ec77384 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_health_check_result.go @@ -8,7 +8,142 @@ */ package petstore + +import ( + "encoding/json" +) + // HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. type HealthCheckResult struct { - NullableMessage *string `json:"NullableMessage,omitempty"` + NullableMessage NullableString `json:"NullableMessage,omitempty"` + AdditionalProperties map[string]interface{} } + +type _HealthCheckResult HealthCheckResult + +// NewHealthCheckResult instantiates a new HealthCheckResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHealthCheckResult() *HealthCheckResult { + this := HealthCheckResult{} + return &this +} + +// NewHealthCheckResultWithDefaults instantiates a new HealthCheckResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHealthCheckResultWithDefaults() *HealthCheckResult { + this := HealthCheckResult{} + return &this +} + +// GetNullableMessage returns the NullableMessage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *HealthCheckResult) GetNullableMessage() string { + if o == nil || o.NullableMessage.Get() == nil { + var ret string + return ret + } + return *o.NullableMessage.Get() +} + +// GetNullableMessageOk returns a tuple with the NullableMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *HealthCheckResult) GetNullableMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NullableMessage.Get(), o.NullableMessage.IsSet() +} + +// HasNullableMessage returns a boolean if a field has been set. +func (o *HealthCheckResult) HasNullableMessage() bool { + if o != nil && o.NullableMessage.IsSet() { + return true + } + + return false +} + +// SetNullableMessage gets a reference to the given NullableString and assigns it to the NullableMessage field. +func (o *HealthCheckResult) SetNullableMessage(v string) { + o.NullableMessage.Set(&v) +} +// SetNullableMessageNil sets the value for NullableMessage to be an explicit nil +func (o *HealthCheckResult) SetNullableMessageNil() { + o.NullableMessage.Set(nil) +} + +// UnsetNullableMessage ensures that no value is present for NullableMessage, not even an explicit nil +func (o *HealthCheckResult) UnsetNullableMessage() { + o.NullableMessage.Unset() +} + +func (o HealthCheckResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NullableMessage.IsSet() { + toSerialize["NullableMessage"] = o.NullableMessage.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *HealthCheckResult) UnmarshalJSON(bytes []byte) (err error) { + varHealthCheckResult := _HealthCheckResult{} + + if err = json.Unmarshal(bytes, &varHealthCheckResult); err == nil { + *o = HealthCheckResult(varHealthCheckResult) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "NullableMessage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHealthCheckResult struct { + value *HealthCheckResult + isSet bool +} + +func (v NullableHealthCheckResult) Get() *HealthCheckResult { + return v.value +} + +func (v *NullableHealthCheckResult) Set(val *HealthCheckResult) { + v.value = val + v.isSet = true +} + +func (v NullableHealthCheckResult) IsSet() bool { + return v.isSet +} + +func (v *NullableHealthCheckResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHealthCheckResult(val *HealthCheckResult) *NullableHealthCheckResult { + return &NullableHealthCheckResult{value: val, isSet: true} +} + +func (v NullableHealthCheckResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHealthCheckResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go index 20659467b71..758deb9dc15 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object.go @@ -8,10 +8,171 @@ */ package petstore + +import ( + "encoding/json" +) + // InlineObject struct for InlineObject type InlineObject struct { // Updated name of the pet - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Updated status of the pet - Status string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } + +type _InlineObject InlineObject + +// NewInlineObject instantiates a new InlineObject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject() *InlineObject { + this := InlineObject{} + return &this +} + +// NewInlineObjectWithDefaults instantiates a new InlineObject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObjectWithDefaults() *InlineObject { + this := InlineObject{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InlineObject) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InlineObject) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InlineObject) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InlineObject) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InlineObject) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InlineObject) SetStatus(v string) { + o.Status = &v +} + +func (o InlineObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineObject) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject := _InlineObject{} + + if err = json.Unmarshal(bytes, &varInlineObject); err == nil { + *o = InlineObject(varInlineObject) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineObject struct { + value *InlineObject + isSet bool +} + +func (v NullableInlineObject) Get() *InlineObject { + return v.value +} + +func (v *NullableInlineObject) Set(val *InlineObject) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject(val *InlineObject) *NullableInlineObject { + return &NullableInlineObject{value: val, isSet: true} +} + +func (v NullableInlineObject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go index 4692ea8053e..90c0f63645d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_1.go @@ -8,13 +8,172 @@ */ package petstore + import ( + "encoding/json" "os" ) + // InlineObject1 struct for InlineObject1 type InlineObject1 struct { // Additional data to pass to server - AdditionalMetadata string `json:"additionalMetadata,omitempty"` + AdditionalMetadata *string `json:"additionalMetadata,omitempty"` // file to upload - File *os.File `json:"file,omitempty"` + File **os.File `json:"file,omitempty"` + AdditionalProperties map[string]interface{} } + +type _InlineObject1 InlineObject1 + +// NewInlineObject1 instantiates a new InlineObject1 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject1() *InlineObject1 { + this := InlineObject1{} + return &this +} + +// NewInlineObject1WithDefaults instantiates a new InlineObject1 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObject1WithDefaults() *InlineObject1 { + this := InlineObject1{} + return &this +} + +// GetAdditionalMetadata returns the AdditionalMetadata field value if set, zero value otherwise. +func (o *InlineObject1) GetAdditionalMetadata() string { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret + } + return *o.AdditionalMetadata +} + +// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetAdditionalMetadataOk() (*string, bool) { + if o == nil || o.AdditionalMetadata == nil { + return nil, false + } + return o.AdditionalMetadata, true +} + +// HasAdditionalMetadata returns a boolean if a field has been set. +func (o *InlineObject1) HasAdditionalMetadata() bool { + if o != nil && o.AdditionalMetadata != nil { + return true + } + + return false +} + +// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. +func (o *InlineObject1) SetAdditionalMetadata(v string) { + o.AdditionalMetadata = &v +} + +// GetFile returns the File field value if set, zero value otherwise. +func (o *InlineObject1) GetFile() *os.File { + if o == nil || o.File == nil { + var ret *os.File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetFileOk() (**os.File, bool) { + if o == nil || o.File == nil { + return nil, false + } + return o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *InlineObject1) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given *os.File and assigns it to the File field. +func (o *InlineObject1) SetFile(v *os.File) { + o.File = &v +} + +func (o InlineObject1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AdditionalMetadata != nil { + toSerialize["additionalMetadata"] = o.AdditionalMetadata + } + if o.File != nil { + toSerialize["file"] = o.File + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineObject1) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject1 := _InlineObject1{} + + if err = json.Unmarshal(bytes, &varInlineObject1); err == nil { + *o = InlineObject1(varInlineObject1) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "additionalMetadata") + delete(additionalProperties, "file") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineObject1 struct { + value *InlineObject1 + isSet bool +} + +func (v NullableInlineObject1) Get() *InlineObject1 { + return v.value +} + +func (v *NullableInlineObject1) Set(val *InlineObject1) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject1) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject1(val *InlineObject1) *NullableInlineObject1 { + return &NullableInlineObject1{value: val, isSet: true} +} + +func (v NullableInlineObject1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go index 52452faf750..3217b39c869 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_2.go @@ -8,10 +8,175 @@ */ package petstore + +import ( + "encoding/json" +) + // InlineObject2 struct for InlineObject2 type InlineObject2 struct { // Form parameter enum test (string array) - EnumFormStringArray []string `json:"enum_form_string_array,omitempty"` + EnumFormStringArray *[]string `json:"enum_form_string_array,omitempty"` // Form parameter enum test (string) - EnumFormString string `json:"enum_form_string,omitempty"` + EnumFormString *string `json:"enum_form_string,omitempty"` + AdditionalProperties map[string]interface{} } + +type _InlineObject2 InlineObject2 + +// NewInlineObject2 instantiates a new InlineObject2 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject2() *InlineObject2 { + this := InlineObject2{} + var enumFormString string = "-efg" + this.EnumFormString = &enumFormString + return &this +} + +// NewInlineObject2WithDefaults instantiates a new InlineObject2 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObject2WithDefaults() *InlineObject2 { + this := InlineObject2{} + var enumFormString string = "-efg" + this.EnumFormString = &enumFormString + return &this +} + +// GetEnumFormStringArray returns the EnumFormStringArray field value if set, zero value otherwise. +func (o *InlineObject2) GetEnumFormStringArray() []string { + if o == nil || o.EnumFormStringArray == nil { + var ret []string + return ret + } + return *o.EnumFormStringArray +} + +// GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetEnumFormStringArrayOk() (*[]string, bool) { + if o == nil || o.EnumFormStringArray == nil { + return nil, false + } + return o.EnumFormStringArray, true +} + +// HasEnumFormStringArray returns a boolean if a field has been set. +func (o *InlineObject2) HasEnumFormStringArray() bool { + if o != nil && o.EnumFormStringArray != nil { + return true + } + + return false +} + +// SetEnumFormStringArray gets a reference to the given []string and assigns it to the EnumFormStringArray field. +func (o *InlineObject2) SetEnumFormStringArray(v []string) { + o.EnumFormStringArray = &v +} + +// GetEnumFormString returns the EnumFormString field value if set, zero value otherwise. +func (o *InlineObject2) GetEnumFormString() string { + if o == nil || o.EnumFormString == nil { + var ret string + return ret + } + return *o.EnumFormString +} + +// GetEnumFormStringOk returns a tuple with the EnumFormString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetEnumFormStringOk() (*string, bool) { + if o == nil || o.EnumFormString == nil { + return nil, false + } + return o.EnumFormString, true +} + +// HasEnumFormString returns a boolean if a field has been set. +func (o *InlineObject2) HasEnumFormString() bool { + if o != nil && o.EnumFormString != nil { + return true + } + + return false +} + +// SetEnumFormString gets a reference to the given string and assigns it to the EnumFormString field. +func (o *InlineObject2) SetEnumFormString(v string) { + o.EnumFormString = &v +} + +func (o InlineObject2) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumFormStringArray != nil { + toSerialize["enum_form_string_array"] = o.EnumFormStringArray + } + if o.EnumFormString != nil { + toSerialize["enum_form_string"] = o.EnumFormString + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineObject2) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject2 := _InlineObject2{} + + if err = json.Unmarshal(bytes, &varInlineObject2); err == nil { + *o = InlineObject2(varInlineObject2) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "enum_form_string_array") + delete(additionalProperties, "enum_form_string") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineObject2 struct { + value *InlineObject2 + isSet bool +} + +func (v NullableInlineObject2) Get() *InlineObject2 { + return v.value +} + +func (v *NullableInlineObject2) Set(val *InlineObject2) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject2) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject2) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject2(val *InlineObject2) *NullableInlineObject2 { + return &NullableInlineObject2{value: val, isSet: true} +} + +func (v NullableInlineObject2) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject2) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go index d3e14334035..8050df353aa 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_3.go @@ -8,38 +8,601 @@ */ package petstore + import ( + "encoding/json" "os" "time" ) + // InlineObject3 struct for InlineObject3 type InlineObject3 struct { // None - Integer int32 `json:"integer,omitempty"` + Integer *int32 `json:"integer,omitempty"` // None - Int32 int32 `json:"int32,omitempty"` + Int32 *int32 `json:"int32,omitempty"` // None - Int64 int64 `json:"int64,omitempty"` + Int64 *int64 `json:"int64,omitempty"` // None Number float32 `json:"number"` // None - Float float32 `json:"float,omitempty"` + Float *float32 `json:"float,omitempty"` // None Double float64 `json:"double"` // None - String string `json:"string,omitempty"` + String *string `json:"string,omitempty"` // None PatternWithoutDelimiter string `json:"pattern_without_delimiter"` // None Byte string `json:"byte"` // None - Binary *os.File `json:"binary,omitempty"` + Binary **os.File `json:"binary,omitempty"` // None - Date string `json:"date,omitempty"` + Date *string `json:"date,omitempty"` // None - DateTime time.Time `json:"dateTime,omitempty"` + DateTime *time.Time `json:"dateTime,omitempty"` // None - Password string `json:"password,omitempty"` + Password *string `json:"password,omitempty"` // None - Callback string `json:"callback,omitempty"` + Callback *string `json:"callback,omitempty"` + AdditionalProperties map[string]interface{} } + +type _InlineObject3 InlineObject3 + +// NewInlineObject3 instantiates a new InlineObject3 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject3(number float32, double float64, patternWithoutDelimiter string, byte_ string, ) *InlineObject3 { + this := InlineObject3{} + this.Number = number + this.Double = double + this.PatternWithoutDelimiter = patternWithoutDelimiter + this.Byte = byte_ + return &this +} + +// NewInlineObject3WithDefaults instantiates a new InlineObject3 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObject3WithDefaults() *InlineObject3 { + this := InlineObject3{} + return &this +} + +// GetInteger returns the Integer field value if set, zero value otherwise. +func (o *InlineObject3) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetIntegerOk() (*int32, bool) { + if o == nil || o.Integer == nil { + return nil, false + } + return o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *InlineObject3) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *InlineObject3) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field value if set, zero value otherwise. +func (o *InlineObject3) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetInt32Ok() (*int32, bool) { + if o == nil || o.Int32 == nil { + return nil, false + } + return o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *InlineObject3) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *InlineObject3) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field value if set, zero value otherwise. +func (o *InlineObject3) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetInt64Ok() (*int64, bool) { + if o == nil || o.Int64 == nil { + return nil, false + } + return o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *InlineObject3) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *InlineObject3) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field value +func (o *InlineObject3) GetNumber() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Number +} + +// GetNumberOk returns a tuple with the Number field value +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetNumberOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Number, true +} + +// SetNumber sets field value +func (o *InlineObject3) SetNumber(v float32) { + o.Number = v +} + +// GetFloat returns the Float field value if set, zero value otherwise. +func (o *InlineObject3) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetFloatOk() (*float32, bool) { + if o == nil || o.Float == nil { + return nil, false + } + return o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *InlineObject3) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *InlineObject3) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field value +func (o *InlineObject3) GetDouble() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Double +} + +// GetDoubleOk returns a tuple with the Double field value +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDoubleOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Double, true +} + +// SetDouble sets field value +func (o *InlineObject3) SetDouble(v float64) { + o.Double = v +} + +// GetString returns the String field value if set, zero value otherwise. +func (o *InlineObject3) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetStringOk() (*string, bool) { + if o == nil || o.String == nil { + return nil, false + } + return o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *InlineObject3) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *InlineObject3) SetString(v string) { + o.String = &v +} + +// GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field value +func (o *InlineObject3) GetPatternWithoutDelimiter() string { + if o == nil { + var ret string + return ret + } + + return o.PatternWithoutDelimiter +} + +// GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field value +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetPatternWithoutDelimiterOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PatternWithoutDelimiter, true +} + +// SetPatternWithoutDelimiter sets field value +func (o *InlineObject3) SetPatternWithoutDelimiter(v string) { + o.PatternWithoutDelimiter = v +} + +// GetByte returns the Byte field value +func (o *InlineObject3) GetByte() string { + if o == nil { + var ret string + return ret + } + + return o.Byte +} + +// GetByteOk returns a tuple with the Byte field value +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetByteOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Byte, true +} + +// SetByte sets field value +func (o *InlineObject3) SetByte(v string) { + o.Byte = v +} + +// GetBinary returns the Binary field value if set, zero value otherwise. +func (o *InlineObject3) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetBinaryOk() (**os.File, bool) { + if o == nil || o.Binary == nil { + return nil, false + } + return o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *InlineObject3) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *InlineObject3) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field value if set, zero value otherwise. +func (o *InlineObject3) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDateOk() (*string, bool) { + if o == nil || o.Date == nil { + return nil, false + } + return o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *InlineObject3) HasDate() bool { + if o != nil && o.Date != nil { + return true + } + + return false +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *InlineObject3) SetDate(v string) { + o.Date = &v +} + +// GetDateTime returns the DateTime field value if set, zero value otherwise. +func (o *InlineObject3) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDateTimeOk() (*time.Time, bool) { + if o == nil || o.DateTime == nil { + return nil, false + } + return o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *InlineObject3) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *InlineObject3) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *InlineObject3) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetPasswordOk() (*string, bool) { + if o == nil || o.Password == nil { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *InlineObject3) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *InlineObject3) SetPassword(v string) { + o.Password = &v +} + +// GetCallback returns the Callback field value if set, zero value otherwise. +func (o *InlineObject3) GetCallback() string { + if o == nil || o.Callback == nil { + var ret string + return ret + } + return *o.Callback +} + +// GetCallbackOk returns a tuple with the Callback field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetCallbackOk() (*string, bool) { + if o == nil || o.Callback == nil { + return nil, false + } + return o.Callback, true +} + +// HasCallback returns a boolean if a field has been set. +func (o *InlineObject3) HasCallback() bool { + if o != nil && o.Callback != nil { + return true + } + + return false +} + +// SetCallback gets a reference to the given string and assigns it to the Callback field. +func (o *InlineObject3) SetCallback(v string) { + o.Callback = &v +} + +func (o InlineObject3) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if true { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if true { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if true { + toSerialize["pattern_without_delimiter"] = o.PatternWithoutDelimiter + } + if true { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if o.Date != nil { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Callback != nil { + toSerialize["callback"] = o.Callback + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineObject3) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject3 := _InlineObject3{} + + if err = json.Unmarshal(bytes, &varInlineObject3); err == nil { + *o = InlineObject3(varInlineObject3) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "integer") + delete(additionalProperties, "int32") + delete(additionalProperties, "int64") + delete(additionalProperties, "number") + delete(additionalProperties, "float") + delete(additionalProperties, "double") + delete(additionalProperties, "string") + delete(additionalProperties, "pattern_without_delimiter") + delete(additionalProperties, "byte") + delete(additionalProperties, "binary") + delete(additionalProperties, "date") + delete(additionalProperties, "dateTime") + delete(additionalProperties, "password") + delete(additionalProperties, "callback") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineObject3 struct { + value *InlineObject3 + isSet bool +} + +func (v NullableInlineObject3) Get() *InlineObject3 { + return v.value +} + +func (v *NullableInlineObject3) Set(val *InlineObject3) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject3) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject3) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject3(val *InlineObject3) *NullableInlineObject3 { + return &NullableInlineObject3{value: val, isSet: true} +} + +func (v NullableInlineObject3) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject3) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go index e3f9974e637..bd624f9c4b5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_4.go @@ -8,10 +8,157 @@ */ package petstore + +import ( + "encoding/json" +) + // InlineObject4 struct for InlineObject4 type InlineObject4 struct { // field1 Param string `json:"param"` // field2 Param2 string `json:"param2"` + AdditionalProperties map[string]interface{} } + +type _InlineObject4 InlineObject4 + +// NewInlineObject4 instantiates a new InlineObject4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject4(param string, param2 string, ) *InlineObject4 { + this := InlineObject4{} + this.Param = param + this.Param2 = param2 + return &this +} + +// NewInlineObject4WithDefaults instantiates a new InlineObject4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObject4WithDefaults() *InlineObject4 { + this := InlineObject4{} + return &this +} + +// GetParam returns the Param field value +func (o *InlineObject4) GetParam() string { + if o == nil { + var ret string + return ret + } + + return o.Param +} + +// GetParamOk returns a tuple with the Param field value +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetParamOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Param, true +} + +// SetParam sets field value +func (o *InlineObject4) SetParam(v string) { + o.Param = v +} + +// GetParam2 returns the Param2 field value +func (o *InlineObject4) GetParam2() string { + if o == nil { + var ret string + return ret + } + + return o.Param2 +} + +// GetParam2Ok returns a tuple with the Param2 field value +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetParam2Ok() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Param2, true +} + +// SetParam2 sets field value +func (o *InlineObject4) SetParam2(v string) { + o.Param2 = v +} + +func (o InlineObject4) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["param"] = o.Param + } + if true { + toSerialize["param2"] = o.Param2 + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineObject4) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject4 := _InlineObject4{} + + if err = json.Unmarshal(bytes, &varInlineObject4); err == nil { + *o = InlineObject4(varInlineObject4) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "param") + delete(additionalProperties, "param2") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineObject4 struct { + value *InlineObject4 + isSet bool +} + +func (v NullableInlineObject4) Get() *InlineObject4 { + return v.value +} + +func (v *NullableInlineObject4) Set(val *InlineObject4) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject4) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject4(val *InlineObject4) *NullableInlineObject4 { + return &NullableInlineObject4{value: val, isSet: true} +} + +func (v NullableInlineObject4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go index 800d2287bb7..47fcc6e2e29 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_object_5.go @@ -8,13 +8,165 @@ */ package petstore + import ( + "encoding/json" "os" ) + // InlineObject5 struct for InlineObject5 type InlineObject5 struct { // Additional data to pass to server - AdditionalMetadata string `json:"additionalMetadata,omitempty"` + AdditionalMetadata *string `json:"additionalMetadata,omitempty"` // file to upload RequiredFile *os.File `json:"requiredFile"` + AdditionalProperties map[string]interface{} } + +type _InlineObject5 InlineObject5 + +// NewInlineObject5 instantiates a new InlineObject5 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineObject5(requiredFile *os.File, ) *InlineObject5 { + this := InlineObject5{} + this.RequiredFile = requiredFile + return &this +} + +// NewInlineObject5WithDefaults instantiates a new InlineObject5 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineObject5WithDefaults() *InlineObject5 { + this := InlineObject5{} + return &this +} + +// GetAdditionalMetadata returns the AdditionalMetadata field value if set, zero value otherwise. +func (o *InlineObject5) GetAdditionalMetadata() string { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret + } + return *o.AdditionalMetadata +} + +// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetAdditionalMetadataOk() (*string, bool) { + if o == nil || o.AdditionalMetadata == nil { + return nil, false + } + return o.AdditionalMetadata, true +} + +// HasAdditionalMetadata returns a boolean if a field has been set. +func (o *InlineObject5) HasAdditionalMetadata() bool { + if o != nil && o.AdditionalMetadata != nil { + return true + } + + return false +} + +// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. +func (o *InlineObject5) SetAdditionalMetadata(v string) { + o.AdditionalMetadata = &v +} + +// GetRequiredFile returns the RequiredFile field value +func (o *InlineObject5) GetRequiredFile() *os.File { + if o == nil { + var ret *os.File + return ret + } + + return o.RequiredFile +} + +// GetRequiredFileOk returns a tuple with the RequiredFile field value +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetRequiredFileOk() (**os.File, bool) { + if o == nil { + return nil, false + } + return &o.RequiredFile, true +} + +// SetRequiredFile sets field value +func (o *InlineObject5) SetRequiredFile(v *os.File) { + o.RequiredFile = v +} + +func (o InlineObject5) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AdditionalMetadata != nil { + toSerialize["additionalMetadata"] = o.AdditionalMetadata + } + if true { + toSerialize["requiredFile"] = o.RequiredFile + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineObject5) UnmarshalJSON(bytes []byte) (err error) { + varInlineObject5 := _InlineObject5{} + + if err = json.Unmarshal(bytes, &varInlineObject5); err == nil { + *o = InlineObject5(varInlineObject5) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "additionalMetadata") + delete(additionalProperties, "requiredFile") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineObject5 struct { + value *InlineObject5 + isSet bool +} + +func (v NullableInlineObject5) Get() *InlineObject5 { + return v.value +} + +func (v *NullableInlineObject5) Set(val *InlineObject5) { + v.value = val + v.isSet = true +} + +func (v NullableInlineObject5) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineObject5) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineObject5(val *InlineObject5) *NullableInlineObject5 { + return &NullableInlineObject5{value: val, isSet: true} +} + +func (v NullableInlineObject5) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineObject5) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go index c5be6dcae7d..70e9023e731 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_inline_response_default.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // InlineResponseDefault struct for InlineResponseDefault type InlineResponseDefault struct { - String Foo `json:"string,omitempty"` + String *Foo `json:"string,omitempty"` + AdditionalProperties map[string]interface{} } + +type _InlineResponseDefault InlineResponseDefault + +// NewInlineResponseDefault instantiates a new InlineResponseDefault object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponseDefault() *InlineResponseDefault { + this := InlineResponseDefault{} + return &this +} + +// NewInlineResponseDefaultWithDefaults instantiates a new InlineResponseDefault object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponseDefaultWithDefaults() *InlineResponseDefault { + this := InlineResponseDefault{} + return &this +} + +// GetString returns the String field value if set, zero value otherwise. +func (o *InlineResponseDefault) GetString() Foo { + if o == nil || o.String == nil { + var ret Foo + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponseDefault) GetStringOk() (*Foo, bool) { + if o == nil || o.String == nil { + return nil, false + } + return o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *InlineResponseDefault) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given Foo and assigns it to the String field. +func (o *InlineResponseDefault) SetString(v Foo) { + o.String = &v +} + +func (o InlineResponseDefault) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.String != nil { + toSerialize["string"] = o.String + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *InlineResponseDefault) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponseDefault := _InlineResponseDefault{} + + if err = json.Unmarshal(bytes, &varInlineResponseDefault); err == nil { + *o = InlineResponseDefault(varInlineResponseDefault) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "string") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInlineResponseDefault struct { + value *InlineResponseDefault + isSet bool +} + +func (v NullableInlineResponseDefault) Get() *InlineResponseDefault { + return v.value +} + +func (v *NullableInlineResponseDefault) Set(val *InlineResponseDefault) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponseDefault) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponseDefault) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponseDefault(val *InlineResponseDefault) *NullableInlineResponseDefault { + return &NullableInlineResponseDefault{value: val, isSet: true} +} + +func (v NullableInlineResponseDefault) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponseDefault) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_list.go b/samples/openapi3/client/petstore/go/go-petstore/model_list.go index 891ded476a4..565452b2067 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_list.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_list.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // List struct for List type List struct { - Var123List string `json:"123-list,omitempty"` + Var123List *string `json:"123-list,omitempty"` + AdditionalProperties map[string]interface{} } + +type _List List + +// NewList instantiates a new List object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewList() *List { + this := List{} + return &this +} + +// NewListWithDefaults instantiates a new List object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListWithDefaults() *List { + this := List{} + return &this +} + +// GetVar123List returns the Var123List field value if set, zero value otherwise. +func (o *List) GetVar123List() string { + if o == nil || o.Var123List == nil { + var ret string + return ret + } + return *o.Var123List +} + +// GetVar123ListOk returns a tuple with the Var123List field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *List) GetVar123ListOk() (*string, bool) { + if o == nil || o.Var123List == nil { + return nil, false + } + return o.Var123List, true +} + +// HasVar123List returns a boolean if a field has been set. +func (o *List) HasVar123List() bool { + if o != nil && o.Var123List != nil { + return true + } + + return false +} + +// SetVar123List gets a reference to the given string and assigns it to the Var123List field. +func (o *List) SetVar123List(v string) { + o.Var123List = &v +} + +func (o List) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Var123List != nil { + toSerialize["123-list"] = o.Var123List + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *List) UnmarshalJSON(bytes []byte) (err error) { + varList := _List{} + + if err = json.Unmarshal(bytes, &varList); err == nil { + *o = List(varList) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "123-list") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableList struct { + value *List + isSet bool +} + +func (v NullableList) Get() *List { + return v.value +} + +func (v *NullableList) Set(val *List) { + v.value = val + v.isSet = true +} + +func (v NullableList) IsSet() bool { + return v.isSet +} + +func (v *NullableList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableList(val *List) *NullableList { + return &NullableList{value: val, isSet: true} +} + +func (v NullableList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go/go-petstore/model_mammal.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go rename to samples/openapi3/client/petstore/go/go-petstore/model_mammal.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go index 5c03afe831c..7bd5860170b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_map_test_.go @@ -8,10 +8,243 @@ */ package petstore + +import ( + "encoding/json" +) + // MapTest struct for MapTest type MapTest struct { - MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` - MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` - DirectMap map[string]bool `json:"direct_map,omitempty"` - IndirectMap map[string]bool `json:"indirect_map,omitempty"` + MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` + MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` + DirectMap *map[string]bool `json:"direct_map,omitempty"` + IndirectMap *map[string]bool `json:"indirect_map,omitempty"` + AdditionalProperties map[string]interface{} } + +type _MapTest MapTest + +// NewMapTest instantiates a new MapTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMapTest() *MapTest { + this := MapTest{} + return &this +} + +// NewMapTestWithDefaults instantiates a new MapTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMapTestWithDefaults() *MapTest { + this := MapTest{} + return &this +} + +// GetMapMapOfString returns the MapMapOfString field value if set, zero value otherwise. +func (o *MapTest) GetMapMapOfString() map[string]map[string]string { + if o == nil || o.MapMapOfString == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapMapOfString +} + +// GetMapMapOfStringOk returns a tuple with the MapMapOfString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapMapOfStringOk() (*map[string]map[string]string, bool) { + if o == nil || o.MapMapOfString == nil { + return nil, false + } + return o.MapMapOfString, true +} + +// HasMapMapOfString returns a boolean if a field has been set. +func (o *MapTest) HasMapMapOfString() bool { + if o != nil && o.MapMapOfString != nil { + return true + } + + return false +} + +// SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. +func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { + o.MapMapOfString = &v +} + +// GetMapOfEnumString returns the MapOfEnumString field value if set, zero value otherwise. +func (o *MapTest) GetMapOfEnumString() map[string]string { + if o == nil || o.MapOfEnumString == nil { + var ret map[string]string + return ret + } + return *o.MapOfEnumString +} + +// GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapOfEnumStringOk() (*map[string]string, bool) { + if o == nil || o.MapOfEnumString == nil { + return nil, false + } + return o.MapOfEnumString, true +} + +// HasMapOfEnumString returns a boolean if a field has been set. +func (o *MapTest) HasMapOfEnumString() bool { + if o != nil && o.MapOfEnumString != nil { + return true + } + + return false +} + +// SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. +func (o *MapTest) SetMapOfEnumString(v map[string]string) { + o.MapOfEnumString = &v +} + +// GetDirectMap returns the DirectMap field value if set, zero value otherwise. +func (o *MapTest) GetDirectMap() map[string]bool { + if o == nil || o.DirectMap == nil { + var ret map[string]bool + return ret + } + return *o.DirectMap +} + +// GetDirectMapOk returns a tuple with the DirectMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetDirectMapOk() (*map[string]bool, bool) { + if o == nil || o.DirectMap == nil { + return nil, false + } + return o.DirectMap, true +} + +// HasDirectMap returns a boolean if a field has been set. +func (o *MapTest) HasDirectMap() bool { + if o != nil && o.DirectMap != nil { + return true + } + + return false +} + +// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. +func (o *MapTest) SetDirectMap(v map[string]bool) { + o.DirectMap = &v +} + +// GetIndirectMap returns the IndirectMap field value if set, zero value otherwise. +func (o *MapTest) GetIndirectMap() map[string]bool { + if o == nil || o.IndirectMap == nil { + var ret map[string]bool + return ret + } + return *o.IndirectMap +} + +// GetIndirectMapOk returns a tuple with the IndirectMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetIndirectMapOk() (*map[string]bool, bool) { + if o == nil || o.IndirectMap == nil { + return nil, false + } + return o.IndirectMap, true +} + +// HasIndirectMap returns a boolean if a field has been set. +func (o *MapTest) HasIndirectMap() bool { + if o != nil && o.IndirectMap != nil { + return true + } + + return false +} + +// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. +func (o *MapTest) SetIndirectMap(v map[string]bool) { + o.IndirectMap = &v +} + +func (o MapTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapMapOfString != nil { + toSerialize["map_map_of_string"] = o.MapMapOfString + } + if o.MapOfEnumString != nil { + toSerialize["map_of_enum_string"] = o.MapOfEnumString + } + if o.DirectMap != nil { + toSerialize["direct_map"] = o.DirectMap + } + if o.IndirectMap != nil { + toSerialize["indirect_map"] = o.IndirectMap + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *MapTest) UnmarshalJSON(bytes []byte) (err error) { + varMapTest := _MapTest{} + + if err = json.Unmarshal(bytes, &varMapTest); err == nil { + *o = MapTest(varMapTest) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "map_map_of_string") + delete(additionalProperties, "map_of_enum_string") + delete(additionalProperties, "direct_map") + delete(additionalProperties, "indirect_map") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMapTest struct { + value *MapTest + isSet bool +} + +func (v NullableMapTest) Get() *MapTest { + return v.value +} + +func (v *NullableMapTest) Set(val *MapTest) { + v.value = val + v.isSet = true +} + +func (v NullableMapTest) IsSet() bool { + return v.isSet +} + +func (v *NullableMapTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMapTest(val *MapTest) *NullableMapTest { + return &NullableMapTest{value: val, isSet: true} +} + +func (v NullableMapTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMapTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go index fcd0bc9bbdd..752ccff41ea 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -8,12 +8,207 @@ */ package petstore + import ( + "encoding/json" "time" ) + // MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass type MixedPropertiesAndAdditionalPropertiesClass struct { - Uuid string `json:"uuid,omitempty"` - DateTime time.Time `json:"dateTime,omitempty"` - Map map[string]Animal `json:"map,omitempty"` + Uuid *string `json:"uuid,omitempty"` + DateTime *time.Time `json:"dateTime,omitempty"` + Map *map[string]Animal `json:"map,omitempty"` + AdditionalProperties map[string]interface{} } + +type _MixedPropertiesAndAdditionalPropertiesClass MixedPropertiesAndAdditionalPropertiesClass + +// NewMixedPropertiesAndAdditionalPropertiesClass instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMixedPropertiesAndAdditionalPropertiesClass() *MixedPropertiesAndAdditionalPropertiesClass { + this := MixedPropertiesAndAdditionalPropertiesClass{} + return &this +} + +// NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults instantiates a new MixedPropertiesAndAdditionalPropertiesClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMixedPropertiesAndAdditionalPropertiesClassWithDefaults() *MixedPropertiesAndAdditionalPropertiesClass { + this := MixedPropertiesAndAdditionalPropertiesClass{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (*string, bool) { + if o == nil || o.Uuid == nil { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { + o.Uuid = &v +} + +// GetDateTime returns the DateTime field value if set, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (*time.Time, bool) { + if o == nil || o.DateTime == nil { + return nil, false + } + return o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetMap returns the Map field value if set, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { + if o == nil || o.Map == nil { + var ret map[string]Animal + return ret + } + return *o.Map +} + +// GetMapOk returns a tuple with the Map field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (*map[string]Animal, bool) { + if o == nil || o.Map == nil { + return nil, false + } + return o.Map, true +} + +// HasMap returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { + if o != nil && o.Map != nil { + return true + } + + return false +} + +// SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal) { + o.Map = &v +} + +func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Map != nil { + toSerialize["map"] = o.Map + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *MixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) { + varMixedPropertiesAndAdditionalPropertiesClass := _MixedPropertiesAndAdditionalPropertiesClass{} + + if err = json.Unmarshal(bytes, &varMixedPropertiesAndAdditionalPropertiesClass); err == nil { + *o = MixedPropertiesAndAdditionalPropertiesClass(varMixedPropertiesAndAdditionalPropertiesClass) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "dateTime") + delete(additionalProperties, "map") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMixedPropertiesAndAdditionalPropertiesClass struct { + value *MixedPropertiesAndAdditionalPropertiesClass + isSet bool +} + +func (v NullableMixedPropertiesAndAdditionalPropertiesClass) Get() *MixedPropertiesAndAdditionalPropertiesClass { + return v.value +} + +func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Set(val *MixedPropertiesAndAdditionalPropertiesClass) { + v.value = val + v.isSet = true +} + +func (v NullableMixedPropertiesAndAdditionalPropertiesClass) IsSet() bool { + return v.isSet +} + +func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMixedPropertiesAndAdditionalPropertiesClass(val *MixedPropertiesAndAdditionalPropertiesClass) *NullableMixedPropertiesAndAdditionalPropertiesClass { + return &NullableMixedPropertiesAndAdditionalPropertiesClass{value: val, isSet: true} +} + +func (v NullableMixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMixedPropertiesAndAdditionalPropertiesClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_name.go b/samples/openapi3/client/petstore/go/go-petstore/model_name.go index 0043908483d..c66130c5bf3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_name.go @@ -8,10 +8,236 @@ */ package petstore + +import ( + "encoding/json" +) + // Name Model for testing model name same as property name type Name struct { Name int32 `json:"name"` - SnakeCase int32 `json:"snake_case,omitempty"` - Property string `json:"property,omitempty"` - Var123Number int32 `json:"123Number,omitempty"` + SnakeCase *int32 `json:"snake_case,omitempty"` + Property *string `json:"property,omitempty"` + Var123Number *int32 `json:"123Number,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Name Name + +// NewName instantiates a new Name object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewName(name int32, ) *Name { + this := Name{} + this.Name = name + return &this +} + +// NewNameWithDefaults instantiates a new Name object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNameWithDefaults() *Name { + this := Name{} + return &this +} + +// GetName returns the Name field value +func (o *Name) GetName() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Name) GetNameOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Name) SetName(v int32) { + o.Name = v +} + +// GetSnakeCase returns the SnakeCase field value if set, zero value otherwise. +func (o *Name) GetSnakeCase() int32 { + if o == nil || o.SnakeCase == nil { + var ret int32 + return ret + } + return *o.SnakeCase +} + +// GetSnakeCaseOk returns a tuple with the SnakeCase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetSnakeCaseOk() (*int32, bool) { + if o == nil || o.SnakeCase == nil { + return nil, false + } + return o.SnakeCase, true +} + +// HasSnakeCase returns a boolean if a field has been set. +func (o *Name) HasSnakeCase() bool { + if o != nil && o.SnakeCase != nil { + return true + } + + return false +} + +// SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. +func (o *Name) SetSnakeCase(v int32) { + o.SnakeCase = &v +} + +// GetProperty returns the Property field value if set, zero value otherwise. +func (o *Name) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetPropertyOk() (*string, bool) { + if o == nil || o.Property == nil { + return nil, false + } + return o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *Name) HasProperty() bool { + if o != nil && o.Property != nil { + return true + } + + return false +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *Name) SetProperty(v string) { + o.Property = &v +} + +// GetVar123Number returns the Var123Number field value if set, zero value otherwise. +func (o *Name) GetVar123Number() int32 { + if o == nil || o.Var123Number == nil { + var ret int32 + return ret + } + return *o.Var123Number +} + +// GetVar123NumberOk returns a tuple with the Var123Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetVar123NumberOk() (*int32, bool) { + if o == nil || o.Var123Number == nil { + return nil, false + } + return o.Var123Number, true +} + +// HasVar123Number returns a boolean if a field has been set. +func (o *Name) HasVar123Number() bool { + if o != nil && o.Var123Number != nil { + return true + } + + return false +} + +// SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. +func (o *Name) SetVar123Number(v int32) { + o.Var123Number = &v +} + +func (o Name) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["name"] = o.Name + } + if o.SnakeCase != nil { + toSerialize["snake_case"] = o.SnakeCase + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Var123Number != nil { + toSerialize["123Number"] = o.Var123Number + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Name) UnmarshalJSON(bytes []byte) (err error) { + varName := _Name{} + + if err = json.Unmarshal(bytes, &varName); err == nil { + *o = Name(varName) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "snake_case") + delete(additionalProperties, "property") + delete(additionalProperties, "123Number") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableName struct { + value *Name + isSet bool +} + +func (v NullableName) Get() *Name { + return v.value +} + +func (v *NullableName) Set(val *Name) { + v.value = val + v.isSet = true +} + +func (v NullableName) IsSet() bool { + return v.isSet +} + +func (v *NullableName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableName(val *Name) *NullableName { + return &NullableName{value: val, isSet: true} +} + +func (v NullableName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go index 952129120f9..72deb6ecf44 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_nullable_class.go @@ -8,21 +8,568 @@ */ package petstore + import ( + "encoding/json" "time" ) + // NullableClass struct for NullableClass type NullableClass struct { - IntegerProp *int32 `json:"integer_prop,omitempty"` - NumberProp *float32 `json:"number_prop,omitempty"` - BooleanProp *bool `json:"boolean_prop,omitempty"` - StringProp *string `json:"string_prop,omitempty"` - DateProp *string `json:"date_prop,omitempty"` - DatetimeProp *time.Time `json:"datetime_prop,omitempty"` - ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` - ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` - ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` - ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` - ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` - ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` + IntegerProp NullableInt32 `json:"integer_prop,omitempty"` + NumberProp NullableFloat32 `json:"number_prop,omitempty"` + BooleanProp NullableBool `json:"boolean_prop,omitempty"` + StringProp NullableString `json:"string_prop,omitempty"` + DateProp NullableString `json:"date_prop,omitempty"` + DatetimeProp NullableTime `json:"datetime_prop,omitempty"` + ArrayNullableProp []map[string]interface{} `json:"array_nullable_prop,omitempty"` + ArrayAndItemsNullableProp []map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + ArrayItemsNullable *[]map[string]interface{} `json:"array_items_nullable,omitempty"` + ObjectNullableProp map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + ObjectAndItemsNullableProp map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` } + +// NewNullableClass instantiates a new NullableClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNullableClass() *NullableClass { + this := NullableClass{} + return &this +} + +// NewNullableClassWithDefaults instantiates a new NullableClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNullableClassWithDefaults() *NullableClass { + this := NullableClass{} + return &this +} + +// GetIntegerProp returns the IntegerProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetIntegerProp() int32 { + if o == nil || o.IntegerProp.Get() == nil { + var ret int32 + return ret + } + return *o.IntegerProp.Get() +} + +// GetIntegerPropOk returns a tuple with the IntegerProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetIntegerPropOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.IntegerProp.Get(), o.IntegerProp.IsSet() +} + +// HasIntegerProp returns a boolean if a field has been set. +func (o *NullableClass) HasIntegerProp() bool { + if o != nil && o.IntegerProp.IsSet() { + return true + } + + return false +} + +// SetIntegerProp gets a reference to the given NullableInt32 and assigns it to the IntegerProp field. +func (o *NullableClass) SetIntegerProp(v int32) { + o.IntegerProp.Set(&v) +} +// SetIntegerPropNil sets the value for IntegerProp to be an explicit nil +func (o *NullableClass) SetIntegerPropNil() { + o.IntegerProp.Set(nil) +} + +// UnsetIntegerProp ensures that no value is present for IntegerProp, not even an explicit nil +func (o *NullableClass) UnsetIntegerProp() { + o.IntegerProp.Unset() +} + +// GetNumberProp returns the NumberProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetNumberProp() float32 { + if o == nil || o.NumberProp.Get() == nil { + var ret float32 + return ret + } + return *o.NumberProp.Get() +} + +// GetNumberPropOk returns a tuple with the NumberProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetNumberPropOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.NumberProp.Get(), o.NumberProp.IsSet() +} + +// HasNumberProp returns a boolean if a field has been set. +func (o *NullableClass) HasNumberProp() bool { + if o != nil && o.NumberProp.IsSet() { + return true + } + + return false +} + +// SetNumberProp gets a reference to the given NullableFloat32 and assigns it to the NumberProp field. +func (o *NullableClass) SetNumberProp(v float32) { + o.NumberProp.Set(&v) +} +// SetNumberPropNil sets the value for NumberProp to be an explicit nil +func (o *NullableClass) SetNumberPropNil() { + o.NumberProp.Set(nil) +} + +// UnsetNumberProp ensures that no value is present for NumberProp, not even an explicit nil +func (o *NullableClass) UnsetNumberProp() { + o.NumberProp.Unset() +} + +// GetBooleanProp returns the BooleanProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetBooleanProp() bool { + if o == nil || o.BooleanProp.Get() == nil { + var ret bool + return ret + } + return *o.BooleanProp.Get() +} + +// GetBooleanPropOk returns a tuple with the BooleanProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetBooleanPropOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.BooleanProp.Get(), o.BooleanProp.IsSet() +} + +// HasBooleanProp returns a boolean if a field has been set. +func (o *NullableClass) HasBooleanProp() bool { + if o != nil && o.BooleanProp.IsSet() { + return true + } + + return false +} + +// SetBooleanProp gets a reference to the given NullableBool and assigns it to the BooleanProp field. +func (o *NullableClass) SetBooleanProp(v bool) { + o.BooleanProp.Set(&v) +} +// SetBooleanPropNil sets the value for BooleanProp to be an explicit nil +func (o *NullableClass) SetBooleanPropNil() { + o.BooleanProp.Set(nil) +} + +// UnsetBooleanProp ensures that no value is present for BooleanProp, not even an explicit nil +func (o *NullableClass) UnsetBooleanProp() { + o.BooleanProp.Unset() +} + +// GetStringProp returns the StringProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetStringProp() string { + if o == nil || o.StringProp.Get() == nil { + var ret string + return ret + } + return *o.StringProp.Get() +} + +// GetStringPropOk returns a tuple with the StringProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetStringPropOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StringProp.Get(), o.StringProp.IsSet() +} + +// HasStringProp returns a boolean if a field has been set. +func (o *NullableClass) HasStringProp() bool { + if o != nil && o.StringProp.IsSet() { + return true + } + + return false +} + +// SetStringProp gets a reference to the given NullableString and assigns it to the StringProp field. +func (o *NullableClass) SetStringProp(v string) { + o.StringProp.Set(&v) +} +// SetStringPropNil sets the value for StringProp to be an explicit nil +func (o *NullableClass) SetStringPropNil() { + o.StringProp.Set(nil) +} + +// UnsetStringProp ensures that no value is present for StringProp, not even an explicit nil +func (o *NullableClass) UnsetStringProp() { + o.StringProp.Unset() +} + +// GetDateProp returns the DateProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetDateProp() string { + if o == nil || o.DateProp.Get() == nil { + var ret string + return ret + } + return *o.DateProp.Get() +} + +// GetDatePropOk returns a tuple with the DateProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetDatePropOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DateProp.Get(), o.DateProp.IsSet() +} + +// HasDateProp returns a boolean if a field has been set. +func (o *NullableClass) HasDateProp() bool { + if o != nil && o.DateProp.IsSet() { + return true + } + + return false +} + +// SetDateProp gets a reference to the given NullableString and assigns it to the DateProp field. +func (o *NullableClass) SetDateProp(v string) { + o.DateProp.Set(&v) +} +// SetDatePropNil sets the value for DateProp to be an explicit nil +func (o *NullableClass) SetDatePropNil() { + o.DateProp.Set(nil) +} + +// UnsetDateProp ensures that no value is present for DateProp, not even an explicit nil +func (o *NullableClass) UnsetDateProp() { + o.DateProp.Unset() +} + +// GetDatetimeProp returns the DatetimeProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetDatetimeProp() time.Time { + if o == nil || o.DatetimeProp.Get() == nil { + var ret time.Time + return ret + } + return *o.DatetimeProp.Get() +} + +// GetDatetimePropOk returns a tuple with the DatetimeProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetDatetimePropOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DatetimeProp.Get(), o.DatetimeProp.IsSet() +} + +// HasDatetimeProp returns a boolean if a field has been set. +func (o *NullableClass) HasDatetimeProp() bool { + if o != nil && o.DatetimeProp.IsSet() { + return true + } + + return false +} + +// SetDatetimeProp gets a reference to the given NullableTime and assigns it to the DatetimeProp field. +func (o *NullableClass) SetDatetimeProp(v time.Time) { + o.DatetimeProp.Set(&v) +} +// SetDatetimePropNil sets the value for DatetimeProp to be an explicit nil +func (o *NullableClass) SetDatetimePropNil() { + o.DatetimeProp.Set(nil) +} + +// UnsetDatetimeProp ensures that no value is present for DatetimeProp, not even an explicit nil +func (o *NullableClass) UnsetDatetimeProp() { + o.DatetimeProp.Unset() +} + +// GetArrayNullableProp returns the ArrayNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + return o.ArrayNullableProp +} + +// GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetArrayNullablePropOk() (*[]map[string]interface{}, bool) { + if o == nil || o.ArrayNullableProp == nil { + return nil, false + } + return &o.ArrayNullableProp, true +} + +// HasArrayNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasArrayNullableProp() bool { + if o != nil && o.ArrayNullableProp != nil { + return true + } + + return false +} + +// SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. +func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { + o.ArrayNullableProp = v +} + +// GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + return o.ArrayAndItemsNullableProp +} + +// GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetArrayAndItemsNullablePropOk() (*[]map[string]interface{}, bool) { + if o == nil || o.ArrayAndItemsNullableProp == nil { + return nil, false + } + return &o.ArrayAndItemsNullableProp, true +} + +// HasArrayAndItemsNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasArrayAndItemsNullableProp() bool { + if o != nil && o.ArrayAndItemsNullableProp != nil { + return true + } + + return false +} + +// SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. +func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{}) { + o.ArrayAndItemsNullableProp = v +} + +// GetArrayItemsNullable returns the ArrayItemsNullable field value if set, zero value otherwise. +func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{} { + if o == nil || o.ArrayItemsNullable == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayItemsNullable +} + +// GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayItemsNullableOk() (*[]map[string]interface{}, bool) { + if o == nil || o.ArrayItemsNullable == nil { + return nil, false + } + return o.ArrayItemsNullable, true +} + +// HasArrayItemsNullable returns a boolean if a field has been set. +func (o *NullableClass) HasArrayItemsNullable() bool { + if o != nil && o.ArrayItemsNullable != nil { + return true + } + + return false +} + +// SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. +func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{}) { + o.ArrayItemsNullable = &v +} + +// GetObjectNullableProp returns the ObjectNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{} { + if o == nil { + var ret map[string]map[string]interface{} + return ret + } + return o.ObjectNullableProp +} + +// GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetObjectNullablePropOk() (*map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectNullableProp == nil { + return nil, false + } + return &o.ObjectNullableProp, true +} + +// HasObjectNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasObjectNullableProp() bool { + if o != nil && o.ObjectNullableProp != nil { + return true + } + + return false +} + +// SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. +func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{}) { + o.ObjectNullableProp = v +} + +// GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{} { + if o == nil { + var ret map[string]map[string]interface{} + return ret + } + return o.ObjectAndItemsNullableProp +} + +// GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NullableClass) GetObjectAndItemsNullablePropOk() (*map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectAndItemsNullableProp == nil { + return nil, false + } + return &o.ObjectAndItemsNullableProp, true +} + +// HasObjectAndItemsNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasObjectAndItemsNullableProp() bool { + if o != nil && o.ObjectAndItemsNullableProp != nil { + return true + } + + return false +} + +// SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. +func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{}) { + o.ObjectAndItemsNullableProp = v +} + +// GetObjectItemsNullable returns the ObjectItemsNullable field value if set, zero value otherwise. +func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{} { + if o == nil || o.ObjectItemsNullable == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectItemsNullable +} + +// GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectItemsNullableOk() (*map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectItemsNullable == nil { + return nil, false + } + return o.ObjectItemsNullable, true +} + +// HasObjectItemsNullable returns a boolean if a field has been set. +func (o *NullableClass) HasObjectItemsNullable() bool { + if o != nil && o.ObjectItemsNullable != nil { + return true + } + + return false +} + +// SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. +func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{}) { + o.ObjectItemsNullable = &v +} + +func (o NullableClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.IntegerProp.IsSet() { + toSerialize["integer_prop"] = o.IntegerProp.Get() + } + if o.NumberProp.IsSet() { + toSerialize["number_prop"] = o.NumberProp.Get() + } + if o.BooleanProp.IsSet() { + toSerialize["boolean_prop"] = o.BooleanProp.Get() + } + if o.StringProp.IsSet() { + toSerialize["string_prop"] = o.StringProp.Get() + } + if o.DateProp.IsSet() { + toSerialize["date_prop"] = o.DateProp.Get() + } + if o.DatetimeProp.IsSet() { + toSerialize["datetime_prop"] = o.DatetimeProp.Get() + } + if o.ArrayNullableProp != nil { + toSerialize["array_nullable_prop"] = o.ArrayNullableProp + } + if o.ArrayAndItemsNullableProp != nil { + toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp + } + if o.ArrayItemsNullable != nil { + toSerialize["array_items_nullable"] = o.ArrayItemsNullable + } + if o.ObjectNullableProp != nil { + toSerialize["object_nullable_prop"] = o.ObjectNullableProp + } + if o.ObjectAndItemsNullableProp != nil { + toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp + } + if o.ObjectItemsNullable != nil { + toSerialize["object_items_nullable"] = o.ObjectItemsNullable + } + return json.Marshal(toSerialize) +} + +type NullableNullableClass struct { + value *NullableClass + isSet bool +} + +func (v NullableNullableClass) Get() *NullableClass { + return v.value +} + +func (v *NullableNullableClass) Set(val *NullableClass) { + v.value = val + v.isSet = true +} + +func (v NullableNullableClass) IsSet() bool { + return v.isSet +} + +func (v *NullableNullableClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNullableClass(val *NullableClass) *NullableNullableClass { + return &NullableNullableClass{value: val, isSet: true} +} + +func (v NullableNullableClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNullableClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go index 7a3eccc1174..a0a6f01be08 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_number_only.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // NumberOnly struct for NumberOnly type NumberOnly struct { - JustNumber float32 `json:"JustNumber,omitempty"` + JustNumber *float32 `json:"JustNumber,omitempty"` + AdditionalProperties map[string]interface{} } + +type _NumberOnly NumberOnly + +// NewNumberOnly instantiates a new NumberOnly object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNumberOnly() *NumberOnly { + this := NumberOnly{} + return &this +} + +// NewNumberOnlyWithDefaults instantiates a new NumberOnly object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNumberOnlyWithDefaults() *NumberOnly { + this := NumberOnly{} + return &this +} + +// GetJustNumber returns the JustNumber field value if set, zero value otherwise. +func (o *NumberOnly) GetJustNumber() float32 { + if o == nil || o.JustNumber == nil { + var ret float32 + return ret + } + return *o.JustNumber +} + +// GetJustNumberOk returns a tuple with the JustNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NumberOnly) GetJustNumberOk() (*float32, bool) { + if o == nil || o.JustNumber == nil { + return nil, false + } + return o.JustNumber, true +} + +// HasJustNumber returns a boolean if a field has been set. +func (o *NumberOnly) HasJustNumber() bool { + if o != nil && o.JustNumber != nil { + return true + } + + return false +} + +// SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. +func (o *NumberOnly) SetJustNumber(v float32) { + o.JustNumber = &v +} + +func (o NumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustNumber != nil { + toSerialize["JustNumber"] = o.JustNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *NumberOnly) UnmarshalJSON(bytes []byte) (err error) { + varNumberOnly := _NumberOnly{} + + if err = json.Unmarshal(bytes, &varNumberOnly); err == nil { + *o = NumberOnly(varNumberOnly) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "JustNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNumberOnly struct { + value *NumberOnly + isSet bool +} + +func (v NullableNumberOnly) Get() *NumberOnly { + return v.value +} + +func (v *NullableNumberOnly) Set(val *NumberOnly) { + v.value = val + v.isSet = true +} + +func (v NullableNumberOnly) IsSet() bool { + return v.isSet +} + +func (v *NullableNumberOnly) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNumberOnly(val *NumberOnly) *NullableNumberOnly { + return &NullableNumberOnly{value: val, isSet: true} +} + +func (v NullableNumberOnly) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNumberOnly) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_order.go b/samples/openapi3/client/petstore/go/go-petstore/model_order.go index f8bae432ae7..83e6d9fdeb3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_order.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_order.go @@ -8,16 +8,323 @@ */ package petstore + import ( + "encoding/json" "time" ) + // Order struct for Order type Order struct { - Id int64 `json:"id,omitempty"` - PetId int64 `json:"petId,omitempty"` - Quantity int32 `json:"quantity,omitempty"` - ShipDate time.Time `json:"shipDate,omitempty"` + Id *int64 `json:"id,omitempty"` + PetId *int64 `json:"petId,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + ShipDate *time.Time `json:"shipDate,omitempty"` // Order Status - Status string `json:"status,omitempty"` - Complete bool `json:"complete,omitempty"` + Status *string `json:"status,omitempty"` + Complete *bool `json:"complete,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Order Order + +// NewOrder instantiates a new Order object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrder() *Order { + this := Order{} + var complete bool = false + this.Complete = &complete + return &this +} + +// NewOrderWithDefaults instantiates a new Order object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderWithDefaults() *Order { + this := Order{} + var complete bool = false + this.Complete = &complete + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Order) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Order) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Order) SetId(v int64) { + o.Id = &v +} + +// GetPetId returns the PetId field value if set, zero value otherwise. +func (o *Order) GetPetId() int64 { + if o == nil || o.PetId == nil { + var ret int64 + return ret + } + return *o.PetId +} + +// GetPetIdOk returns a tuple with the PetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetPetIdOk() (*int64, bool) { + if o == nil || o.PetId == nil { + return nil, false + } + return o.PetId, true +} + +// HasPetId returns a boolean if a field has been set. +func (o *Order) HasPetId() bool { + if o != nil && o.PetId != nil { + return true + } + + return false +} + +// SetPetId gets a reference to the given int64 and assigns it to the PetId field. +func (o *Order) SetPetId(v int64) { + o.PetId = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *Order) GetQuantity() int32 { + if o == nil || o.Quantity == nil { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetQuantityOk() (*int32, bool) { + if o == nil || o.Quantity == nil { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *Order) HasQuantity() bool { + if o != nil && o.Quantity != nil { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *Order) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetShipDate returns the ShipDate field value if set, zero value otherwise. +func (o *Order) GetShipDate() time.Time { + if o == nil || o.ShipDate == nil { + var ret time.Time + return ret + } + return *o.ShipDate +} + +// GetShipDateOk returns a tuple with the ShipDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetShipDateOk() (*time.Time, bool) { + if o == nil || o.ShipDate == nil { + return nil, false + } + return o.ShipDate, true +} + +// HasShipDate returns a boolean if a field has been set. +func (o *Order) HasShipDate() bool { + if o != nil && o.ShipDate != nil { + return true + } + + return false +} + +// SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. +func (o *Order) SetShipDate(v time.Time) { + o.ShipDate = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Order) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Order) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Order) SetStatus(v string) { + o.Status = &v +} + +// GetComplete returns the Complete field value if set, zero value otherwise. +func (o *Order) GetComplete() bool { + if o == nil || o.Complete == nil { + var ret bool + return ret + } + return *o.Complete +} + +// GetCompleteOk returns a tuple with the Complete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetCompleteOk() (*bool, bool) { + if o == nil || o.Complete == nil { + return nil, false + } + return o.Complete, true +} + +// HasComplete returns a boolean if a field has been set. +func (o *Order) HasComplete() bool { + if o != nil && o.Complete != nil { + return true + } + + return false +} + +// SetComplete gets a reference to the given bool and assigns it to the Complete field. +func (o *Order) SetComplete(v bool) { + o.Complete = &v +} + +func (o Order) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.PetId != nil { + toSerialize["petId"] = o.PetId + } + if o.Quantity != nil { + toSerialize["quantity"] = o.Quantity + } + if o.ShipDate != nil { + toSerialize["shipDate"] = o.ShipDate + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Complete != nil { + toSerialize["complete"] = o.Complete + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Order) UnmarshalJSON(bytes []byte) (err error) { + varOrder := _Order{} + + if err = json.Unmarshal(bytes, &varOrder); err == nil { + *o = Order(varOrder) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "petId") + delete(additionalProperties, "quantity") + delete(additionalProperties, "shipDate") + delete(additionalProperties, "status") + delete(additionalProperties, "complete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrder struct { + value *Order + isSet bool +} + +func (v NullableOrder) Get() *Order { + return v.value +} + +func (v *NullableOrder) Set(val *Order) { + v.value = val + v.isSet = true +} + +func (v NullableOrder) IsSet() bool { + return v.isSet +} + +func (v *NullableOrder) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrder(val *Order) *NullableOrder { + return &NullableOrder{value: val, isSet: true} +} + +func (v NullableOrder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go index 78ce40e6734..2b399e1a97f 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_composite.go @@ -8,9 +8,206 @@ */ package petstore + +import ( + "encoding/json" +) + // OuterComposite struct for OuterComposite type OuterComposite struct { - MyNumber float32 `json:"my_number,omitempty"` - MyString string `json:"my_string,omitempty"` - MyBoolean bool `json:"my_boolean,omitempty"` + MyNumber *float32 `json:"my_number,omitempty"` + MyString *string `json:"my_string,omitempty"` + MyBoolean *bool `json:"my_boolean,omitempty"` + AdditionalProperties map[string]interface{} } + +type _OuterComposite OuterComposite + +// NewOuterComposite instantiates a new OuterComposite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOuterComposite() *OuterComposite { + this := OuterComposite{} + return &this +} + +// NewOuterCompositeWithDefaults instantiates a new OuterComposite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOuterCompositeWithDefaults() *OuterComposite { + this := OuterComposite{} + return &this +} + +// GetMyNumber returns the MyNumber field value if set, zero value otherwise. +func (o *OuterComposite) GetMyNumber() float32 { + if o == nil || o.MyNumber == nil { + var ret float32 + return ret + } + return *o.MyNumber +} + +// GetMyNumberOk returns a tuple with the MyNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyNumberOk() (*float32, bool) { + if o == nil || o.MyNumber == nil { + return nil, false + } + return o.MyNumber, true +} + +// HasMyNumber returns a boolean if a field has been set. +func (o *OuterComposite) HasMyNumber() bool { + if o != nil && o.MyNumber != nil { + return true + } + + return false +} + +// SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. +func (o *OuterComposite) SetMyNumber(v float32) { + o.MyNumber = &v +} + +// GetMyString returns the MyString field value if set, zero value otherwise. +func (o *OuterComposite) GetMyString() string { + if o == nil || o.MyString == nil { + var ret string + return ret + } + return *o.MyString +} + +// GetMyStringOk returns a tuple with the MyString field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyStringOk() (*string, bool) { + if o == nil || o.MyString == nil { + return nil, false + } + return o.MyString, true +} + +// HasMyString returns a boolean if a field has been set. +func (o *OuterComposite) HasMyString() bool { + if o != nil && o.MyString != nil { + return true + } + + return false +} + +// SetMyString gets a reference to the given string and assigns it to the MyString field. +func (o *OuterComposite) SetMyString(v string) { + o.MyString = &v +} + +// GetMyBoolean returns the MyBoolean field value if set, zero value otherwise. +func (o *OuterComposite) GetMyBoolean() bool { + if o == nil || o.MyBoolean == nil { + var ret bool + return ret + } + return *o.MyBoolean +} + +// GetMyBooleanOk returns a tuple with the MyBoolean field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyBooleanOk() (*bool, bool) { + if o == nil || o.MyBoolean == nil { + return nil, false + } + return o.MyBoolean, true +} + +// HasMyBoolean returns a boolean if a field has been set. +func (o *OuterComposite) HasMyBoolean() bool { + if o != nil && o.MyBoolean != nil { + return true + } + + return false +} + +// SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. +func (o *OuterComposite) SetMyBoolean(v bool) { + o.MyBoolean = &v +} + +func (o OuterComposite) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MyNumber != nil { + toSerialize["my_number"] = o.MyNumber + } + if o.MyString != nil { + toSerialize["my_string"] = o.MyString + } + if o.MyBoolean != nil { + toSerialize["my_boolean"] = o.MyBoolean + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *OuterComposite) UnmarshalJSON(bytes []byte) (err error) { + varOuterComposite := _OuterComposite{} + + if err = json.Unmarshal(bytes, &varOuterComposite); err == nil { + *o = OuterComposite(varOuterComposite) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "my_number") + delete(additionalProperties, "my_string") + delete(additionalProperties, "my_boolean") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOuterComposite struct { + value *OuterComposite + isSet bool +} + +func (v NullableOuterComposite) Get() *OuterComposite { + return v.value +} + +func (v *NullableOuterComposite) Set(val *OuterComposite) { + v.value = val + v.isSet = true +} + +func (v NullableOuterComposite) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterComposite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterComposite(val *OuterComposite) *NullableOuterComposite { + return &NullableOuterComposite{value: val, isSet: true} +} + +func (v NullableOuterComposite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterComposite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go index b9233fa91df..f0297f941dd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // OuterEnum the model 'OuterEnum' type OuterEnum string @@ -17,3 +23,62 @@ const ( OUTERENUM_APPROVED OuterEnum = "approved" OUTERENUM_DELIVERED OuterEnum = "delivered" ) + +func (v *OuterEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnum(value) + for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnum", value) +} + +// Ptr returns reference to OuterEnum value +func (v OuterEnum) Ptr() *OuterEnum { + return &v +} + +type NullableOuterEnum struct { + value *OuterEnum + isSet bool +} + +func (v NullableOuterEnum) Get() *OuterEnum { + return v.value +} + +func (v *NullableOuterEnum) Set(val *OuterEnum) { + v.value = val + v.isSet = true +} + +func (v NullableOuterEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterEnum(val *OuterEnum) *NullableOuterEnum { + return &NullableOuterEnum{value: val, isSet: true} +} + +func (v NullableOuterEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go index 6ab39166338..334feef54a5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // OuterEnumDefaultValue the model 'OuterEnumDefaultValue' type OuterEnumDefaultValue string @@ -17,3 +23,62 @@ const ( OUTERENUMDEFAULTVALUE_APPROVED OuterEnumDefaultValue = "approved" OUTERENUMDEFAULTVALUE_DELIVERED OuterEnumDefaultValue = "delivered" ) + +func (v *OuterEnumDefaultValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumDefaultValue(value) + for _, existing := range []OuterEnumDefaultValue{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumDefaultValue", value) +} + +// Ptr returns reference to OuterEnumDefaultValue value +func (v OuterEnumDefaultValue) Ptr() *OuterEnumDefaultValue { + return &v +} + +type NullableOuterEnumDefaultValue struct { + value *OuterEnumDefaultValue + isSet bool +} + +func (v NullableOuterEnumDefaultValue) Get() *OuterEnumDefaultValue { + return v.value +} + +func (v *NullableOuterEnumDefaultValue) Set(val *OuterEnumDefaultValue) { + v.value = val + v.isSet = true +} + +func (v NullableOuterEnumDefaultValue) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterEnumDefaultValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterEnumDefaultValue(val *OuterEnumDefaultValue) *NullableOuterEnumDefaultValue { + return &NullableOuterEnumDefaultValue{value: val, isSet: true} +} + +func (v NullableOuterEnumDefaultValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterEnumDefaultValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go index d8c4d36926d..025b8a7c70a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // OuterEnumInteger the model 'OuterEnumInteger' type OuterEnumInteger int32 @@ -17,3 +23,62 @@ const ( OUTERENUMINTEGER__1 OuterEnumInteger = 1 OUTERENUMINTEGER__2 OuterEnumInteger = 2 ) + +func (v *OuterEnumInteger) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumInteger(value) + for _, existing := range []OuterEnumInteger{ 0, 1, 2, } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumInteger", value) +} + +// Ptr returns reference to OuterEnumInteger value +func (v OuterEnumInteger) Ptr() *OuterEnumInteger { + return &v +} + +type NullableOuterEnumInteger struct { + value *OuterEnumInteger + isSet bool +} + +func (v NullableOuterEnumInteger) Get() *OuterEnumInteger { + return v.value +} + +func (v *NullableOuterEnumInteger) Set(val *OuterEnumInteger) { + v.value = val + v.isSet = true +} + +func (v NullableOuterEnumInteger) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterEnumInteger) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterEnumInteger(val *OuterEnumInteger) *NullableOuterEnumInteger { + return &NullableOuterEnumInteger{value: val, isSet: true} +} + +func (v NullableOuterEnumInteger) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterEnumInteger) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go index 27a68a9d6ef..07afc92fac9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go @@ -8,6 +8,12 @@ */ package petstore + +import ( + "encoding/json" + "fmt" +) + // OuterEnumIntegerDefaultValue the model 'OuterEnumIntegerDefaultValue' type OuterEnumIntegerDefaultValue int32 @@ -17,3 +23,62 @@ const ( OUTERENUMINTEGERDEFAULTVALUE__1 OuterEnumIntegerDefaultValue = 1 OUTERENUMINTEGERDEFAULTVALUE__2 OuterEnumIntegerDefaultValue = 2 ) + +func (v *OuterEnumIntegerDefaultValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumIntegerDefaultValue(value) + for _, existing := range []OuterEnumIntegerDefaultValue{ 0, 1, 2, } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumIntegerDefaultValue", value) +} + +// Ptr returns reference to OuterEnumIntegerDefaultValue value +func (v OuterEnumIntegerDefaultValue) Ptr() *OuterEnumIntegerDefaultValue { + return &v +} + +type NullableOuterEnumIntegerDefaultValue struct { + value *OuterEnumIntegerDefaultValue + isSet bool +} + +func (v NullableOuterEnumIntegerDefaultValue) Get() *OuterEnumIntegerDefaultValue { + return v.value +} + +func (v *NullableOuterEnumIntegerDefaultValue) Set(val *OuterEnumIntegerDefaultValue) { + v.value = val + v.isSet = true +} + +func (v NullableOuterEnumIntegerDefaultValue) IsSet() bool { + return v.isSet +} + +func (v *NullableOuterEnumIntegerDefaultValue) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOuterEnumIntegerDefaultValue(val *OuterEnumIntegerDefaultValue) *NullableOuterEnumIntegerDefaultValue { + return &NullableOuterEnumIntegerDefaultValue{value: val, isSet: true} +} + +func (v NullableOuterEnumIntegerDefaultValue) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOuterEnumIntegerDefaultValue) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go index 2979b06b3ec..fc4505e1da4 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go @@ -8,13 +8,304 @@ */ package petstore + +import ( + "encoding/json" +) + // Pet struct for Pet type Pet struct { - Id int64 `json:"id,omitempty"` - Category Category `json:"category,omitempty"` + Id *int64 `json:"id,omitempty"` + Category *Category `json:"category,omitempty"` Name string `json:"name"` PhotoUrls []string `json:"photoUrls"` - Tags []Tag `json:"tags,omitempty"` + Tags *[]Tag `json:"tags,omitempty"` // pet status in the store - Status string `json:"status,omitempty"` + Status *string `json:"status,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Pet Pet + +// NewPet instantiates a new Pet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPet(name string, photoUrls []string, ) *Pet { + this := Pet{} + this.Name = name + this.PhotoUrls = photoUrls + return &this +} + +// NewPetWithDefaults instantiates a new Pet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPetWithDefaults() *Pet { + this := Pet{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Pet) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Pet) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Pet) SetId(v int64) { + o.Id = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *Pet) GetCategory() Category { + if o == nil || o.Category == nil { + var ret Category + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetCategoryOk() (*Category, bool) { + if o == nil || o.Category == nil { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *Pet) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given Category and assigns it to the Category field. +func (o *Pet) SetCategory(v Category) { + o.Category = &v +} + +// GetName returns the Name field value +func (o *Pet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Pet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Pet) SetName(v string) { + o.Name = v +} + +// GetPhotoUrls returns the PhotoUrls field value +func (o *Pet) GetPhotoUrls() []string { + if o == nil { + var ret []string + return ret + } + + return o.PhotoUrls +} + +// GetPhotoUrlsOk returns a tuple with the PhotoUrls field value +// and a boolean to check if the value has been set. +func (o *Pet) GetPhotoUrlsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.PhotoUrls, true +} + +// SetPhotoUrls sets field value +func (o *Pet) SetPhotoUrls(v []string) { + o.PhotoUrls = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Pet) GetTags() []Tag { + if o == nil || o.Tags == nil { + var ret []Tag + return ret + } + return *o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetTagsOk() (*[]Tag, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Pet) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *Pet) SetTags(v []Tag) { + o.Tags = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Pet) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Pet) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Pet) SetStatus(v string) { + o.Status = &v +} + +func (o Pet) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Category != nil { + toSerialize["category"] = o.Category + } + if true { + toSerialize["name"] = o.Name + } + if true { + toSerialize["photoUrls"] = o.PhotoUrls + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { + varPet := _Pet{} + + if err = json.Unmarshal(bytes, &varPet); err == nil { + *o = Pet(varPet) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "category") + delete(additionalProperties, "name") + delete(additionalProperties, "photoUrls") + delete(additionalProperties, "tags") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePet struct { + value *Pet + isSet bool +} + +func (v NullablePet) Get() *Pet { + return v.value +} + +func (v *NullablePet) Set(val *Pet) { + v.value = val + v.isSet = true +} + +func (v NullablePet) IsSet() bool { + return v.isSet +} + +func (v *NullablePet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePet(val *Pet) *NullablePet { + return &NullablePet{value: val, isSet: true} +} + +func (v NullablePet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go index 7d1e521f4a4..206e8ef240a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_read_only_first.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // ReadOnlyFirst struct for ReadOnlyFirst type ReadOnlyFirst struct { - Bar string `json:"bar,omitempty"` - Baz string `json:"baz,omitempty"` + Bar *string `json:"bar,omitempty"` + Baz *string `json:"baz,omitempty"` + AdditionalProperties map[string]interface{} } + +type _ReadOnlyFirst ReadOnlyFirst + +// NewReadOnlyFirst instantiates a new ReadOnlyFirst object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReadOnlyFirst() *ReadOnlyFirst { + this := ReadOnlyFirst{} + return &this +} + +// NewReadOnlyFirstWithDefaults instantiates a new ReadOnlyFirst object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReadOnlyFirstWithDefaults() *ReadOnlyFirst { + this := ReadOnlyFirst{} + return &this +} + +// GetBar returns the Bar field value if set, zero value otherwise. +func (o *ReadOnlyFirst) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBarOk() (*string, bool) { + if o == nil || o.Bar == nil { + return nil, false + } + return o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *ReadOnlyFirst) SetBar(v string) { + o.Bar = &v +} + +// GetBaz returns the Baz field value if set, zero value otherwise. +func (o *ReadOnlyFirst) GetBaz() string { + if o == nil || o.Baz == nil { + var ret string + return ret + } + return *o.Baz +} + +// GetBazOk returns a tuple with the Baz field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBazOk() (*string, bool) { + if o == nil || o.Baz == nil { + return nil, false + } + return o.Baz, true +} + +// HasBaz returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBaz() bool { + if o != nil && o.Baz != nil { + return true + } + + return false +} + +// SetBaz gets a reference to the given string and assigns it to the Baz field. +func (o *ReadOnlyFirst) SetBaz(v string) { + o.Baz = &v +} + +func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Baz != nil { + toSerialize["baz"] = o.Baz + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *ReadOnlyFirst) UnmarshalJSON(bytes []byte) (err error) { + varReadOnlyFirst := _ReadOnlyFirst{} + + if err = json.Unmarshal(bytes, &varReadOnlyFirst); err == nil { + *o = ReadOnlyFirst(varReadOnlyFirst) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bar") + delete(additionalProperties, "baz") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReadOnlyFirst struct { + value *ReadOnlyFirst + isSet bool +} + +func (v NullableReadOnlyFirst) Get() *ReadOnlyFirst { + return v.value +} + +func (v *NullableReadOnlyFirst) Set(val *ReadOnlyFirst) { + v.value = val + v.isSet = true +} + +func (v NullableReadOnlyFirst) IsSet() bool { + return v.isSet +} + +func (v *NullableReadOnlyFirst) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReadOnlyFirst(val *ReadOnlyFirst) *NullableReadOnlyFirst { + return &NullableReadOnlyFirst{value: val, isSet: true} +} + +func (v NullableReadOnlyFirst) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReadOnlyFirst) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_return.go b/samples/openapi3/client/petstore/go/go-petstore/model_return.go index 9a029c4f8c0..1d258ad1ef9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_return.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_return.go @@ -8,7 +8,132 @@ */ package petstore + +import ( + "encoding/json" +) + // Return Model for testing reserved words type Return struct { - Return int32 `json:"return,omitempty"` + Return *int32 `json:"return,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Return Return + +// NewReturn instantiates a new Return object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReturn() *Return { + this := Return{} + return &this +} + +// NewReturnWithDefaults instantiates a new Return object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReturnWithDefaults() *Return { + this := Return{} + return &this +} + +// GetReturn returns the Return field value if set, zero value otherwise. +func (o *Return) GetReturn() int32 { + if o == nil || o.Return == nil { + var ret int32 + return ret + } + return *o.Return +} + +// GetReturnOk returns a tuple with the Return field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Return) GetReturnOk() (*int32, bool) { + if o == nil || o.Return == nil { + return nil, false + } + return o.Return, true +} + +// HasReturn returns a boolean if a field has been set. +func (o *Return) HasReturn() bool { + if o != nil && o.Return != nil { + return true + } + + return false +} + +// SetReturn gets a reference to the given int32 and assigns it to the Return field. +func (o *Return) SetReturn(v int32) { + o.Return = &v +} + +func (o Return) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Return != nil { + toSerialize["return"] = o.Return + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Return) UnmarshalJSON(bytes []byte) (err error) { + varReturn := _Return{} + + if err = json.Unmarshal(bytes, &varReturn); err == nil { + *o = Return(varReturn) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "return") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReturn struct { + value *Return + isSet bool +} + +func (v NullableReturn) Get() *Return { + return v.value +} + +func (v *NullableReturn) Set(val *Return) { + v.value = val + v.isSet = true +} + +func (v NullableReturn) IsSet() bool { + return v.isSet +} + +func (v *NullableReturn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReturn(val *Return) *NullableReturn { + return &NullableReturn{value: val, isSet: true} +} + +func (v NullableReturn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReturn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go/go-petstore/model_tag.go index 968bd8798a3..22ede38add3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_tag.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_tag.go @@ -8,8 +8,169 @@ */ package petstore + +import ( + "encoding/json" +) + // Tag struct for Tag type Tag struct { - Id int64 `json:"id,omitempty"` - Name string `json:"name,omitempty"` + Id *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} } + +type _Tag Tag + +// NewTag instantiates a new Tag object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTag() *Tag { + this := Tag{} + return &this +} + +// NewTagWithDefaults instantiates a new Tag object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTagWithDefaults() *Tag { + this := Tag{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Tag) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Tag) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Tag) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Tag) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Tag) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Tag) SetName(v string) { + o.Name = &v +} + +func (o Tag) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *Tag) UnmarshalJSON(bytes []byte) (err error) { + varTag := _Tag{} + + if err = json.Unmarshal(bytes, &varTag); err == nil { + *o = Tag(varTag) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTag struct { + value *Tag + isSet bool +} + +func (v NullableTag) Get() *Tag { + return v.value +} + +func (v *NullableTag) Set(val *Tag) { + v.value = val + v.isSet = true +} + +func (v NullableTag) IsSet() bool { + return v.isSet +} + +func (v *NullableTag) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTag(val *Tag) *NullableTag { + return &NullableTag{value: val, isSet: true} +} + +func (v NullableTag) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTag) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_user.go b/samples/openapi3/client/petstore/go/go-petstore/model_user.go index a6da6f9a87f..eac34a34ab6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_user.go @@ -8,15 +8,547 @@ */ package petstore + +import ( + "encoding/json" +) + // User struct for User type User struct { - Id int64 `json:"id,omitempty"` - Username string `json:"username,omitempty"` - FirstName string `json:"firstName,omitempty"` - LastName string `json:"lastName,omitempty"` - Email string `json:"email,omitempty"` - Password string `json:"password,omitempty"` - Phone string `json:"phone,omitempty"` + Id *int64 `json:"id,omitempty"` + Username *string `json:"username,omitempty"` + FirstName *string `json:"firstName,omitempty"` + LastName *string `json:"lastName,omitempty"` + Email *string `json:"email,omitempty"` + Password *string `json:"password,omitempty"` + Phone *string `json:"phone,omitempty"` // User Status - UserStatus int32 `json:"userStatus,omitempty"` + UserStatus *int32 `json:"userStatus,omitempty"` + // test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + ArbitraryObject *map[string]interface{} `json:"arbitraryObject,omitempty"` + // test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + ArbitraryNullableObject map[string]interface{} `json:"arbitraryNullableObject,omitempty"` + // test code generation for any type Value can be any type - string, number, boolean, array or object. + ArbitraryTypeValue interface{} `json:"arbitraryTypeValue,omitempty"` + // test code generation for any type Value can be any type - string, number, boolean, array, object or the 'null' value. + ArbitraryNullableTypeValue interface{} `json:"arbitraryNullableTypeValue,omitempty"` + AdditionalProperties map[string]interface{} } + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *User) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (*int64, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *User) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *User) SetId(v int64) { + o.Id = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || o.Username == nil { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || o.Username == nil { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && o.Username != nil { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || o.FirstName == nil { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (*string, bool) { + if o == nil || o.FirstName == nil { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && o.FirstName != nil { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || o.LastName == nil { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (*string, bool) { + if o == nil || o.LastName == nil { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && o.LastName != nil { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil || o.Email == nil { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (*string, bool) { + if o == nil || o.Password == nil { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *User) GetPhone() string { + if o == nil || o.Phone == nil { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPhoneOk() (*string, bool) { + if o == nil || o.Phone == nil { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *User) HasPhone() bool { + if o != nil && o.Phone != nil { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *User) SetPhone(v string) { + o.Phone = &v +} + +// GetUserStatus returns the UserStatus field value if set, zero value otherwise. +func (o *User) GetUserStatus() int32 { + if o == nil || o.UserStatus == nil { + var ret int32 + return ret + } + return *o.UserStatus +} + +// GetUserStatusOk returns a tuple with the UserStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUserStatusOk() (*int32, bool) { + if o == nil || o.UserStatus == nil { + return nil, false + } + return o.UserStatus, true +} + +// HasUserStatus returns a boolean if a field has been set. +func (o *User) HasUserStatus() bool { + if o != nil && o.UserStatus != nil { + return true + } + + return false +} + +// SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. +func (o *User) SetUserStatus(v int32) { + o.UserStatus = &v +} + +// GetArbitraryObject returns the ArbitraryObject field value if set, zero value otherwise. +func (o *User) GetArbitraryObject() map[string]interface{} { + if o == nil || o.ArbitraryObject == nil { + var ret map[string]interface{} + return ret + } + return *o.ArbitraryObject +} + +// GetArbitraryObjectOk returns a tuple with the ArbitraryObject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetArbitraryObjectOk() (*map[string]interface{}, bool) { + if o == nil || o.ArbitraryObject == nil { + return nil, false + } + return o.ArbitraryObject, true +} + +// HasArbitraryObject returns a boolean if a field has been set. +func (o *User) HasArbitraryObject() bool { + if o != nil && o.ArbitraryObject != nil { + return true + } + + return false +} + +// SetArbitraryObject gets a reference to the given map[string]interface{} and assigns it to the ArbitraryObject field. +func (o *User) SetArbitraryObject(v map[string]interface{}) { + o.ArbitraryObject = &v +} + +// GetArbitraryNullableObject returns the ArbitraryNullableObject field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetArbitraryNullableObject() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.ArbitraryNullableObject +} + +// GetArbitraryNullableObjectOk returns a tuple with the ArbitraryNullableObject field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetArbitraryNullableObjectOk() (*map[string]interface{}, bool) { + if o == nil || o.ArbitraryNullableObject == nil { + return nil, false + } + return &o.ArbitraryNullableObject, true +} + +// HasArbitraryNullableObject returns a boolean if a field has been set. +func (o *User) HasArbitraryNullableObject() bool { + if o != nil && o.ArbitraryNullableObject != nil { + return true + } + + return false +} + +// SetArbitraryNullableObject gets a reference to the given map[string]interface{} and assigns it to the ArbitraryNullableObject field. +func (o *User) SetArbitraryNullableObject(v map[string]interface{}) { + o.ArbitraryNullableObject = v +} + +// GetArbitraryTypeValue returns the ArbitraryTypeValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetArbitraryTypeValue() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.ArbitraryTypeValue +} + +// GetArbitraryTypeValueOk returns a tuple with the ArbitraryTypeValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetArbitraryTypeValueOk() (*interface{}, bool) { + if o == nil || o.ArbitraryTypeValue == nil { + return nil, false + } + return &o.ArbitraryTypeValue, true +} + +// HasArbitraryTypeValue returns a boolean if a field has been set. +func (o *User) HasArbitraryTypeValue() bool { + if o != nil && o.ArbitraryTypeValue != nil { + return true + } + + return false +} + +// SetArbitraryTypeValue gets a reference to the given interface{} and assigns it to the ArbitraryTypeValue field. +func (o *User) SetArbitraryTypeValue(v interface{}) { + o.ArbitraryTypeValue = v +} + +// GetArbitraryNullableTypeValue returns the ArbitraryNullableTypeValue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetArbitraryNullableTypeValue() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.ArbitraryNullableTypeValue +} + +// GetArbitraryNullableTypeValueOk returns a tuple with the ArbitraryNullableTypeValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetArbitraryNullableTypeValueOk() (*interface{}, bool) { + if o == nil || o.ArbitraryNullableTypeValue == nil { + return nil, false + } + return &o.ArbitraryNullableTypeValue, true +} + +// HasArbitraryNullableTypeValue returns a boolean if a field has been set. +func (o *User) HasArbitraryNullableTypeValue() bool { + if o != nil && o.ArbitraryNullableTypeValue != nil { + return true + } + + return false +} + +// SetArbitraryNullableTypeValue gets a reference to the given interface{} and assigns it to the ArbitraryNullableTypeValue field. +func (o *User) SetArbitraryNullableTypeValue(v interface{}) { + o.ArbitraryNullableTypeValue = v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Username != nil { + toSerialize["username"] = o.Username + } + if o.FirstName != nil { + toSerialize["firstName"] = o.FirstName + } + if o.LastName != nil { + toSerialize["lastName"] = o.LastName + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Phone != nil { + toSerialize["phone"] = o.Phone + } + if o.UserStatus != nil { + toSerialize["userStatus"] = o.UserStatus + } + if o.ArbitraryObject != nil { + toSerialize["arbitraryObject"] = o.ArbitraryObject + } + if o.ArbitraryNullableObject != nil { + toSerialize["arbitraryNullableObject"] = o.ArbitraryNullableObject + } + if o.ArbitraryTypeValue != nil { + toSerialize["arbitraryTypeValue"] = o.ArbitraryTypeValue + } + if o.ArbitraryNullableTypeValue != nil { + toSerialize["arbitraryNullableTypeValue"] = o.ArbitraryNullableTypeValue + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *User) UnmarshalJSON(bytes []byte) (err error) { + varUser := _User{} + + if err = json.Unmarshal(bytes, &varUser); err == nil { + *o = User(varUser) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "username") + delete(additionalProperties, "firstName") + delete(additionalProperties, "lastName") + delete(additionalProperties, "email") + delete(additionalProperties, "password") + delete(additionalProperties, "phone") + delete(additionalProperties, "userStatus") + delete(additionalProperties, "arbitraryObject") + delete(additionalProperties, "arbitraryNullableObject") + delete(additionalProperties, "arbitraryTypeValue") + delete(additionalProperties, "arbitraryNullableTypeValue") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_whale.go b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_whale.go rename to samples/openapi3/client/petstore/go/go-petstore/model_whale.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_zebra.go b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/model_zebra.go rename to samples/openapi3/client/petstore/go/go-petstore/model_zebra.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go b/samples/openapi3/client/petstore/go/go-petstore/signing.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go rename to samples/openapi3/client/petstore/go/go-petstore/signing.go diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go b/samples/openapi3/client/petstore/go/go-petstore/utils.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go rename to samples/openapi3/client/petstore/go/go-petstore/utils.go diff --git a/samples/openapi3/client/petstore/go-experimental/http_signature_test.go b/samples/openapi3/client/petstore/go/http_signature_test.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/http_signature_test.go rename to samples/openapi3/client/petstore/go/http_signature_test.go diff --git a/samples/openapi3/client/petstore/go-experimental/model_test.go b/samples/openapi3/client/petstore/go/model_test.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/model_test.go rename to samples/openapi3/client/petstore/go/model_test.go diff --git a/samples/openapi3/client/petstore/go-experimental/nullable_marshalling_test.go b/samples/openapi3/client/petstore/go/nullable_marshalling_test.go similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/nullable_marshalling_test.go rename to samples/openapi3/client/petstore/go/nullable_marshalling_test.go diff --git a/samples/openapi3/client/petstore/go/pet_api_test.go b/samples/openapi3/client/petstore/go/pet_api_test.go index cda4f457855..9f0a154f96a 100644 --- a/samples/openapi3/client/petstore/go/pet_api_test.go +++ b/samples/openapi3/client/petstore/go/pet_api_test.go @@ -6,7 +6,6 @@ import ( "os" "testing" - "github.com/antihax/optional" "github.com/stretchr/testify/assert" sw "./go-petstore" @@ -28,10 +27,11 @@ func TestMain(m *testing.M) { } func TestAddPet(t *testing.T) { - newPet := (sw.Pet{Id: 12830, Name: "gopher", - PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) - r, err := client.PetApi.AddPet(context.Background(), newPet) + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() if err != nil { t.Fatalf("Error while adding pet: %v", err) @@ -42,7 +42,7 @@ func TestAddPet(t *testing.T) { } func TestFindPetsByStatusWithMissingParam(t *testing.T) { - _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() if err != nil { t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) @@ -57,7 +57,7 @@ func TestGetPetById(t *testing.T) { } func TestGetPetByIdWithInvalidID(t *testing.T) { - resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999) + resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() if r != nil && r.StatusCode == 404 { assertedError, ok := err.(sw.GenericOpenAPIError) a := assert.New(t) @@ -74,10 +74,7 @@ func TestGetPetByIdWithInvalidID(t *testing.T) { } func TestUpdatePetWithForm(t *testing.T) { - r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.UpdatePetWithFormOpts{ - Name: optional.NewString("golang"), - Status: optional.NewString("available"), - }) + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() if err != nil { t.Fatalf("Error while updating pet by id: %v", err) t.Log(r) @@ -86,13 +83,13 @@ func TestUpdatePetWithForm(t *testing.T) { t.Log(r) } - // get the pet with id 12830 from server to verify the update - isPetCorrect(t, 12830, "golang", "available") + // get the pet with id 12830 from server to verify the update + isPetCorrect(t, 12830, "golang", "available") } func TestFindPetsByTag(t *testing.T) { var found = false - resp, r, err := client.PetApi.FindPetsByTags(context.Background(), []string{"tag2"}) + resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() if err != nil { t.Fatalf("Error while getting pet by tag: %v", err) t.Log(r) @@ -103,8 +100,8 @@ func TestFindPetsByTag(t *testing.T) { assert := assert.New(t) for i := 0; i < len(resp); i++ { - if resp[i].Id == 12830 { - assert.Equal(resp[i].Status, "available", "Pet status should be `pending`") + if *resp[i].Id == 12830 { + assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`") found = true } } @@ -121,7 +118,7 @@ func TestFindPetsByTag(t *testing.T) { } func TestFindPetsByStatus(t *testing.T) { - resp, r, err := client.PetApi.FindPetsByStatus(context.Background(), []string{"available"}) + resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() if err != nil { t.Fatalf("Error while getting pet by id: %v", err) t.Log(r) @@ -131,7 +128,7 @@ func TestFindPetsByStatus(t *testing.T) { } else { assert := assert.New(t) for i := 0; i < len(resp); i++ { - assert.Equal(resp[i].Status, "available", "Pet status should be `available`") + assert.Equal(*resp[i].Status, "available", "Pet status should be `available`") } } @@ -147,10 +144,7 @@ func TestUploadFile(t *testing.T) { t.Fatalf("Error opening file: %v", err1) } - _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ - AdditionalMetadata: optional.NewString("golang"), - File: optional.NewInterface(file), - }) + _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() if err != nil { t.Fatalf("Error while uploading file: %v", err) @@ -168,11 +162,7 @@ func TestUploadFileRequired(t *testing.T) { t.Fatalf("Error opening file: %v", err1) } - _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830, - file, - &sw.UploadFileWithRequiredFileOpts{ - AdditionalMetadata: optional.NewString("golang"), - }) + _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() if err != nil { t.Fatalf("Error while uploading file: %v", err) @@ -184,7 +174,7 @@ func TestUploadFileRequired(t *testing.T) { } func TestDeletePet(t *testing.T) { - r, err := client.PetApi.DeletePet(context.Background(), 12830, nil) + r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -274,7 +264,7 @@ func waitOnFunctions(t *testing.T, errc chan error, n int) { } func deletePet(t *testing.T, id int64) { - r, err := client.PetApi.DeletePet(context.Background(), id, nil) + r, err := client.PetApi.DeletePet(context.Background(), id).Execute() if err != nil { t.Fatalf("Error while deleting pet by id: %v", err) @@ -286,13 +276,13 @@ func deletePet(t *testing.T, id int64) { func isPetCorrect(t *testing.T, id int64, name string, status string) { assert := assert.New(t) - resp, r, err := client.PetApi.GetPetById(context.Background(), id) + resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() if err != nil { t.Fatalf("Error while getting pet by id: %v", err) } else { - assert.Equal(resp.Id, int64(id), "Pet id should be equal") + assert.Equal(*resp.Id, int64(id), "Pet id should be equal") assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) - assert.Equal(resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) + assert.Equal(*resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) //t.Log(resp) } @@ -300,4 +290,3 @@ func isPetCorrect(t *testing.T, id int64, name string, status string) { t.Log(r) } } - diff --git a/samples/openapi3/client/petstore/go/pom.xml b/samples/openapi3/client/petstore/go/pom.xml index 222de294b3d..a12a399e011 100644 --- a/samples/openapi3/client/petstore/go/pom.xml +++ b/samples/openapi3/client/petstore/go/pom.xml @@ -68,20 +68,6 @@ - - go-get-optional - pre-integration-test - - exec - - - go - - get - github.com/antihax/optional - - - go-test integration-test diff --git a/samples/openapi3/client/petstore/go/store_api_test.go b/samples/openapi3/client/petstore/go/store_api_test.go index 3088adf7b40..fc0cdec9699 100644 --- a/samples/openapi3/client/petstore/go/store_api_test.go +++ b/samples/openapi3/client/petstore/go/store_api_test.go @@ -11,14 +11,14 @@ import ( func TestPlaceOrder(t *testing.T) { newOrder := sw.Order{ - Id: 0, - PetId: 0, - Quantity: 0, - ShipDate: time.Now().UTC(), - Status: "placed", - Complete: false} + Id: sw.PtrInt64(0), + PetId: sw.PtrInt64(0), + Quantity: sw.PtrInt32(0), + ShipDate: sw.PtrTime(time.Now().UTC()), + Status: sw.PtrString("placed"), + Complete: sw.PtrBool(false)} - _, r, err := client.StoreApi.PlaceOrder(context.Background(), newOrder) + _, r, err := client.StoreApi.PlaceOrder(context.Background()).Order(newOrder).Execute() if err != nil { // Skip parsing time error due to error in Petstore Test Server diff --git a/samples/openapi3/client/petstore/go/user_api_test.go b/samples/openapi3/client/petstore/go/user_api_test.go index 8ef16dd3fdb..ef66e2410c0 100644 --- a/samples/openapi3/client/petstore/go/user_api_test.go +++ b/samples/openapi3/client/petstore/go/user_api_test.go @@ -11,16 +11,16 @@ import ( func TestCreateUser(t *testing.T) { newUser := sw.User{ - Id: 1000, - FirstName: "gopher", - LastName: "lang", - Username: "gopher", - Password: "lang", - Email: "lang@test.com", - Phone: "5101112222", - UserStatus: 1} + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher"), + LastName: sw.PtrString("lang"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} - apiResponse, err := client.UserApi.CreateUser(context.Background(), newUser) + apiResponse, err := client.UserApi.CreateUser(context.Background()).User(newUser).Execute() if err != nil { t.Fatalf("Error while adding user: %v", err) @@ -34,28 +34,28 @@ func TestCreateUser(t *testing.T) { func TestCreateUsersWithArrayInput(t *testing.T) { newUsers := []sw.User{ sw.User{ - Id: int64(1001), - FirstName: "gopher1", - LastName: "lang1", - Username: "gopher1", - Password: "lang1", - Email: "lang1@test.com", - Phone: "5101112222", - UserStatus: int32(1), + Id: sw.PtrInt64(1001), + FirstName: sw.PtrString("gopher1"), + LastName: sw.PtrString("lang1"), + Username: sw.PtrString("gopher1"), + Password: sw.PtrString("lang1"), + Email: sw.PtrString("lang1@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), }, sw.User{ - Id: int64(1002), - FirstName: "gopher2", - LastName: "lang2", - Username: "gopher2", - Password: "lang2", - Email: "lang2@test.com", - Phone: "5101112222", - UserStatus: int32(1), + Id: sw.PtrInt64(1002), + FirstName: sw.PtrString("gopher2"), + LastName: sw.PtrString("lang2"), + Username: sw.PtrString("gopher2"), + Password: sw.PtrString("lang2"), + Email: sw.PtrString("lang2@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), }, } - apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background(), newUsers) + apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).User(newUsers).Execute() if err != nil { t.Fatalf("Error while adding users: %v", err) } @@ -65,13 +65,13 @@ func TestCreateUsersWithArrayInput(t *testing.T) { /* issue deleting users due to issue in the server side (500). commented out below for the time being //tear down - _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") + _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() if err1 != nil { t.Errorf("Error while deleting user") t.Log(err1) } - _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2") + _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2").Execute() if err2 != nil { t.Errorf("Error while deleting user") t.Log(err2) @@ -82,13 +82,13 @@ func TestCreateUsersWithArrayInput(t *testing.T) { func TestGetUserByName(t *testing.T) { assert := assert.New(t) - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() if err != nil { t.Fatalf("Error while getting user by id: %v", err) } else { - assert.Equal(resp.Id, int64(1000), "User id should be equal") - assert.Equal(resp.Username, "gopher", "User name should be gopher") - assert.Equal(resp.LastName, "lang", "Last name should be lang") + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.Username, "gopher", "User name should be gopher") + assert.Equal(*resp.LastName, "lang", "Last name should be lang") //t.Log(resp) } if apiResponse.StatusCode != 200 { @@ -97,7 +97,7 @@ func TestGetUserByName(t *testing.T) { } func TestGetUserByNameWithInvalidID(t *testing.T) { - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999") + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() if apiResponse != nil && apiResponse.StatusCode == 404 { return // This is a pass condition. API will return with a 404 error. } else if err != nil { @@ -115,16 +115,16 @@ func TestUpdateUser(t *testing.T) { assert := assert.New(t) newUser := sw.User{ - Id: 1000, - FirstName: "gopher20", - LastName: "lang20", - Username: "gopher", - Password: "lang", - Email: "lang@test.com", - Phone: "5101112222", - UserStatus: 1} + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher20"), + LastName: sw.PtrString("lang20"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} - apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher", newUser) + apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").User(newUser).Execute() if err != nil { t.Fatalf("Error while deleting user by id: %v", err) } @@ -133,19 +133,19 @@ func TestUpdateUser(t *testing.T) { } //verify changings are correct - resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() if err != nil { t.Fatalf("Error while getting user by id: %v", err) } else { - assert.Equal(resp.Id, int64(1000), "User id should be equal") - assert.Equal(resp.FirstName, "gopher20", "User name should be gopher") - assert.Equal(resp.Password, "lang", "User name should be the same") + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(*resp.Password, "lang", "User name should be the same") } } /* issue deleting users due to issue in the server side (500). commented out below for the time being func TestDeleteUser(t *testing.T) { - apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") + apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() if err != nil { t.Fatalf("Error while deleting user: %v", err)