chore: upgrade sdk generator (#4327)

This commit is contained in:
hackerman 2025-03-24 10:18:30 +01:00 committed by GitHub
parent 39f0276dbc
commit 66edaddf59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
299 changed files with 25170 additions and 14504 deletions

View File

@ -1,7 +1,7 @@
disallowAdditionalPropertiesIfNotPresent: true
disallowAdditionalPropertiesIfNotPresent: false
packageName: client
generateInterfaces: true
isGoSubmodule: false
structPrefix: true
enumClassPrefix: true
useOneOfDiscriminatorLookup: true
isGoSubmodule: false

View File

@ -5,3 +5,7 @@ npmVersion: 0.0.0
supportsES6: true
ensureUniqueParams: true
modelPropertyNaming: original
disallowAdditionalPropertiesIfNotPresent: false
withInterfaces: false
useSingleRequestParameter: true
enumUnknownDefaultCase: true

View File

@ -1,8 +0,0 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

View File

@ -1,221 +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 {{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}"
```
To use a proxy, set the environment variable `HTTP_PROXY`:
```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
## 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(), {{packageName}}.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(), {{packageName}}.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(), {{packageName}}.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), {{packageName}}.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, "BEARER_TOKEN_STRING")
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 := client.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}}{{#-last}}{{infoEmail}}
{{/-last}}{{/apis}}{{/apiInfo}}

View File

@ -1,377 +0,0 @@
{{>partial_header}}
package {{packageName}}
{{#operations}}
import (
"bytes"
"context"
"io"
"net/http"
"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}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.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}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.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}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) {
var (
localVarHTTPMethod = http.Method{{httpMethod}}
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
{{#returnType}}
localVarReturnValue {{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}
{{/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}}"+"}", url.PathEscape(parameterToString(r.{{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")), -1){{/pathParams}}
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.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, _ := io.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 := io.ReadAll(io.LimitReader(localVarHTTPResponse.Body, 1024*1024))
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.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
{{^-last}}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
{{/-last}}
{{^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}}

View File

@ -1,92 +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"
{{#vendorExtensions.x-go-import}}
{{{vendorExtensions.x-go-import}}}
{{/vendorExtensions.x-go-import}}
{{goImportAlias}} "./openapi"
)
func main() {
{{#allParams}}
{{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}
{{/allParams}}
configuration := {{goImportAlias}}.NewConfiguration()
apiClient := {{goImportAlias}}.NewAPIClient(configuration)
resp, r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.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}}** | {{#isContainer}}{{#isArray}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**[]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**map[string]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/isContainer}} | {{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}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/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}}

View File

@ -1,583 +0,0 @@
{{>partial_header}}
package {{packageName}}
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"
{{#withAWSV4Signature}}
awsv4 "github.com/aws/aws-sdk-go/aws/signer/v4"
awscredentials "github.com/aws/aws-sdk-go/aws/credentials"
{{/withAWSV4Signature}}
)
var (
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
)
// APIClient manages communication with the {{appName}} API v{{version}}
// 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
{{#apiInfo}}
{{#apis}}
{{#operations}}
{{#generateInterfaces}}
{{classname}} {{classname}}
{{/generateInterfaces}}
{{^generateInterfaces}}
{{classname}} *{{classname}}Service
{{/generateInterfaces}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
}
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
{{#apiInfo}}
// API Services
{{#apis}}
{{#operations}}
c.{{classname}} = (*{{classname}}Service)(&c.common)
{{/operations}}
{{/apis}}
{{/apiInfo}}
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)
}
{{#withAWSV4Signature}}
// AWS Signature v4 Authentication
if auth, ok := ctx.Value(ContextAWSv4).(AWSv4); ok {
creds := awscredentials.NewStaticCredentials(auth.AccessKey, auth.SecretKey, "")
signer := awsv4.NewSigner(creds)
var reader *strings.Reader
if body == nil {
reader = strings.NewReader("")
} else {
reader = strings.NewReader(body.String())
}
timestamp := time.Now()
_, err := signer.Sign(localVarRequest, reader, "oapi", "eu-west-2", timestamp)
if err != nil {
return nil, err
}
}
{{/withAWSV4Signature}}
}
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
}
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 {
return 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...)
}
// Prevent trying to import "bytes"
func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// 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
}

View File

@ -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)
}

View File

@ -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="{{{gitHost}}}"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="{{{gitUserId}}}"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="{{{gitRepoId}}}"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="{{{releaseNote}}}"
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'

View File

@ -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

View File

@ -1,10 +0,0 @@
module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}
go 1.13
require (
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
{{#withAWSV4Signature}}
github.com/aws/aws-sdk-go v1.34.14
{{/withAWSV4Signature}}
)

View File

@ -1,13 +0,0 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
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=

View File

@ -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}}

View File

@ -1,76 +0,0 @@
// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}}
type {{classname}} struct {
{{#anyOf}}
{{{.}}} *{{{.}}}
{{/anyOf}}
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
var err error
{{#isNullable}}
// this object is nullable so check if the payload is null or empty string
if string(data) == "" || string(data) == "{}" {
return nil
}
{{/isNullable}}
{{#discriminator}}
{{#mappedModels}}
{{#-first}}
// use discriminator value to speed up the lookup
var jsonDict map[string]interface{}
err := json.Unmarshal(data, &jsonDict)
if err != nil {
return fmt.Errorf("Failed to unmarshal JSON into map for the discrimintor lookup.")
}
{{/-first}}
// check if the discriminator value is '{{{mappingName}}}'
if jsonDict["{{{propertyBaseName}}}"] == "{{{mappingName}}}" {
// try to unmarshal JSON data into {{{modelName}}}
err = json.Unmarshal(data, &dst.{{{modelName}}});
if err == nil {
json{{{modelName}}}, _ := json.Marshal(dst.{{{modelName}}})
if string(json{{{modelName}}}) == "{}" { // empty struct
dst.{{{modelName}}} = nil
} else {
return nil // data stored in dst.{{{modelName}}}, return on the first match
}
} else {
dst.{{{modelName}}} = nil
}
}
{{/mappedModels}}
{{/discriminator}}
{{#anyOf}}
// try to unmarshal JSON data into {{{.}}}
err = json.Unmarshal(data, &dst.{{{.}}});
if err == nil {
json{{{.}}}, _ := json.Marshal(dst.{{{.}}})
if string(json{{{.}}}) == "{}" { // empty struct
dst.{{{.}}} = nil
} else {
return nil // data stored in dst.{{{.}}}, return on the first match
}
} else {
dst.{{{.}}} = nil
}
{{/anyOf}}
return fmt.Errorf("Data failed to match schemas in anyOf({{classname}})")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *{{classname}}) MarshalJSON() ([]byte, error) {
{{#anyOf}}
if src.{{{.}}} != nil {
return json.Marshal(&src.{{{.}}})
}
{{/anyOf}}
return nil, nil // no data in anyOf schemas
}
{{>nullable_model}}

View File

@ -1,97 +0,0 @@
{{#models}}{{#model}}# {{classname}}
{{^isEnum}}
## 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}}{{#isContainer}}{{#isArray}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**[]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{dataType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**map[string]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}{{^isFile}}{{^isDateTime}}[{{/isDateTime}}{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}{{^isDateTime}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isDateTime}}{{/isFile}}{{/isPrimitiveType}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
{{/vars}}
{{/vendorExtensions.x-is-one-of-interface}}
## 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}}
{{#isEnum}}
## Enum
{{#allowableValues}}{{#enumVars}}
* `{{name}}` (value: `{{{value}}}`)
{{/enumVars}}{{/allowableValues}}
{{/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}}

View File

@ -1,71 +0,0 @@
// {{{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}}
)
func (v *{{{classname}}}) UnmarshalJSON(src []byte) error {
var value {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}}
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := {{{classname}}}(value)
for _, existing := range []{{classname}}{ {{#allowableValues}}{{#enumVars}}{{{value}}}, {{/enumVars}} {{/allowableValues}} } {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid {{classname}}", value)
}
// Ptr returns reference to {{{name}}} value
func (v {{{classname}}}) Ptr() *{{{classname}}} {
return &v
}
type Nullable{{{classname}}} struct {
value *{{{classname}}}
isSet bool
}
func (v Nullable{{classname}}) Get() *{{classname}} {
return v.value
}
func (v *Nullable{{classname}}) Set(val *{{classname}}) {
v.value = val
v.isSet = true
}
func (v Nullable{{classname}}) IsSet() bool {
return v.isSet
}
func (v *Nullable{{classname}}) Unset() {
v.value = nil
v.isSet = false
}
func NewNullable{{classname}}(val *{{classname}}) *Nullable{{classname}} {
return &Nullable{{classname}}{value: val, isSet: true}
}
func (v Nullable{{{classname}}}) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *Nullable{{{classname}}}) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -1,114 +0,0 @@
// {{classname}} - {{#description}}{{{description}}}{{/description}}{{^description}}struct for {{{classname}}}{{/description}}
type {{classname}} struct {
{{#oneOf}}
{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} *{{{.}}}
{{/oneOf}}
}
{{#oneOf}}
// {{{.}}}As{{classname}} is a convenience function that returns {{{.}}} wrapped in {{classname}}
func {{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}As{{classname}}(v *{{{.}}}) {{classname}} {
return {{classname}}{
{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}: v,
}
}
{{/oneOf}}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
var err error
{{#isNullable}}
// this object is nullable so check if the payload is null or empty string
if string(data) == "" || string(data) == "{}" {
return nil
}
{{/isNullable}}
{{#useOneOfDiscriminatorLookup}}
{{#discriminator}}
{{#mappedModels}}
{{#-first}}
// use discriminator value to speed up the lookup
var jsonDict map[string]interface{}
err = newStrictDecoder(data).Decode(&jsonDict)
if err != nil {
return fmt.Errorf("Failed to unmarshal JSON into map for the discrimintor lookup.")
}
{{/-first}}
// check if the discriminator value is '{{{mappingName}}}'
if jsonDict["{{{propertyBaseName}}}"] == "{{{mappingName}}}" {
// try to unmarshal JSON data into {{{modelName}}}
err = json.Unmarshal(data, &dst.{{{modelName}}})
if err == nil {
return nil // data stored in dst.{{{modelName}}}, return on the first match
} else {
dst.{{{modelName}}} = nil
return fmt.Errorf("Failed to unmarshal {{classname}} as {{{modelName}}}: %s", err.Error())
}
}
{{/mappedModels}}
{{/discriminator}}
return nil
{{/useOneOfDiscriminatorLookup}}
{{^useOneOfDiscriminatorLookup}}
match := 0
{{#oneOf}}
// try to unmarshal data into {{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}
err = newStrictDecoder(data).Decode(&dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}})
if err == nil {
json{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}, _ := json.Marshal(dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}})
if string(json{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}) == "{}" { // empty struct
dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} = nil
} else {
match++
}
} else {
dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} = nil
}
{{/oneOf}}
if match > 1 { // more than 1 match
// reset to nil
{{#oneOf}}
dst.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} = nil
{{/oneOf}}
return fmt.Errorf("Data matches more than one schema in oneOf({{classname}})")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("Data failed to match schemas in oneOf({{classname}})")
}
{{/useOneOfDiscriminatorLookup}}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src {{classname}}) MarshalJSON() ([]byte, error) {
{{#oneOf}}
if src.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} != nil {
return json.Marshal(&src.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}})
}
{{/oneOf}}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *{{classname}}) GetActualInstance() (interface{}) {
if obj == nil {
return nil
}
{{#oneOf}}
if obj.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}} != nil {
return obj.{{#lambda.titlecase}}{{{.}}}{{/lambda.titlecase}}
}
{{/oneOf}}
// all schemas are nil
return nil
}
{{>nullable_model}}

View File

@ -1,391 +0,0 @@
// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}}
type {{classname}} struct {
{{#parent}}
{{^isMap}}
{{^isArray}}
{{{parent}}}
{{/isArray}}
{{/isMap}}
{{#isArray}}
Items {{{parent}}}
{{/isArray}}
{{/parent}}
{{#vars}}
{{^-first}}
{{/-first}}
{{#description}}
// {{{description}}}
{{/description}}
{{name}} {{^required}}{{^isNullable}}{{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/vars}}
{{#isAdditionalPropertiesTrue}}
AdditionalProperties map[string]interface{}
{{/isAdditionalPropertiesTrue}}
}
{{#isAdditionalPropertiesTrue}}
type _{{{classname}}} {{{classname}}}
{{/isAdditionalPropertiesTrue}}
// 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
func New{{classname}}({{#vars}}{{#required}}{{nameInCamelCase}} {{dataType}}, {{/required}}{{/vars}}) *{{classname}} {
this := {{classname}}{}
{{#vars}}
{{#required}}
this.{{name}} = {{nameInCamelCase}}
{{/required}}
{{^required}}
{{#defaultValue}}
{{^vendorExtensions.x-golang-is-container}}
{{#isNullable}}
var {{nameInCamelCase}} {{{datatypeWithEnum}}} = {{{.}}}
this.{{name}} = *New{{{dataType}}}(&{{nameInCamelCase}})
{{/isNullable}}
{{^isNullable}}
var {{nameInCamelCase}} {{{dataType}}} = {{{.}}}
this.{{name}} = &{{nameInCamelCase}}
{{/isNullable}}
{{/vendorExtensions.x-golang-is-container}}
{{/defaultValue}}
{{/required}}
{{/vars}}
return &this
}
// 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
func New{{classname}}WithDefaults() *{{classname}} {
this := {{classname}}{}
{{#vars}}
{{#defaultValue}}
{{^vendorExtensions.x-golang-is-container}}
{{#isNullable}}
{{!we use datatypeWithEnum here, since it will represent the non-nullable name of the datatype, e.g. int64 for NullableInt64}}
var {{nameInCamelCase}} {{{datatypeWithEnum}}} = {{{.}}}
this.{{name}} = *New{{{dataType}}}(&{{nameInCamelCase}})
{{/isNullable}}
{{^isNullable}}
var {{nameInCamelCase}} {{{dataType}}} = {{{.}}}
this.{{name}} = {{^required}}&{{/required}}{{nameInCamelCase}}
{{/isNullable}}
{{/vendorExtensions.x-golang-is-container}}
{{/defaultValue}}
{{/vars}}
return &this
}
{{#vars}}
{{#required}}
// Get{{name}} returns the {{name}} field value
{{#isNullable}}
// If the value is explicit nil, the zero value for {{vendorExtensions.x-go-base-type}} will be returned
{{/isNullable}}
func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} {
if o == nil {{#isNullable}}{{^vendorExtensions.x-golang-is-container}}|| o.{{name}}.Get() == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
var ret {{vendorExtensions.x-go-base-type}}
return ret
}
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
return o.{{name}}
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
return *o.{{name}}.Get()
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{^isNullable}}
return o.{{name}}
{{/isNullable}}
}
// Get{{name}}Ok returns a tuple with the {{name}} field value
// and a boolean to check if the value has been set.
{{#isNullable}}
// NOTE: If the value is an explicit nil, `nil, true` will be returned
{{/isNullable}}
func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) {
if o == nil {{#isNullable}}{{#vendorExtensions.x-golang-is-container}}|| o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
return nil, false
}
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
return {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}o.{{name}}, true
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
return o.{{name}}.Get(), o.{{name}}.IsSet()
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{^isNullable}}
return {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}o.{{name}}, true
{{/isNullable}}
}
// Set{{name}} sets field value
func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}}) {
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
o.{{name}} = v
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
o.{{name}}.Set(&v)
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{^isNullable}}
o.{{name}} = v
{{/isNullable}}
}
{{/required}}
{{^required}}
// Get{{name}} returns the {{name}} field value if set, zero value otherwise{{#isNullable}} (both if not set or set to explicit null){{/isNullable}}.
func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} {
if o == nil {{^isNullable}}|| o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{^vendorExtensions.x-golang-is-container}}|| o.{{name}}.Get() == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
var ret {{vendorExtensions.x-go-base-type}}
return ret
}
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
return o.{{name}}
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
return *o.{{name}}.Get()
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{^isNullable}}
return {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}o.{{name}}
{{/isNullable}}
}
// Get{{name}}Ok returns a tuple with the {{name}} field value if set, nil otherwise
// and a boolean to check if the value has been set.
{{#isNullable}}
// NOTE: If the value is an explicit nil, `nil, true` will be returned
{{/isNullable}}
func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) {
if o == nil {{^isNullable}}|| o.{{name}} == nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}}|| o.{{name}} == nil{{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
return nil, false
}
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
return {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}o.{{name}}, true
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
return o.{{name}}.Get(), o.{{name}}.IsSet()
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{^isNullable}}
return o.{{name}}, true
{{/isNullable}}
}
// Has{{name}} returns a boolean if a field has been set.
func (o *{{classname}}) Has{{name}}() bool {
if o != nil && {{^isNullable}}o.{{name}} != nil{{/isNullable}}{{#isNullable}}{{#vendorExtensions.x-golang-is-container}}o.{{name}} != nil{{/vendorExtensions.x-golang-is-container}}{{^vendorExtensions.x-golang-is-container}}o.{{name}}.IsSet(){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
return true
}
return false
}
// Set{{name}} gets a reference to the given {{dataType}} and assigns it to the {{name}} field.
func (o *{{classname}}) Set{{name}}(v {{vendorExtensions.x-go-base-type}}) {
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
o.{{name}} = v
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
o.{{name}}.Set({{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}v)
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{^isNullable}}
o.{{name}} = {{^isArray}}{{^isFreeFormObject}}&{{/isFreeFormObject}}{{/isArray}}v
{{/isNullable}}
}
{{#isNullable}}
{{^vendorExtensions.x-golang-is-container}}
// Set{{name}}Nil sets the value for {{name}} to be an explicit nil
func (o *{{classname}}) Set{{name}}Nil() {
o.{{name}}.Set(nil)
}
// Unset{{name}} ensures that no value is present for {{name}}, not even an explicit nil
func (o *{{classname}}) Unset{{name}}() {
o.{{name}}.Unset()
}
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{/required}}
{{/vars}}
func (o {{classname}}) MarshalJSON() ([]byte, error) {
toSerialize := {{#isArray}}make([]interface{}, len(o.Items)){{/isArray}}{{^isArray}}map[string]interface{}{}{{/isArray}}
{{#parent}}
{{^isMap}}
{{^isArray}}
serialized{{parent}}, err{{parent}} := json.Marshal(o.{{parent}})
if err{{parent}} != nil {
return []byte{}, err{{parent}}
}
err{{parent}} = json.Unmarshal([]byte(serialized{{parent}}), &toSerialize)
if err{{parent}} != nil {
return []byte{}, err{{parent}}
}
{{/isArray}}
{{/isMap}}
{{#isArray}}
for i, item := range o.Items {
toSerialize[i] = item
}
{{/isArray}}
{{/parent}}
{{#vars}}
{{! if argument is nullable, only serialize it if it is set}}
{{#isNullable}}
{{#vendorExtensions.x-golang-is-container}}
{{! support for container fields is not ideal at this point because of lack of Nullable* types}}
if o.{{name}} != nil {
toSerialize["{{baseName}}"] = o.{{name}}
}
{{/vendorExtensions.x-golang-is-container}}
{{^vendorExtensions.x-golang-is-container}}
if {{#required}}true{{/required}}{{^required}}o.{{name}}.IsSet(){{/required}} {
toSerialize["{{baseName}}"] = o.{{name}}.Get()
}
{{/vendorExtensions.x-golang-is-container}}
{{/isNullable}}
{{! if argument is not nullable, don't set it if it is nil}}
{{^isNullable}}
if {{#required}}true{{/required}}{{^required}}o.{{name}} != nil{{/required}} {
toSerialize["{{baseName}}"] = o.{{name}}
}
{{/isNullable}}
{{/vars}}
{{#isAdditionalPropertiesTrue}}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
{{/isAdditionalPropertiesTrue}}
return json.Marshal(toSerialize)
}
{{#isAdditionalPropertiesTrue}}
func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) {
{{#parent}}
{{^isMap}}
type {{classname}}WithoutEmbeddedStruct struct {
{{#vars}}
{{^-first}}
{{/-first}}
{{#description}}
// {{{description}}}
{{/description}}
{{name}} {{^required}}{{^isNullable}}*{{/isNullable}}{{/required}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}`
{{/vars}}
}
var{{{classname}}}WithoutEmbeddedStruct := {{{classname}}}WithoutEmbeddedStruct{}
err = json.Unmarshal(bytes, &var{{{classname}}}WithoutEmbeddedStruct)
if err == nil {
var{{{classname}}} := _{{{classname}}}{}
{{#vars}}
var{{{classname}}}.{{{name}}} = var{{{classname}}}WithoutEmbeddedStruct.{{{name}}}
{{/vars}}
*o = {{{classname}}}(var{{{classname}}})
} else {
return err
}
var{{{classname}}} := _{{{classname}}}{}
err = json.Unmarshal(bytes, &var{{{classname}}})
if err == nil {
o.{{{parent}}} = var{{{classname}}}.{{{parent}}}
} else {
return err
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
{{#vars}}
delete(additionalProperties, "{{{baseName}}}")
{{/vars}}
// remove fields from embedded structs
reflect{{{parent}}} := reflect.ValueOf(o.{{{parent}}})
for i := 0; i < reflect{{{parent}}}.Type().NumField(); i++ {
t := reflect{{{parent}}}.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
{{/isMap}}
{{#isMap}}
var{{{classname}}} := _{{{classname}}}{}
if err = json.Unmarshal(bytes, &var{{{classname}}}); err == nil {
*o = {{{classname}}}(var{{{classname}}})
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
{{#vars}}
delete(additionalProperties, "{{{baseName}}}")
{{/vars}}
o.AdditionalProperties = additionalProperties
}
return err
{{/isMap}}
{{/parent}}
{{^parent}}
var{{{classname}}} := _{{{classname}}}{}
if err = json.Unmarshal(bytes, &var{{{classname}}}); err == nil {
*o = {{{classname}}}(var{{{classname}}})
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
{{#vars}}
delete(additionalProperties, "{{{baseName}}}")
{{/vars}}
o.AdditionalProperties = additionalProperties
}
return err
{{/parent}}
}
{{/isAdditionalPropertiesTrue}}
{{#isArray}}
func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) {
return json.Unmarshal(bytes, &o.Items)
}
{{/isArray}}
{{>nullable_model}}

View File

@ -1,35 +0,0 @@
type Nullable{{{classname}}} struct {
value {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{{classname}}}
isSet bool
}
func (v Nullable{{classname}}) Get() {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{classname}} {
return v.value
}
func (v *Nullable{{classname}}) Set(val {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{classname}}) {
v.value = val
v.isSet = true
}
func (v Nullable{{classname}}) IsSet() bool {
return v.isSet
}
func (v *Nullable{{classname}}) Unset() {
v.value = nil
v.isSet = false
}
func NewNullable{{classname}}(val {{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{classname}}) *Nullable{{classname}} {
return &Nullable{{classname}}{value: val, isSet: true}
}
func (v Nullable{{{classname}}}) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *Nullable{{{classname}}}) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -1 +0,0 @@
{{{openapi-yaml}}}

View File

@ -1,18 +0,0 @@
/*
{{#appName}}
* {{{appName}}}
*
{{/appName}}
{{#appDescription}}
* {{{appDescription}}}
*
{{/appDescription}}
{{#version}}
* API version: {{{version}}}
{{/version}}
{{#infoEmail}}
* Contact: {{{infoEmail}}}
{{/infoEmail}}
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

View File

@ -1,38 +0,0 @@
{{>partial_header}}
package {{packageName}}
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
}

View File

@ -1,414 +0,0 @@
{{>partial_header}}
package {{packageName}}
import (
"bytes"
"context"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"encoding/pem"
"fmt"
"io"
"net/http"
"net/textproto"
"os"
"strings"
"time"
)
const (
// Constants for HTTP signature parameters.
// The '(request-target)' parameter concatenates the lowercased :method, an
// ASCII space, and the :path pseudo-headers.
HttpSignatureParameterRequestTarget string = "(request-target)"
// The '(created)' parameter expresses when the signature was
// created. The value MUST be a Unix timestamp integer value.
HttpSignatureParameterCreated string = "(created)"
// The '(expires)' parameter expresses when the signature ceases to
// be valid. The value MUST be a Unix timestamp integer value.
HttpSignatureParameterExpires string = "(expires)"
)
const (
// Constants for HTTP headers.
// The 'Host' header, as defined in RFC 2616, section 14.23.
HttpHeaderHost string = "Host"
// The 'Date' header.
HttpHeaderDate string = "Date"
// The digest header, as defined in RFC 3230, section 4.3.2.
HttpHeaderDigest string = "Digest"
// The HTTP Authorization header, as defined in RFC 7235, section 4.2.
HttpHeaderAuthorization string = "Authorization"
)
const (
// Specifies the Digital Signature Algorithm is derived from metadata
// associated with 'keyId'. Supported DSA algorithms are RSASSA-PKCS1-v1_5,
// RSASSA-PSS, and ECDSA.
// The hash is SHA-512.
// This is the default value.
HttpSigningSchemeHs2019 string = "hs2019"
// Use RSASSA-PKCS1-v1_5 with SHA-512 hash. Deprecated.
HttpSigningSchemeRsaSha512 string = "rsa-sha512"
// Use RSASSA-PKCS1-v1_5 with SHA-256 hash. Deprecated.
HttpSigningSchemeRsaSha256 string = "rsa-sha256"
// RFC 8017 section 7.2
// Calculate the message signature using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5.
// PKCSV1_5 is deterministic. The same message and key will produce an identical
// signature value each time.
HttpSigningAlgorithmRsaPKCS1v15 string = "RSASSA-PKCS1-v1_5"
// Calculate the message signature using probabilistic signature scheme RSASSA-PSS.
// PSS is randomized and will produce a different signature value each time.
HttpSigningAlgorithmRsaPSS string = "RSASSA-PSS"
)
var supportedSigningSchemes = map[string]bool{
HttpSigningSchemeHs2019: true,
HttpSigningSchemeRsaSha512: true,
HttpSigningSchemeRsaSha256: true,
}
// HttpSignatureAuth provides HTTP signature authentication to a request passed
// via context using ContextHttpSignatureAuth.
// An 'Authorization' header is calculated by creating a hash of select headers,
// and optionally the body of the HTTP request, then signing the hash value using
// a private key which is available to the client.
//
// SignedHeaders specifies the list of HTTP headers that are included when generating
// the message signature.
// The two special signature headers '(request-target)' and '(created)' SHOULD be
// included in SignedHeaders.
// The '(created)' header expresses when the signature was created.
// The '(request-target)' header is a concatenation of the lowercased :method, an
// ASCII space, and the :path pseudo-headers.
//
// For example, SignedHeaders can be set to:
// (request-target) (created) date host digest
//
// When SignedHeaders is not specified, the client defaults to a single value, '(created)',
// in the list of HTTP headers.
// When SignedHeaders contains the 'Digest' value, the client performs the following operations:
// 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2.
// 2. Set the 'Digest' header in the request body.
// 3. Include the 'Digest' header and value in the HTTP signature.
type HttpSignatureAuth struct {
KeyId string // A key identifier.
PrivateKeyPath string // The path to the private key.
Passphrase string // The passphrase to decrypt the private key, if the key is encrypted.
SigningScheme string // The signature scheme, when signing HTTP requests. Supported value is 'hs2019'.
// The signature algorithm, when signing HTTP requests.
// Supported values are RSASSA-PKCS1-v1_5, RSASSA-PSS.
SigningAlgorithm string
SignedHeaders []string // A list of HTTP headers included when generating the signature for the message.
// SignatureMaxValidity specifies the maximum duration of the signature validity.
// The value is used to set the '(expires)' signature parameter in the HTTP request.
// '(expires)' is set to '(created)' plus the value of the SignatureMaxValidity field.
// To specify the '(expires)' signature parameter, set 'SignatureMaxValidity' and add '(expires)' to 'SignedHeaders'.
SignatureMaxValidity time.Duration
privateKey crypto.PrivateKey // The private key used to sign HTTP requests.
}
// ContextWithValue validates the HttpSignatureAuth configuration parameters and returns a context
// suitable for HTTP signature. An error is returned if the HttpSignatureAuth configuration parameters
// are invalid.
func (h *HttpSignatureAuth) ContextWithValue(ctx context.Context) (context.Context, error) {
if h.KeyId == "" {
return nil, fmt.Errorf("Key ID must be specified")
}
if h.PrivateKeyPath == "" {
return nil, fmt.Errorf("Private key path must be specified")
}
if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok {
return nil, fmt.Errorf("Invalid signing scheme: '%v'", h.SigningScheme)
}
m := make(map[string]bool)
for _, h := range h.SignedHeaders {
if strings.ToLower(h) == strings.ToLower(HttpHeaderAuthorization) {
return nil, fmt.Errorf("Signed headers cannot include the 'Authorization' header")
}
m[h] = true
}
if len(m) != len(h.SignedHeaders) {
return nil, fmt.Errorf("List of signed headers cannot have duplicate names")
}
if h.SignatureMaxValidity < 0 {
return nil, fmt.Errorf("Signature max validity must be a positive value")
}
if err := h.loadPrivateKey(); err != nil {
return nil, err
}
return context.WithValue(ctx, ContextHttpSignatureAuth, *h), nil
}
// GetPublicKey returns the public key associated with this HTTP signature configuration.
func (h *HttpSignatureAuth) GetPublicKey() (crypto.PublicKey, error) {
if h.privateKey == nil {
if err := h.loadPrivateKey(); err != nil {
return nil, err
}
}
switch key := h.privateKey.(type) {
case *rsa.PrivateKey:
return key.Public(), nil
case *ecdsa.PrivateKey:
return key.Public(), nil
default:
// Do not change '%T' to anything else such as '%v'!
// The value of the private key must not be returned.
return nil, fmt.Errorf("Unsupported key: %T", h.privateKey)
}
}
// loadPrivateKey reads the private key from the file specified in the HttpSignatureAuth.
func (h *HttpSignatureAuth) loadPrivateKey() (err error) {
var file *os.File
file, err = os.Open(h.PrivateKeyPath)
if err != nil {
return fmt.Errorf("Cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err)
}
defer func() {
err = file.Close()
}()
var priv []byte
priv, err = io.ReadAll(file)
if err != nil {
return err
}
pemBlock, _ := pem.Decode(priv)
if pemBlock == nil {
// No PEM data has been found.
return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath)
}
var privKey []byte
if x509.IsEncryptedPEMBlock(pemBlock) {
// The PEM data is encrypted.
privKey, err = x509.DecryptPEMBlock(pemBlock, []byte(h.Passphrase))
if err != nil {
// Failed to decrypt PEM block. Because of deficiencies in the encrypted-PEM format,
// it's not always possibleto detect an incorrect password.
return err
}
} else {
privKey = pemBlock.Bytes
}
switch pemBlock.Type {
case "RSA PRIVATE KEY":
if h.privateKey, err = x509.ParsePKCS1PrivateKey(privKey); err != nil {
return err
}
case "EC PRIVATE KEY", "PRIVATE KEY":
// https://tools.ietf.org/html/rfc5915 section 4.
if h.privateKey, err = x509.ParsePKCS8PrivateKey(privKey); err != nil {
return err
}
default:
return fmt.Errorf("Key '%s' is not supported", pemBlock.Type)
}
return nil
}
// SignRequest signs the request using HTTP signature.
// See https://datatracker.ietf.org/doc/draft-cavage-http-signatures/
//
// Do not add, remove or change headers that are included in the SignedHeaders
// after SignRequest has been invoked; this is because the header values are
// included in the signature. Any subsequent alteration will cause a signature
// verification failure.
// If there are multiple instances of the same header field, all
// header field values associated with the header field MUST be
// concatenated, separated by a ASCII comma and an ASCII space
// ', ', and used in the order in which they will appear in the
// transmitted HTTP message.
func SignRequest(
ctx context.Context,
r *http.Request,
auth HttpSignatureAuth) error {
if auth.privateKey == nil {
return fmt.Errorf("Private key is not set")
}
now := time.Now()
date := now.UTC().Format(http.TimeFormat)
// The 'created' field expresses when the signature was created.
// The value MUST be a Unix timestamp integer value. See 'HTTP signature' section 2.1.4.
created := now.Unix()
var h crypto.Hash
var err error
var prefix string
var expiresUnix float64
if auth.SignatureMaxValidity < 0 {
return fmt.Errorf("Signature validity must be a positive value")
}
if auth.SignatureMaxValidity > 0 {
e := now.Add(auth.SignatureMaxValidity)
expiresUnix = float64(e.Unix()) + float64(e.Nanosecond()) / float64(time.Second)
}
// Determine the cryptographic hash to be used for the signature and the body digest.
switch auth.SigningScheme {
case HttpSigningSchemeRsaSha512, HttpSigningSchemeHs2019:
h = crypto.SHA512
prefix = "SHA-512="
case HttpSigningSchemeRsaSha256:
// This is deprecated and should no longer be used.
h = crypto.SHA256
prefix = "SHA-256="
default:
return fmt.Errorf("Unsupported signature scheme: %v", auth.SigningScheme)
}
if !h.Available() {
return fmt.Errorf("Hash '%v' is not available", h)
}
// Build the "(request-target)" signature header.
var sb bytes.Buffer
fmt.Fprintf(&sb, "%s %s", strings.ToLower(r.Method), r.URL.EscapedPath())
if r.URL.RawQuery != "" {
// The ":path" pseudo-header field includes the path and query parts
// of the target URI (the "path-absolute" production and optionally a
// '?' character followed by the "query" production (see Sections 3.3
// and 3.4 of [RFC3986]
fmt.Fprintf(&sb, "?%s", r.URL.RawQuery)
}
requestTarget := sb.String()
sb.Reset()
// Build the string to be signed.
signedHeaders := auth.SignedHeaders
if len(signedHeaders) == 0 {
signedHeaders = []string{HttpSignatureParameterCreated}
}
// Validate the list of signed headers has no duplicates.
m := make(map[string]bool)
for _, h := range signedHeaders {
m[h] = true
}
if len(m) != len(signedHeaders) {
return fmt.Errorf("List of signed headers must not have any duplicates")
}
hasCreatedParameter := false
hasExpiresParameter := false
for i, header := range signedHeaders {
header = strings.ToLower(header)
var value string
switch header {
case strings.ToLower(HttpHeaderAuthorization):
return fmt.Errorf("Cannot include the 'Authorization' header as a signed header.")
case HttpSignatureParameterRequestTarget:
value = requestTarget
case HttpSignatureParameterCreated:
value = fmt.Sprintf("%d", created)
hasCreatedParameter = true
case HttpSignatureParameterExpires:
if auth.SignatureMaxValidity.Nanoseconds() == 0 {
return fmt.Errorf("Cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured.")
}
value = fmt.Sprintf("%.3f", expiresUnix)
hasExpiresParameter = true
case "date":
value = date
r.Header.Set(HttpHeaderDate, date)
case "digest":
// Calculate the digest of the HTTP request body.
// Calculate body digest per RFC 3230 section 4.3.2
bodyHash := h.New()
if r.Body != nil {
// Make a copy of the body io.Reader so that we can read the body to calculate the hash,
// then one more time when marshaling the request.
var body io.Reader
body, err = r.GetBody()
if err != nil {
return err
}
if _, err = io.Copy(bodyHash, body); err != nil {
return err
}
}
d := bodyHash.Sum(nil)
value = prefix + base64.StdEncoding.EncodeToString(d)
r.Header.Set(HttpHeaderDigest, value)
case "host":
value = r.Host
r.Header.Set(HttpHeaderHost, r.Host)
default:
var ok bool
var v []string
canonicalHeader := textproto.CanonicalMIMEHeaderKey(header)
if v, ok = r.Header[canonicalHeader]; !ok {
// If a header specified in the headers parameter cannot be matched with
// a provided header in the message, the implementation MUST produce an error.
return fmt.Errorf("Header '%s' does not exist in the request", canonicalHeader)
}
// If there are multiple instances of the same header field, all
// header field values associated with the header field MUST be
// concatenated, separated by a ASCII comma and an ASCII space
// `, `, and used in the order in which they will appear in the
// transmitted HTTP message.
value = strings.Join(v, ", ")
}
if i > 0 {
fmt.Fprintf(&sb, "\n")
}
fmt.Fprintf(&sb, "%s: %s", header, value)
}
if expiresUnix != 0 && !hasExpiresParameter {
return fmt.Errorf("SignatureMaxValidity is specified, but '(expired)' parameter is not present")
}
msg := []byte(sb.String())
msgHash := h.New()
if _, err = msgHash.Write(msg); err != nil {
return err
}
d := msgHash.Sum(nil)
var signature []byte
switch key := auth.privateKey.(type) {
case *rsa.PrivateKey:
switch auth.SigningAlgorithm {
case HttpSigningAlgorithmRsaPKCS1v15:
signature, err = rsa.SignPKCS1v15(rand.Reader, key, h, d)
case "", HttpSigningAlgorithmRsaPSS:
signature, err = rsa.SignPSS(rand.Reader, key, h, d, nil)
default:
return fmt.Errorf("Unsupported signing algorithm: '%s'", auth.SigningAlgorithm)
}
case *ecdsa.PrivateKey:
signature, err = key.Sign(rand.Reader, d, h)
case ed25519.PrivateKey: // requires go 1.13
signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0))
default:
return fmt.Errorf("Unsupported private key")
}
if err != nil {
return err
}
sb.Reset()
for i, header := range signedHeaders {
if i > 0 {
sb.WriteRune(' ')
}
sb.WriteString(strings.ToLower(header))
}
headers_list := sb.String()
sb.Reset()
fmt.Fprintf(&sb, `Signature keyId="%s",algorithm="%s",`, auth.KeyId, auth.SigningScheme)
if hasCreatedParameter {
fmt.Fprintf(&sb, "created=%d,", created)
}
if hasExpiresParameter {
fmt.Fprintf(&sb, "expires=%.3f,", expiresUnix)
}
fmt.Fprintf(&sb, `headers="%s",signature="%s"`, headers_list, base64.StdEncoding.EncodeToString(signature))
authStr := sb.String()
r.Header.Set(HttpHeaderAuthorization, authStr)
return nil
}

View File

@ -1,326 +0,0 @@
{{>partial_header}}
package {{packageName}}
import (
"encoding/json"
"time"
)
// PtrBool is a helper routine that returns a pointer to given boolean value.
func PtrBool(v bool) *bool { return &v }
// PtrInt is a helper routine that returns a pointer to given integer value.
func PtrInt(v int) *int { return &v }
// PtrInt32 is a helper routine that returns a pointer to given integer value.
func PtrInt32(v int32) *int32 { return &v }
// PtrInt64 is a helper routine that returns a pointer to given integer value.
func PtrInt64(v int64) *int64 { return &v }
// PtrFloat32 is a helper routine that returns a pointer to given float value.
func PtrFloat32(v float32) *float32 { return &v }
// PtrFloat64 is a helper routine that returns a pointer to given float value.
func PtrFloat64(v float64) *float64 { return &v }
// PtrString is a helper routine that returns a pointer to given string value.
func PtrString(v string) *string { return &v }
// PtrTime is helper routine that returns a pointer to given Time value.
func PtrTime(v time.Time) *time.Time { return &v }
type NullableBool struct {
value *bool
isSet bool
}
func (v NullableBool) Get() *bool {
return v.value
}
func (v *NullableBool) Set(val *bool) {
v.value = val
v.isSet = true
}
func (v NullableBool) IsSet() bool {
return v.isSet
}
func (v *NullableBool) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBool(val *bool) *NullableBool {
return &NullableBool{value: val, isSet: true}
}
func (v NullableBool) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBool) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt struct {
value *int
isSet bool
}
func (v NullableInt) Get() *int {
return v.value
}
func (v *NullableInt) Set(val *int) {
v.value = val
v.isSet = true
}
func (v NullableInt) IsSet() bool {
return v.isSet
}
func (v *NullableInt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt(val *int) *NullableInt {
return &NullableInt{value: val, isSet: true}
}
func (v NullableInt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt32 struct {
value *int32
isSet bool
}
func (v NullableInt32) Get() *int32 {
return v.value
}
func (v *NullableInt32) Set(val *int32) {
v.value = val
v.isSet = true
}
func (v NullableInt32) IsSet() bool {
return v.isSet
}
func (v *NullableInt32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt32(val *int32) *NullableInt32 {
return &NullableInt32{value: val, isSet: true}
}
func (v NullableInt32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt64 struct {
value *int64
isSet bool
}
func (v NullableInt64) Get() *int64 {
return v.value
}
func (v *NullableInt64) Set(val *int64) {
v.value = val
v.isSet = true
}
func (v NullableInt64) IsSet() bool {
return v.isSet
}
func (v *NullableInt64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt64(val *int64) *NullableInt64 {
return &NullableInt64{value: val, isSet: true}
}
func (v NullableInt64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat32 struct {
value *float32
isSet bool
}
func (v NullableFloat32) Get() *float32 {
return v.value
}
func (v *NullableFloat32) Set(val *float32) {
v.value = val
v.isSet = true
}
func (v NullableFloat32) IsSet() bool {
return v.isSet
}
func (v *NullableFloat32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat32(val *float32) *NullableFloat32 {
return &NullableFloat32{value: val, isSet: true}
}
func (v NullableFloat32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat64 struct {
value *float64
isSet bool
}
func (v NullableFloat64) Get() *float64 {
return v.value
}
func (v *NullableFloat64) Set(val *float64) {
v.value = val
v.isSet = true
}
func (v NullableFloat64) IsSet() bool {
return v.isSet
}
func (v *NullableFloat64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat64(val *float64) *NullableFloat64 {
return &NullableFloat64{value: val, isSet: true}
}
func (v NullableFloat64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableString struct {
value *string
isSet bool
}
func (v NullableString) Get() *string {
return v.value
}
func (v *NullableString) Set(val *string) {
v.value = val
v.isSet = true
}
func (v NullableString) IsSet() bool {
return v.isSet
}
func (v *NullableString) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableString(val *string) *NullableString {
return &NullableString{value: val, isSet: true}
}
func (v NullableString) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableString) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableTime struct {
value *time.Time
isSet bool
}
func (v NullableTime) Get() *time.Time {
return v.value
}
func (v *NullableTime) Set(val *time.Time) {
v.value = val
v.isSet = true
}
func (v NullableTime) IsSet() bool {
return v.isSet
}
func (v *NullableTime) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTime(val *time.Time) *NullableTime {
return &NullableTime{value: val, isSet: true}
}
func (v NullableTime) MarshalJSON() ([]byte, error) {
return v.value.MarshalJSON()
}
func (v *NullableTime) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@ -139,7 +139,6 @@ sdk: .bin/swagger .bin/ory node_modules
--git-repo-id client-go \
--git-host github.com \
--api-name-suffix "API" \
-t .schema/openapi/templates/go \
-c .schema/openapi/gen.go.yml
(cd internal/httpclient; rm -rf go.mod go.sum test api docs)
@ -153,7 +152,6 @@ sdk: .bin/swagger .bin/ory node_modules
--git-repo-id client-go \
--git-host github.com \
--api-name-suffix "API" \
-t .schema/openapi/templates/go \
-c .schema/openapi/gen.go.yml
(cd internal/client-go; go mod edit -module github.com/ory/client-go go.mod; rm -rf test api docs; go mod tidy)

View File

@ -34,7 +34,7 @@ func TestGetCmd(t *testing.T) {
ij, err := json.Marshal(identity.WithCredentialsMetadataAndAdminMetadataInJSON(*i))
require.NoError(t, err)
assertx.EqualAsJSONExcept(t, json.RawMessage(ij), json.RawMessage(stdOut), []string{"created_at", "updated_at"})
assertx.EqualAsJSONExcept(t, json.RawMessage(ij), json.RawMessage(stdOut), []string{"created_at", "updated_at", "AdditionalProperties"})
})
t.Run("case=gets three identities", func(t *testing.T) {
@ -45,7 +45,7 @@ func TestGetCmd(t *testing.T) {
isj, err := json.Marshal(is)
require.NoError(t, err)
assertx.EqualAsJSONExcept(t, json.RawMessage(isj), json.RawMessage(stdOut), []string{"created_at", "updated_at"})
assertx.EqualAsJSONExcept(t, json.RawMessage(isj), json.RawMessage(stdOut), []string{"created_at", "updated_at", "AdditionalProperties"})
})
t.Run("case=fails with unknown ID", func(t *testing.T) {
@ -106,7 +106,7 @@ func TestGetCmd(t *testing.T) {
ij, err := json.Marshal(identity.WithCredentialsAndAdminMetadataInJSON(*di))
require.NoError(t, err)
ii := []string{"id", "schema_url", "state_changed_at", "created_at", "updated_at", "credentials.oidc.created_at", "credentials.oidc.updated_at", "credentials.oidc.version"}
ii := []string{"id", "schema_url", "state_changed_at", "created_at", "updated_at", "credentials.oidc.created_at", "credentials.oidc.updated_at", "credentials.oidc.version", "AdditionalProperties"}
assertx.EqualAsJSONExcept(t, json.RawMessage(ij), json.RawMessage(stdOut), ii)
})
}

View File

@ -19,7 +19,7 @@ func toSession() *ory.Session {
email, password := pkg.RandomCredentials()
_, sessionToken := pkg.CreateIdentityWithSession(client, email, password)
session, res, err := client.FrontendAPI.ToSessionExecute(ory.FrontendAPIApiToSessionRequest{}.
session, res, err := client.FrontendAPI.ToSessionExecute(ory.FrontendAPIToSessionRequest{}.
XSessionToken(sessionToken))
pkg.SDKExitOnError(err, res)
return session

View File

@ -1 +1 @@
7.2.0
7.12.0

View File

@ -8,27 +8,27 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- API version:
- Package version: 1.0.0
- Generator version: 7.12.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation
Install the following dependencies:
```shell
```sh
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
```go
import client "github.com/ory/client-go"
```
To use a proxy, set the environment variable `HTTP_PROXY`:
```golang
```go
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
@ -38,17 +38,17 @@ Default configuration comes with `Servers` field that contains server objects as
### Select Server Configuration
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
For using other server than the one defined on index 0 set context value `client.ContextServerIndex` of type `int`.
```golang
```go
ctx := context.WithValue(context.Background(), client.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`.
Templated server URL is formatted using default variables from configuration or from context value `client.ContextServerVariables` of type `map[string]string`.
```golang
```go
ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{
"basePath": "v2",
})
@ -59,10 +59,10 @@ Note, enum values are always validated and all unused variables are silently ign
### 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.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `client.ContextOperationServerIndices` and `client.ContextOperationServerVariables` context maps.
```
```go
ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
@ -267,14 +267,27 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
Authentication schemes defined for the API:
### oryAccessToken
- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header
Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request.
Note, each API key must be added to a map of `map[string]APIKey` where the key is: oryAccessToken and passed in as the auth context for each request.
Example
```go
auth := context.WithValue(
context.Background(),
client.ContextAPIKeys,
map[string]client.APIKey{
"oryAccessToken": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
## Documentation for Utility Methods

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -20,83 +20,77 @@ import (
"strings"
)
// Linger please
var (
_ context.Context
)
type CourierAPI interface {
/*
* GetCourierMessage Get a Message
* Gets a specific messages by the given ID.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id MessageID is the ID of the message.
* @return CourierAPIApiGetCourierMessageRequest
*/
GetCourierMessage(ctx context.Context, id string) CourierAPIApiGetCourierMessageRequest
GetCourierMessage Get a Message
Gets a specific messages by the given ID.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id MessageID is the ID of the message.
@return CourierAPIGetCourierMessageRequest
*/
GetCourierMessage(ctx context.Context, id string) CourierAPIGetCourierMessageRequest
// GetCourierMessageExecute executes the request
// @return Message
GetCourierMessageExecute(r CourierAPIGetCourierMessageRequest) (*Message, *http.Response, error)
/*
* GetCourierMessageExecute executes the request
* @return Message
*/
GetCourierMessageExecute(r CourierAPIApiGetCourierMessageRequest) (*Message, *http.Response, error)
ListCourierMessages List Messages
/*
* ListCourierMessages List Messages
* Lists all messages by given status and recipient.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return CourierAPIApiListCourierMessagesRequest
*/
ListCourierMessages(ctx context.Context) CourierAPIApiListCourierMessagesRequest
Lists all messages by given status and recipient.
/*
* ListCourierMessagesExecute executes the request
* @return []Message
*/
ListCourierMessagesExecute(r CourierAPIApiListCourierMessagesRequest) ([]Message, *http.Response, error)
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return CourierAPIListCourierMessagesRequest
*/
ListCourierMessages(ctx context.Context) CourierAPIListCourierMessagesRequest
// ListCourierMessagesExecute executes the request
// @return []Message
ListCourierMessagesExecute(r CourierAPIListCourierMessagesRequest) ([]Message, *http.Response, error)
}
// CourierAPIService CourierAPI service
type CourierAPIService service
type CourierAPIApiGetCourierMessageRequest struct {
type CourierAPIGetCourierMessageRequest struct {
ctx context.Context
ApiService CourierAPI
id string
}
func (r CourierAPIApiGetCourierMessageRequest) Execute() (*Message, *http.Response, error) {
func (r CourierAPIGetCourierMessageRequest) Execute() (*Message, *http.Response, error) {
return r.ApiService.GetCourierMessageExecute(r)
}
/*
* GetCourierMessage Get a Message
* Gets a specific messages by the given ID.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id MessageID is the ID of the message.
* @return CourierAPIApiGetCourierMessageRequest
*/
func (a *CourierAPIService) GetCourierMessage(ctx context.Context, id string) CourierAPIApiGetCourierMessageRequest {
return CourierAPIApiGetCourierMessageRequest{
GetCourierMessage Get a Message
Gets a specific messages by the given ID.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id MessageID is the ID of the message.
@return CourierAPIGetCourierMessageRequest
*/
func (a *CourierAPIService) GetCourierMessage(ctx context.Context, id string) CourierAPIGetCourierMessageRequest {
return CourierAPIGetCourierMessageRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
/*
* Execute executes the request
* @return Message
*/
func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMessageRequest) (*Message, *http.Response, error) {
// Execute executes the request
//
// @return Message
func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIGetCourierMessageRequest) (*Message, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *Message
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Message
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CourierAPIService.GetCourierMessage")
@ -105,7 +99,7 @@ func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMe
}
localVarPath := localBasePath + "/admin/courier/messages/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterToString(r.id, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@ -142,7 +136,7 @@ func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMe
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
@ -152,7 +146,7 @@ func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMe
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(io.LimitReader(localVarHTTPResponse.Body, 1024*1024))
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
@ -171,6 +165,7 @@ func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMe
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@ -180,6 +175,7 @@ func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMe
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@ -196,7 +192,7 @@ func (a *CourierAPIService) GetCourierMessageExecute(r CourierAPIApiGetCourierMe
return localVarReturnValue, localVarHTTPResponse, nil
}
type CourierAPIApiListCourierMessagesRequest struct {
type CourierAPIListCourierMessagesRequest struct {
ctx context.Context
ApiService CourierAPI
pageSize *int64
@ -205,52 +201,58 @@ type CourierAPIApiListCourierMessagesRequest struct {
recipient *string
}
func (r CourierAPIApiListCourierMessagesRequest) PageSize(pageSize int64) CourierAPIApiListCourierMessagesRequest {
// Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
func (r CourierAPIListCourierMessagesRequest) PageSize(pageSize int64) CourierAPIListCourierMessagesRequest {
r.pageSize = &pageSize
return r
}
func (r CourierAPIApiListCourierMessagesRequest) PageToken(pageToken string) CourierAPIApiListCourierMessagesRequest {
// Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination).
func (r CourierAPIListCourierMessagesRequest) PageToken(pageToken string) CourierAPIListCourierMessagesRequest {
r.pageToken = &pageToken
return r
}
func (r CourierAPIApiListCourierMessagesRequest) Status(status CourierMessageStatus) CourierAPIApiListCourierMessagesRequest {
// Status filters out messages based on status. If no value is provided, it doesn&#39;t take effect on filter.
func (r CourierAPIListCourierMessagesRequest) Status(status CourierMessageStatus) CourierAPIListCourierMessagesRequest {
r.status = &status
return r
}
func (r CourierAPIApiListCourierMessagesRequest) Recipient(recipient string) CourierAPIApiListCourierMessagesRequest {
// Recipient filters out messages based on recipient. If no value is provided, it doesn&#39;t take effect on filter.
func (r CourierAPIListCourierMessagesRequest) Recipient(recipient string) CourierAPIListCourierMessagesRequest {
r.recipient = &recipient
return r
}
func (r CourierAPIApiListCourierMessagesRequest) Execute() ([]Message, *http.Response, error) {
func (r CourierAPIListCourierMessagesRequest) Execute() ([]Message, *http.Response, error) {
return r.ApiService.ListCourierMessagesExecute(r)
}
/*
* ListCourierMessages List Messages
* Lists all messages by given status and recipient.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return CourierAPIApiListCourierMessagesRequest
*/
func (a *CourierAPIService) ListCourierMessages(ctx context.Context) CourierAPIApiListCourierMessagesRequest {
return CourierAPIApiListCourierMessagesRequest{
ListCourierMessages List Messages
Lists all messages by given status and recipient.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return CourierAPIListCourierMessagesRequest
*/
func (a *CourierAPIService) ListCourierMessages(ctx context.Context) CourierAPIListCourierMessagesRequest {
return CourierAPIListCourierMessagesRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return []Message
*/
func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIApiListCourierMessagesRequest) ([]Message, *http.Response, error) {
// Execute executes the request
//
// @return []Message
func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIListCourierMessagesRequest) ([]Message, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Message
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []Message
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CourierAPIService.ListCourierMessages")
@ -265,16 +267,19 @@ func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIApiListCourie
localVarFormParams := url.Values{}
if r.pageSize != nil {
localVarQueryParams.Add("page_size", parameterToString(*r.pageSize, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "")
} else {
var defaultValue int64 = 250
r.pageSize = &defaultValue
}
if r.pageToken != nil {
localVarQueryParams.Add("page_token", parameterToString(*r.pageToken, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "page_token", r.pageToken, "form", "")
}
if r.status != nil {
localVarQueryParams.Add("status", parameterToString(*r.status, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "form", "")
}
if r.recipient != nil {
localVarQueryParams.Add("recipient", parameterToString(*r.recipient, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "recipient", r.recipient, "form", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@ -307,7 +312,7 @@ func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIApiListCourie
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
@ -317,7 +322,7 @@ func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIApiListCourie
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(io.LimitReader(localVarHTTPResponse.Body, 1024*1024))
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
@ -336,6 +341,7 @@ func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIApiListCourie
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@ -345,6 +351,7 @@ func (a *CourierAPIService) ListCourierMessagesExecute(r CourierAPIApiListCourie
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -19,36 +19,32 @@ import (
"net/url"
)
// Linger please
var (
_ context.Context
)
type MetadataAPI interface {
/*
* GetVersion Return Running Software Version.
* This endpoint returns the version of Ory Kratos.
GetVersion Return Running Software Version.
This endpoint returns the version of Ory Kratos.
If the service supports TLS Edge Termination, this endpoint does not require the
`X-Forwarded-Proto` header to be set.
Be aware that if you are running multiple nodes of this service, the version will never
refer to the cluster state, only to a single instance.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return MetadataAPIApiGetVersionRequest
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return MetadataAPIGetVersionRequest
*/
GetVersion(ctx context.Context) MetadataAPIApiGetVersionRequest
GetVersion(ctx context.Context) MetadataAPIGetVersionRequest
// GetVersionExecute executes the request
// @return GetVersion200Response
GetVersionExecute(r MetadataAPIGetVersionRequest) (*GetVersion200Response, *http.Response, error)
/*
* GetVersionExecute executes the request
* @return GetVersion200Response
*/
GetVersionExecute(r MetadataAPIApiGetVersionRequest) (*GetVersion200Response, *http.Response, error)
IsAlive Check HTTP Server Status
/*
* IsAlive Check HTTP Server Status
* This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming
This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming
HTTP requests. This status does currently not include checks whether the database connection is working.
If the service supports TLS Edge Termination, this endpoint does not require the
@ -56,20 +52,20 @@ type MetadataAPI interface {
Be aware that if you are running multiple nodes of this service, the health status will never
refer to the cluster state, only to a single instance.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return MetadataAPIApiIsAliveRequest
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return MetadataAPIIsAliveRequest
*/
IsAlive(ctx context.Context) MetadataAPIApiIsAliveRequest
IsAlive(ctx context.Context) MetadataAPIIsAliveRequest
// IsAliveExecute executes the request
// @return IsAlive200Response
IsAliveExecute(r MetadataAPIIsAliveRequest) (*IsAlive200Response, *http.Response, error)
/*
* IsAliveExecute executes the request
* @return IsAlive200Response
*/
IsAliveExecute(r MetadataAPIApiIsAliveRequest) (*IsAlive200Response, *http.Response, error)
IsReady Check HTTP Server and Database Status
/*
* IsReady Check HTTP Server and Database Status
* This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g.
This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g.
the database) are responsive as well.
If the service supports TLS Edge Termination, this endpoint does not require the
@ -77,61 +73,59 @@ type MetadataAPI interface {
Be aware that if you are running multiple nodes of Ory Kratos, the health status will never
refer to the cluster state, only to a single instance.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return MetadataAPIApiIsReadyRequest
*/
IsReady(ctx context.Context) MetadataAPIApiIsReadyRequest
/*
* IsReadyExecute executes the request
* @return IsAlive200Response
*/
IsReadyExecute(r MetadataAPIApiIsReadyRequest) (*IsAlive200Response, *http.Response, error)
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return MetadataAPIIsReadyRequest
*/
IsReady(ctx context.Context) MetadataAPIIsReadyRequest
// IsReadyExecute executes the request
// @return IsAlive200Response
IsReadyExecute(r MetadataAPIIsReadyRequest) (*IsAlive200Response, *http.Response, error)
}
// MetadataAPIService MetadataAPI service
type MetadataAPIService service
type MetadataAPIApiGetVersionRequest struct {
type MetadataAPIGetVersionRequest struct {
ctx context.Context
ApiService MetadataAPI
}
func (r MetadataAPIApiGetVersionRequest) Execute() (*GetVersion200Response, *http.Response, error) {
func (r MetadataAPIGetVersionRequest) Execute() (*GetVersion200Response, *http.Response, error) {
return r.ApiService.GetVersionExecute(r)
}
/*
- GetVersion Return Running Software Version.
- This endpoint returns the version of Ory Kratos.
GetVersion Return Running Software Version.
This endpoint returns the version of Ory Kratos.
If the service supports TLS Edge Termination, this endpoint does not require the
`X-Forwarded-Proto` header to be set.
Be aware that if you are running multiple nodes of this service, the version will never
refer to the cluster state, only to a single instance.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return MetadataAPIApiGetVersionRequest
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return MetadataAPIGetVersionRequest
*/
func (a *MetadataAPIService) GetVersion(ctx context.Context) MetadataAPIApiGetVersionRequest {
return MetadataAPIApiGetVersionRequest{
func (a *MetadataAPIService) GetVersion(ctx context.Context) MetadataAPIGetVersionRequest {
return MetadataAPIGetVersionRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return GetVersion200Response
*/
func (a *MetadataAPIService) GetVersionExecute(r MetadataAPIApiGetVersionRequest) (*GetVersion200Response, *http.Response, error) {
// Execute executes the request
//
// @return GetVersion200Response
func (a *MetadataAPIService) GetVersionExecute(r MetadataAPIGetVersionRequest) (*GetVersion200Response, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *GetVersion200Response
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GetVersion200Response
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataAPIService.GetVersion")
@ -162,7 +156,7 @@ func (a *MetadataAPIService) GetVersionExecute(r MetadataAPIApiGetVersionRequest
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
@ -172,7 +166,7 @@ func (a *MetadataAPIService) GetVersionExecute(r MetadataAPIApiGetVersionRequest
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(io.LimitReader(localVarHTTPResponse.Body, 1024*1024))
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
@ -199,19 +193,19 @@ func (a *MetadataAPIService) GetVersionExecute(r MetadataAPIApiGetVersionRequest
return localVarReturnValue, localVarHTTPResponse, nil
}
type MetadataAPIApiIsAliveRequest struct {
type MetadataAPIIsAliveRequest struct {
ctx context.Context
ApiService MetadataAPI
}
func (r MetadataAPIApiIsAliveRequest) Execute() (*IsAlive200Response, *http.Response, error) {
func (r MetadataAPIIsAliveRequest) Execute() (*IsAlive200Response, *http.Response, error) {
return r.ApiService.IsAliveExecute(r)
}
/*
- IsAlive Check HTTP Server Status
- This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming
IsAlive Check HTTP Server Status
This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming
HTTP requests. This status does currently not include checks whether the database connection is working.
If the service supports TLS Edge Termination, this endpoint does not require the
@ -219,28 +213,26 @@ If the service supports TLS Edge Termination, this endpoint does not require the
Be aware that if you are running multiple nodes of this service, the health status will never
refer to the cluster state, only to a single instance.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return MetadataAPIApiIsAliveRequest
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return MetadataAPIIsAliveRequest
*/
func (a *MetadataAPIService) IsAlive(ctx context.Context) MetadataAPIApiIsAliveRequest {
return MetadataAPIApiIsAliveRequest{
func (a *MetadataAPIService) IsAlive(ctx context.Context) MetadataAPIIsAliveRequest {
return MetadataAPIIsAliveRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return IsAlive200Response
*/
func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIApiIsAliveRequest) (*IsAlive200Response, *http.Response, error) {
// Execute executes the request
//
// @return IsAlive200Response
func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIIsAliveRequest) (*IsAlive200Response, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *IsAlive200Response
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *IsAlive200Response
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataAPIService.IsAlive")
@ -271,7 +263,7 @@ func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIApiIsAliveRequest) (*Is
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
@ -281,7 +273,7 @@ func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIApiIsAliveRequest) (*Is
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(io.LimitReader(localVarHTTPResponse.Body, 1024*1024))
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
@ -299,6 +291,7 @@ func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIApiIsAliveRequest) (*Is
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@ -315,19 +308,19 @@ func (a *MetadataAPIService) IsAliveExecute(r MetadataAPIApiIsAliveRequest) (*Is
return localVarReturnValue, localVarHTTPResponse, nil
}
type MetadataAPIApiIsReadyRequest struct {
type MetadataAPIIsReadyRequest struct {
ctx context.Context
ApiService MetadataAPI
}
func (r MetadataAPIApiIsReadyRequest) Execute() (*IsAlive200Response, *http.Response, error) {
func (r MetadataAPIIsReadyRequest) Execute() (*IsAlive200Response, *http.Response, error) {
return r.ApiService.IsReadyExecute(r)
}
/*
- IsReady Check HTTP Server and Database Status
- This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g.
IsReady Check HTTP Server and Database Status
This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g.
the database) are responsive as well.
If the service supports TLS Edge Termination, this endpoint does not require the
@ -335,28 +328,26 @@ If the service supports TLS Edge Termination, this endpoint does not require the
Be aware that if you are running multiple nodes of Ory Kratos, the health status will never
refer to the cluster state, only to a single instance.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @return MetadataAPIApiIsReadyRequest
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return MetadataAPIIsReadyRequest
*/
func (a *MetadataAPIService) IsReady(ctx context.Context) MetadataAPIApiIsReadyRequest {
return MetadataAPIApiIsReadyRequest{
func (a *MetadataAPIService) IsReady(ctx context.Context) MetadataAPIIsReadyRequest {
return MetadataAPIIsReadyRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return IsAlive200Response
*/
func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIApiIsReadyRequest) (*IsAlive200Response, *http.Response, error) {
// Execute executes the request
//
// @return IsAlive200Response
func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIIsReadyRequest) (*IsAlive200Response, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *IsAlive200Response
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *IsAlive200Response
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataAPIService.IsReady")
@ -387,7 +378,7 @@ func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIApiIsReadyRequest) (*Is
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
@ -397,7 +388,7 @@ func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIApiIsReadyRequest) (*Is
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(io.LimitReader(localVarHTTPResponse.Body, 1024*1024))
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
@ -416,6 +407,7 @@ func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIApiIsReadyRequest) (*Is
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@ -425,6 +417,7 @@ func (a *MetadataAPIService) IsReadyExecute(r MetadataAPIApiIsReadyRequest) (*Is
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -32,13 +32,13 @@ import (
"strings"
"time"
"unicode/utf8"
"golang.org/x/oauth2"
)
var (
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]")
)
// APIClient manages communication with the Ory Identities API API v
@ -110,10 +110,10 @@ func selectHeaderAccept(accepts []string) string {
return strings.Join(accepts, ",")
}
// contains is a case insenstive match, finding needle in a haystack
// contains is a case insensitive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.ToLower(a) == strings.ToLower(needle) {
if strings.EqualFold(a, needle) {
return true
}
}
@ -129,33 +129,119 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
// 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 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
func parameterValueToString(obj interface{}, key string) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok {
return fmt.Sprintf("%v", actualObj.GetActualInstanceValue())
}
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
return fmt.Sprintf("%v", obj)
}
var param, ok = obj.(MappedNullable)
if !ok {
return ""
}
dataMap, err := param.ToMap()
if err != nil {
return ""
}
return fmt.Sprintf("%v", dataMap[key])
}
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
// supporting deep object syntax
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) {
var v = reflect.ValueOf(obj)
var value = ""
if v == reflect.ValueOf(nil) {
value = "null"
} else {
switch v.Kind() {
case reflect.Invalid:
value = "invalid"
case reflect.Struct:
if t, ok := obj.(MappedNullable); ok {
dataMap, err := t.ToMap()
if err != nil {
return
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType)
return
}
if t, ok := obj.(time.Time); ok {
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType)
return
}
value = v.Type().String() + " value"
case reflect.Slice:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
var lenIndValue = indValue.Len()
for i := 0; i < lenIndValue; i++ {
var arrayValue = indValue.Index(i)
var keyPrefixForCollectionType = keyPrefix
if style == "deepObject" {
keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]"
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType)
}
return
case reflect.Map:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
iter := indValue.MapRange()
for iter.Next() {
k, v := iter.Key(), iter.Value()
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType)
}
return
case reflect.Interface:
fallthrough
case reflect.Ptr:
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType)
return
case reflect.Int, reflect.Int8, reflect.Int16,
reflect.Int32, reflect.Int64:
value = strconv.FormatInt(v.Int(), 10)
case reflect.Uint, reflect.Uint8, reflect.Uint16,
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
value = strconv.FormatUint(v.Uint(), 10)
case reflect.Float32, reflect.Float64:
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
case reflect.Bool:
value = strconv.FormatBool(v.Bool())
case reflect.String:
value = v.String()
default:
value = v.Type().String() + " value"
}
}
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)
switch valuesMap := headerOrQueryParams.(type) {
case url.Values:
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
} else {
valuesMap.Add(keyPrefix, value)
}
break
case map[string]string:
valuesMap[keyPrefix] = value
break
}
return fmt.Sprintf("%v", obj)
}
// helper for converting interface{} parameters to json strings
@ -198,6 +284,12 @@ func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}
type formFile struct {
fileBytes []byte
fileName string
formFileName string
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
@ -206,9 +298,7 @@ func (c *APIClient) prepareRequest(
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
formFileName string,
fileName string,
fileBytes []byte) (localVarRequest *http.Request, err error) {
formFiles []formFile) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
@ -227,7 +317,7 @@ func (c *APIClient) prepareRequest(
}
// add form parameters and file if available.
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
@ -246,16 +336,17 @@ func (c *APIClient) prepareRequest(
}
}
}
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
for _, formFile := range formFiles {
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
w.Boundary()
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
if err != nil {
return nil, err
}
_, err = part.Write(formFile.fileBytes)
if err != nil {
return nil, err
}
}
}
@ -302,7 +393,11 @@ func (c *APIClient) prepareRequest(
}
// Encode the parameters.
url.RawQuery = query.Encode()
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
pieces := strings.Split(s, "=")
pieces[0] = queryDescape.Replace(pieces[0])
return strings.Join(pieces, "=")
})
// Generate a new request
if body != nil {
@ -318,7 +413,7 @@ func (c *APIClient) prepareRequest(
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
headers[h] = []string{v}
}
localVarRequest.Header = headers
}
@ -332,27 +427,6 @@ func (c *APIClient) prepareRequest(
// 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 {
@ -369,13 +443,37 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
*s = string(b)
return nil
}
if xmlCheck.MatchString(contentType) {
if f, ok := v.(*os.File); ok {
f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = f.Write(b)
if err != nil {
return
}
_, err = f.Seek(0, io.SeekStart)
return
}
if f, ok := v.(**os.File); ok {
*f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = (*f).Write(b)
if err != nil {
return
}
_, 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 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 {
@ -394,11 +492,14 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(path)
file, err := os.Open(filepath.Clean(path))
if err != nil {
return err
}
err = file.Close()
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
@ -409,18 +510,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error {
return err
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) error {
return fmt.Errorf(format, a...)
}
// Prevent trying to import "bytes"
func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
@ -429,16 +518,22 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(*os.File); ok {
_, err = bodyBuf.ReadFrom(fp)
} 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) {
} else if JsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
err = xml.NewEncoder(bodyBuf).Encode(body)
} else if XmlCheck.MatchString(contentType) {
var bs []byte
bs, err = xml.Marshal(body)
if err == nil {
bodyBuf.Write(bs)
}
}
if err != nil {
@ -446,7 +541,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
err = fmt.Errorf("invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
@ -548,3 +643,23 @@ func (e GenericOpenAPIError) Body() []byte {
func (e GenericOpenAPIError) Model() interface{} {
return e.model
}
// format error message using title and detail when model implements rfc7807
func formatErrorMessage(status string, v interface{}) string {
str := ""
metaValue := reflect.ValueOf(v).Elem()
if metaValue.Kind() == reflect.Struct {
field := metaValue.FieldByName("Title")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s", field.Interface())
}
field = metaValue.FieldByName("Detail")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s (%s)", str, field.Interface())
}
}
return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
}

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -29,21 +29,9 @@ func (c contextKey) String() string {
}
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")
@ -123,7 +111,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
// 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)
return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1)
}
server := sc[index]
url := server.URL
@ -138,7 +126,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri
}
}
if !found {
return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
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 {

View File

@ -1,7 +1,7 @@
#!/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"
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
@ -38,14 +38,14 @@ git add .
git commit -m "$release_note"
# Sets the new remote
git_remote=`git 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
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
@ -55,4 +55,3 @@ 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'

View File

@ -1,5 +1,3 @@
module github.com/ory/client-go
go 1.13
require golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
go 1.18

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -27,6 +27,14 @@ const (
AUTHENTICATORASSURANCELEVEL_AAL3 AuthenticatorAssuranceLevel = "aal3"
)
// All allowed values of AuthenticatorAssuranceLevel enum
var AllowedAuthenticatorAssuranceLevelEnumValues = []AuthenticatorAssuranceLevel{
"aal0",
"aal1",
"aal2",
"aal3",
}
func (v *AuthenticatorAssuranceLevel) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
@ -34,7 +42,7 @@ func (v *AuthenticatorAssuranceLevel) UnmarshalJSON(src []byte) error {
return err
}
enumTypeValue := AuthenticatorAssuranceLevel(value)
for _, existing := range []AuthenticatorAssuranceLevel{"aal0", "aal1", "aal2", "aal3"} {
for _, existing := range AllowedAuthenticatorAssuranceLevelEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
@ -44,6 +52,27 @@ func (v *AuthenticatorAssuranceLevel) UnmarshalJSON(src []byte) error {
return fmt.Errorf("%+v is not a valid AuthenticatorAssuranceLevel", value)
}
// NewAuthenticatorAssuranceLevelFromValue returns a pointer to a valid AuthenticatorAssuranceLevel
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewAuthenticatorAssuranceLevelFromValue(v string) (*AuthenticatorAssuranceLevel, error) {
ev := AuthenticatorAssuranceLevel(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for AuthenticatorAssuranceLevel: valid values are %v", v, AllowedAuthenticatorAssuranceLevelEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v AuthenticatorAssuranceLevel) IsValid() bool {
for _, existing := range AllowedAuthenticatorAssuranceLevelEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to authenticatorAssuranceLevel value
func (v AuthenticatorAssuranceLevel) Ptr() *AuthenticatorAssuranceLevel {
return &v

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the BatchPatchIdentitiesResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BatchPatchIdentitiesResponse{}
// BatchPatchIdentitiesResponse Patch identities response
type BatchPatchIdentitiesResponse struct {
// The patch responses for the individual identities.
Identities []IdentityPatchResponse `json:"identities,omitempty"`
Identities []IdentityPatchResponse `json:"identities,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BatchPatchIdentitiesResponse BatchPatchIdentitiesResponse
// NewBatchPatchIdentitiesResponse instantiates a new BatchPatchIdentitiesResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewBatchPatchIdentitiesResponseWithDefaults() *BatchPatchIdentitiesResponse
// GetIdentities returns the Identities field value if set, zero value otherwise.
func (o *BatchPatchIdentitiesResponse) GetIdentities() []IdentityPatchResponse {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
var ret []IdentityPatchResponse
return ret
}
@ -50,7 +56,7 @@ func (o *BatchPatchIdentitiesResponse) GetIdentities() []IdentityPatchResponse {
// GetIdentitiesOk returns a tuple with the Identities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BatchPatchIdentitiesResponse) GetIdentitiesOk() ([]IdentityPatchResponse, bool) {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
return nil, false
}
return o.Identities, true
@ -58,7 +64,7 @@ func (o *BatchPatchIdentitiesResponse) GetIdentitiesOk() ([]IdentityPatchRespons
// HasIdentities returns a boolean if a field has been set.
func (o *BatchPatchIdentitiesResponse) HasIdentities() bool {
if o != nil && o.Identities != nil {
if o != nil && !IsNil(o.Identities) {
return true
}
@ -71,13 +77,47 @@ func (o *BatchPatchIdentitiesResponse) SetIdentities(v []IdentityPatchResponse)
}
func (o BatchPatchIdentitiesResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Identities != nil {
toSerialize["identities"] = o.Identities
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BatchPatchIdentitiesResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Identities) {
toSerialize["identities"] = o.Identities
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BatchPatchIdentitiesResponse) UnmarshalJSON(data []byte) (err error) {
varBatchPatchIdentitiesResponse := _BatchPatchIdentitiesResponse{}
err = json.Unmarshal(data, &varBatchPatchIdentitiesResponse)
if err != nil {
return err
}
*o = BatchPatchIdentitiesResponse(varBatchPatchIdentitiesResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "identities")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBatchPatchIdentitiesResponse struct {
value *BatchPatchIdentitiesResponse
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the ConsistencyRequestParameters type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ConsistencyRequestParameters{}
// ConsistencyRequestParameters Control API consistency guarantees
type ConsistencyRequestParameters struct {
// Read Consistency Level (preview) The read consistency level determines the consistency guarantee for reads: strong (slow): The read is guaranteed to return the most recent data committed at the start of the read. eventual (very fast): The result will return data that is about 4.8 seconds old. The default consistency guarantee can be changed in the Ory Network Console or using the Ory CLI with `ory patch project --replace '/previews/default_read_consistency_level=\"strong\"'`. Setting the default consistency level to `eventual` may cause regressions in the future as we add consistency controls to more APIs. Currently, the following APIs will be affected by this setting: `GET /admin/identities` This feature is in preview and only available in Ory Network. ConsistencyLevelUnset ConsistencyLevelUnset is the unset / default consistency level. strong ConsistencyLevelStrong ConsistencyLevelStrong is the strong consistency level. eventual ConsistencyLevelEventual ConsistencyLevelEventual is the eventual consistency level using follower read timestamps.
Consistency *string `json:"consistency,omitempty"`
Consistency *string `json:"consistency,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ConsistencyRequestParameters ConsistencyRequestParameters
// NewConsistencyRequestParameters instantiates a new ConsistencyRequestParameters object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewConsistencyRequestParametersWithDefaults() *ConsistencyRequestParameters
// GetConsistency returns the Consistency field value if set, zero value otherwise.
func (o *ConsistencyRequestParameters) GetConsistency() string {
if o == nil || o.Consistency == nil {
if o == nil || IsNil(o.Consistency) {
var ret string
return ret
}
@ -50,7 +56,7 @@ func (o *ConsistencyRequestParameters) GetConsistency() string {
// GetConsistencyOk returns a tuple with the Consistency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ConsistencyRequestParameters) GetConsistencyOk() (*string, bool) {
if o == nil || o.Consistency == nil {
if o == nil || IsNil(o.Consistency) {
return nil, false
}
return o.Consistency, true
@ -58,7 +64,7 @@ func (o *ConsistencyRequestParameters) GetConsistencyOk() (*string, bool) {
// HasConsistency returns a boolean if a field has been set.
func (o *ConsistencyRequestParameters) HasConsistency() bool {
if o != nil && o.Consistency != nil {
if o != nil && !IsNil(o.Consistency) {
return true
}
@ -71,13 +77,47 @@ func (o *ConsistencyRequestParameters) SetConsistency(v string) {
}
func (o ConsistencyRequestParameters) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Consistency != nil {
toSerialize["consistency"] = o.Consistency
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ConsistencyRequestParameters) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Consistency) {
toSerialize["consistency"] = o.Consistency
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ConsistencyRequestParameters) UnmarshalJSON(data []byte) (err error) {
varConsistencyRequestParameters := _ConsistencyRequestParameters{}
err = json.Unmarshal(data, &varConsistencyRequestParameters)
if err != nil {
return err
}
*o = ConsistencyRequestParameters(varConsistencyRequestParameters)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "consistency")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableConsistencyRequestParameters struct {
value *ConsistencyRequestParameters
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -67,7 +67,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
var jsonDict map[string]interface{}
err = newStrictDecoder(data).Decode(&jsonDict)
if err != nil {
return fmt.Errorf("Failed to unmarshal JSON into map for the discrimintor lookup.")
return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup")
}
// check if the discriminator value is 'redirect_browser_to'
@ -78,7 +78,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithRedirectBrowserTo, return on the first match
} else {
dst.ContinueWithRedirectBrowserTo = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithRedirectBrowserTo: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithRedirectBrowserTo: %s", err.Error())
}
}
@ -90,7 +90,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithSetOrySessionToken, return on the first match
} else {
dst.ContinueWithSetOrySessionToken = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithSetOrySessionToken: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithSetOrySessionToken: %s", err.Error())
}
}
@ -102,7 +102,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithRecoveryUi, return on the first match
} else {
dst.ContinueWithRecoveryUi = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithRecoveryUi: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithRecoveryUi: %s", err.Error())
}
}
@ -114,7 +114,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithSettingsUi, return on the first match
} else {
dst.ContinueWithSettingsUi = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithSettingsUi: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithSettingsUi: %s", err.Error())
}
}
@ -126,7 +126,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithVerificationUi, return on the first match
} else {
dst.ContinueWithVerificationUi = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithVerificationUi: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithVerificationUi: %s", err.Error())
}
}
@ -138,7 +138,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithRecoveryUi, return on the first match
} else {
dst.ContinueWithRecoveryUi = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithRecoveryUi: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithRecoveryUi: %s", err.Error())
}
}
@ -150,7 +150,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithRedirectBrowserTo, return on the first match
} else {
dst.ContinueWithRedirectBrowserTo = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithRedirectBrowserTo: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithRedirectBrowserTo: %s", err.Error())
}
}
@ -162,7 +162,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithSetOrySessionToken, return on the first match
} else {
dst.ContinueWithSetOrySessionToken = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithSetOrySessionToken: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithSetOrySessionToken: %s", err.Error())
}
}
@ -174,7 +174,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithSettingsUi, return on the first match
} else {
dst.ContinueWithSettingsUi = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithSettingsUi: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithSettingsUi: %s", err.Error())
}
}
@ -186,7 +186,7 @@ func (dst *ContinueWith) UnmarshalJSON(data []byte) error {
return nil // data stored in dst.ContinueWithVerificationUi, return on the first match
} else {
dst.ContinueWithVerificationUi = nil
return fmt.Errorf("Failed to unmarshal ContinueWith as ContinueWithVerificationUi: %s", err.Error())
return fmt.Errorf("failed to unmarshal ContinueWith as ContinueWithVerificationUi: %s", err.Error())
}
}
@ -247,6 +247,32 @@ func (obj *ContinueWith) GetActualInstance() interface{} {
return nil
}
// Get the actual instance value
func (obj ContinueWith) GetActualInstanceValue() interface{} {
if obj.ContinueWithRecoveryUi != nil {
return *obj.ContinueWithRecoveryUi
}
if obj.ContinueWithRedirectBrowserTo != nil {
return *obj.ContinueWithRedirectBrowserTo
}
if obj.ContinueWithSetOrySessionToken != nil {
return *obj.ContinueWithSetOrySessionToken
}
if obj.ContinueWithSettingsUi != nil {
return *obj.ContinueWithSettingsUi
}
if obj.ContinueWithVerificationUi != nil {
return *obj.ContinueWithVerificationUi
}
// all schemas are nil
return nil
}
type NullableContinueWith struct {
value *ContinueWith
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,15 +13,22 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithRecoveryUi type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithRecoveryUi{}
// ContinueWithRecoveryUi Indicates, that the UI flow could be continued by showing a recovery ui
type ContinueWithRecoveryUi struct {
// Action will always be `show_recovery_ui` show_recovery_ui ContinueWithActionShowRecoveryUIString
Action string `json:"action"`
Flow ContinueWithRecoveryUiFlow `json:"flow"`
Action string `json:"action"`
Flow ContinueWithRecoveryUiFlow `json:"flow"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithRecoveryUi ContinueWithRecoveryUi
// NewContinueWithRecoveryUi instantiates a new ContinueWithRecoveryUi object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -90,16 +97,69 @@ func (o *ContinueWithRecoveryUi) SetFlow(v ContinueWithRecoveryUiFlow) {
}
func (o ContinueWithRecoveryUi) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["action"] = o.Action
}
if true {
toSerialize["flow"] = o.Flow
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithRecoveryUi) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["action"] = o.Action
toSerialize["flow"] = o.Flow
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithRecoveryUi) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"action",
"flow",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithRecoveryUi := _ContinueWithRecoveryUi{}
err = json.Unmarshal(data, &varContinueWithRecoveryUi)
if err != nil {
return err
}
*o = ContinueWithRecoveryUi(varContinueWithRecoveryUi)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "flow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithRecoveryUi struct {
value *ContinueWithRecoveryUi
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,16 +13,23 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithRecoveryUiFlow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithRecoveryUiFlow{}
// ContinueWithRecoveryUiFlow struct for ContinueWithRecoveryUiFlow
type ContinueWithRecoveryUiFlow struct {
// The ID of the recovery flow
Id string `json:"id"`
// The URL of the recovery flow If this value is set, redirect the user's browser to this URL. This value is typically unset for native clients / API flows.
Url *string `json:"url,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithRecoveryUiFlow ContinueWithRecoveryUiFlow
// NewContinueWithRecoveryUiFlow instantiates a new ContinueWithRecoveryUiFlow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -67,7 +74,7 @@ func (o *ContinueWithRecoveryUiFlow) SetId(v string) {
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ContinueWithRecoveryUiFlow) GetUrl() string {
if o == nil || o.Url == nil {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
@ -77,7 +84,7 @@ func (o *ContinueWithRecoveryUiFlow) GetUrl() string {
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContinueWithRecoveryUiFlow) GetUrlOk() (*string, bool) {
if o == nil || o.Url == nil {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
@ -85,7 +92,7 @@ func (o *ContinueWithRecoveryUiFlow) GetUrlOk() (*string, bool) {
// HasUrl returns a boolean if a field has been set.
func (o *ContinueWithRecoveryUiFlow) HasUrl() bool {
if o != nil && o.Url != nil {
if o != nil && !IsNil(o.Url) {
return true
}
@ -98,16 +105,70 @@ func (o *ContinueWithRecoveryUiFlow) SetUrl(v string) {
}
func (o ContinueWithRecoveryUiFlow) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if o.Url != nil {
toSerialize["url"] = o.Url
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithRecoveryUiFlow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithRecoveryUiFlow) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithRecoveryUiFlow := _ContinueWithRecoveryUiFlow{}
err = json.Unmarshal(data, &varContinueWithRecoveryUiFlow)
if err != nil {
return err
}
*o = ContinueWithRecoveryUiFlow(varContinueWithRecoveryUiFlow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithRecoveryUiFlow struct {
value *ContinueWithRecoveryUiFlow
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,16 +13,23 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithRedirectBrowserTo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithRedirectBrowserTo{}
// ContinueWithRedirectBrowserTo Indicates, that the UI flow could be continued by showing a recovery ui
type ContinueWithRedirectBrowserTo struct {
// Action will always be `redirect_browser_to` redirect_browser_to ContinueWithActionRedirectBrowserToString
Action string `json:"action"`
// The URL to redirect the browser to
RedirectBrowserTo string `json:"redirect_browser_to"`
RedirectBrowserTo string `json:"redirect_browser_to"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithRedirectBrowserTo ContinueWithRedirectBrowserTo
// NewContinueWithRedirectBrowserTo instantiates a new ContinueWithRedirectBrowserTo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -91,16 +98,69 @@ func (o *ContinueWithRedirectBrowserTo) SetRedirectBrowserTo(v string) {
}
func (o ContinueWithRedirectBrowserTo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["action"] = o.Action
}
if true {
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithRedirectBrowserTo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["action"] = o.Action
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithRedirectBrowserTo) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"action",
"redirect_browser_to",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithRedirectBrowserTo := _ContinueWithRedirectBrowserTo{}
err = json.Unmarshal(data, &varContinueWithRedirectBrowserTo)
if err != nil {
return err
}
*o = ContinueWithRedirectBrowserTo(varContinueWithRedirectBrowserTo)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "redirect_browser_to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithRedirectBrowserTo struct {
value *ContinueWithRedirectBrowserTo
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,16 +13,23 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithSetOrySessionToken type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithSetOrySessionToken{}
// ContinueWithSetOrySessionToken Indicates that a session was issued, and the application should use this token for authenticated requests
type ContinueWithSetOrySessionToken struct {
// Action will always be `set_ory_session_token` set_ory_session_token ContinueWithActionSetOrySessionTokenString
Action string `json:"action"`
// Token is the token of the session
OrySessionToken string `json:"ory_session_token"`
OrySessionToken string `json:"ory_session_token"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithSetOrySessionToken ContinueWithSetOrySessionToken
// NewContinueWithSetOrySessionToken instantiates a new ContinueWithSetOrySessionToken object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -91,16 +98,69 @@ func (o *ContinueWithSetOrySessionToken) SetOrySessionToken(v string) {
}
func (o ContinueWithSetOrySessionToken) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["action"] = o.Action
}
if true {
toSerialize["ory_session_token"] = o.OrySessionToken
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithSetOrySessionToken) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["action"] = o.Action
toSerialize["ory_session_token"] = o.OrySessionToken
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithSetOrySessionToken) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"action",
"ory_session_token",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithSetOrySessionToken := _ContinueWithSetOrySessionToken{}
err = json.Unmarshal(data, &varContinueWithSetOrySessionToken)
if err != nil {
return err
}
*o = ContinueWithSetOrySessionToken(varContinueWithSetOrySessionToken)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "ory_session_token")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithSetOrySessionToken struct {
value *ContinueWithSetOrySessionToken
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,15 +13,22 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithSettingsUi type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithSettingsUi{}
// ContinueWithSettingsUi Indicates, that the UI flow could be continued by showing a settings ui
type ContinueWithSettingsUi struct {
// Action will always be `show_settings_ui` show_settings_ui ContinueWithActionShowSettingsUIString
Action string `json:"action"`
Flow ContinueWithSettingsUiFlow `json:"flow"`
Action string `json:"action"`
Flow ContinueWithSettingsUiFlow `json:"flow"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithSettingsUi ContinueWithSettingsUi
// NewContinueWithSettingsUi instantiates a new ContinueWithSettingsUi object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -90,16 +97,69 @@ func (o *ContinueWithSettingsUi) SetFlow(v ContinueWithSettingsUiFlow) {
}
func (o ContinueWithSettingsUi) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["action"] = o.Action
}
if true {
toSerialize["flow"] = o.Flow
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithSettingsUi) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["action"] = o.Action
toSerialize["flow"] = o.Flow
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithSettingsUi) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"action",
"flow",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithSettingsUi := _ContinueWithSettingsUi{}
err = json.Unmarshal(data, &varContinueWithSettingsUi)
if err != nil {
return err
}
*o = ContinueWithSettingsUi(varContinueWithSettingsUi)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "flow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithSettingsUi struct {
value *ContinueWithSettingsUi
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,16 +13,23 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithSettingsUiFlow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithSettingsUiFlow{}
// ContinueWithSettingsUiFlow struct for ContinueWithSettingsUiFlow
type ContinueWithSettingsUiFlow struct {
// The ID of the settings flow
Id string `json:"id"`
// The URL of the settings flow If this value is set, redirect the user's browser to this URL. This value is typically unset for native clients / API flows.
Url *string `json:"url,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithSettingsUiFlow ContinueWithSettingsUiFlow
// NewContinueWithSettingsUiFlow instantiates a new ContinueWithSettingsUiFlow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -67,7 +74,7 @@ func (o *ContinueWithSettingsUiFlow) SetId(v string) {
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ContinueWithSettingsUiFlow) GetUrl() string {
if o == nil || o.Url == nil {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
@ -77,7 +84,7 @@ func (o *ContinueWithSettingsUiFlow) GetUrl() string {
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContinueWithSettingsUiFlow) GetUrlOk() (*string, bool) {
if o == nil || o.Url == nil {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
@ -85,7 +92,7 @@ func (o *ContinueWithSettingsUiFlow) GetUrlOk() (*string, bool) {
// HasUrl returns a boolean if a field has been set.
func (o *ContinueWithSettingsUiFlow) HasUrl() bool {
if o != nil && o.Url != nil {
if o != nil && !IsNil(o.Url) {
return true
}
@ -98,16 +105,70 @@ func (o *ContinueWithSettingsUiFlow) SetUrl(v string) {
}
func (o ContinueWithSettingsUiFlow) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if o.Url != nil {
toSerialize["url"] = o.Url
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithSettingsUiFlow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithSettingsUiFlow) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithSettingsUiFlow := _ContinueWithSettingsUiFlow{}
err = json.Unmarshal(data, &varContinueWithSettingsUiFlow)
if err != nil {
return err
}
*o = ContinueWithSettingsUiFlow(varContinueWithSettingsUiFlow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithSettingsUiFlow struct {
value *ContinueWithSettingsUiFlow
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,15 +13,22 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithVerificationUi type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithVerificationUi{}
// ContinueWithVerificationUi Indicates, that the UI flow could be continued by showing a verification ui
type ContinueWithVerificationUi struct {
// Action will always be `show_verification_ui` show_verification_ui ContinueWithActionShowVerificationUIString
Action string `json:"action"`
Flow ContinueWithVerificationUiFlow `json:"flow"`
Action string `json:"action"`
Flow ContinueWithVerificationUiFlow `json:"flow"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithVerificationUi ContinueWithVerificationUi
// NewContinueWithVerificationUi instantiates a new ContinueWithVerificationUi object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -90,16 +97,69 @@ func (o *ContinueWithVerificationUi) SetFlow(v ContinueWithVerificationUiFlow) {
}
func (o ContinueWithVerificationUi) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["action"] = o.Action
}
if true {
toSerialize["flow"] = o.Flow
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithVerificationUi) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["action"] = o.Action
toSerialize["flow"] = o.Flow
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithVerificationUi) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"action",
"flow",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithVerificationUi := _ContinueWithVerificationUi{}
err = json.Unmarshal(data, &varContinueWithVerificationUi)
if err != nil {
return err
}
*o = ContinueWithVerificationUi(varContinueWithVerificationUi)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "flow")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithVerificationUi struct {
value *ContinueWithVerificationUi
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,8 +13,12 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ContinueWithVerificationUiFlow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ContinueWithVerificationUiFlow{}
// ContinueWithVerificationUiFlow struct for ContinueWithVerificationUiFlow
type ContinueWithVerificationUiFlow struct {
// The ID of the verification flow
@ -22,9 +26,12 @@ type ContinueWithVerificationUiFlow struct {
// The URL of the verification flow If this value is set, redirect the user's browser to this URL. This value is typically unset for native clients / API flows.
Url *string `json:"url,omitempty"`
// The address that should be verified in this flow
VerifiableAddress string `json:"verifiable_address"`
VerifiableAddress string `json:"verifiable_address"`
AdditionalProperties map[string]interface{}
}
type _ContinueWithVerificationUiFlow ContinueWithVerificationUiFlow
// NewContinueWithVerificationUiFlow instantiates a new ContinueWithVerificationUiFlow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -70,7 +77,7 @@ func (o *ContinueWithVerificationUiFlow) SetId(v string) {
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *ContinueWithVerificationUiFlow) GetUrl() string {
if o == nil || o.Url == nil {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
@ -80,7 +87,7 @@ func (o *ContinueWithVerificationUiFlow) GetUrl() string {
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContinueWithVerificationUiFlow) GetUrlOk() (*string, bool) {
if o == nil || o.Url == nil {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
@ -88,7 +95,7 @@ func (o *ContinueWithVerificationUiFlow) GetUrlOk() (*string, bool) {
// HasUrl returns a boolean if a field has been set.
func (o *ContinueWithVerificationUiFlow) HasUrl() bool {
if o != nil && o.Url != nil {
if o != nil && !IsNil(o.Url) {
return true
}
@ -125,19 +132,73 @@ func (o *ContinueWithVerificationUiFlow) SetVerifiableAddress(v string) {
}
func (o ContinueWithVerificationUiFlow) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if o.Url != nil {
toSerialize["url"] = o.Url
}
if true {
toSerialize["verifiable_address"] = o.VerifiableAddress
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ContinueWithVerificationUiFlow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
toSerialize["verifiable_address"] = o.VerifiableAddress
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ContinueWithVerificationUiFlow) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"verifiable_address",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varContinueWithVerificationUiFlow := _ContinueWithVerificationUiFlow{}
err = json.Unmarshal(data, &varContinueWithVerificationUiFlow)
if err != nil {
return err
}
*o = ContinueWithVerificationUiFlow(varContinueWithVerificationUiFlow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "url")
delete(additionalProperties, "verifiable_address")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableContinueWithVerificationUiFlow struct {
value *ContinueWithVerificationUiFlow
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -27,6 +27,14 @@ const (
COURIERMESSAGESTATUS_ABANDONED CourierMessageStatus = "abandoned"
)
// All allowed values of CourierMessageStatus enum
var AllowedCourierMessageStatusEnumValues = []CourierMessageStatus{
"queued",
"sent",
"processing",
"abandoned",
}
func (v *CourierMessageStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
@ -34,7 +42,7 @@ func (v *CourierMessageStatus) UnmarshalJSON(src []byte) error {
return err
}
enumTypeValue := CourierMessageStatus(value)
for _, existing := range []CourierMessageStatus{"queued", "sent", "processing", "abandoned"} {
for _, existing := range AllowedCourierMessageStatusEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
@ -44,6 +52,27 @@ func (v *CourierMessageStatus) UnmarshalJSON(src []byte) error {
return fmt.Errorf("%+v is not a valid CourierMessageStatus", value)
}
// NewCourierMessageStatusFromValue returns a pointer to a valid CourierMessageStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewCourierMessageStatusFromValue(v string) (*CourierMessageStatus, error) {
ev := CourierMessageStatus(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for CourierMessageStatus: valid values are %v", v, AllowedCourierMessageStatusEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v CourierMessageStatus) IsValid() bool {
for _, existing := range AllowedCourierMessageStatusEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to courierMessageStatus value
func (v CourierMessageStatus) Ptr() *CourierMessageStatus {
return &v

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -25,6 +25,12 @@ const (
COURIERMESSAGETYPE_PHONE CourierMessageType = "phone"
)
// All allowed values of CourierMessageType enum
var AllowedCourierMessageTypeEnumValues = []CourierMessageType{
"email",
"phone",
}
func (v *CourierMessageType) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
@ -32,7 +38,7 @@ func (v *CourierMessageType) UnmarshalJSON(src []byte) error {
return err
}
enumTypeValue := CourierMessageType(value)
for _, existing := range []CourierMessageType{"email", "phone"} {
for _, existing := range AllowedCourierMessageTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
@ -42,6 +48,27 @@ func (v *CourierMessageType) UnmarshalJSON(src []byte) error {
return fmt.Errorf("%+v is not a valid CourierMessageType", value)
}
// NewCourierMessageTypeFromValue returns a pointer to a valid CourierMessageType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewCourierMessageTypeFromValue(v string) (*CourierMessageType, error) {
ev := CourierMessageType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for CourierMessageType: valid values are %v", v, AllowedCourierMessageTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v CourierMessageType) IsValid() bool {
for _, existing := range AllowedCourierMessageTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to courierMessageType value
func (v CourierMessageType) Ptr() *CourierMessageType {
return &v

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the CreateFedcmFlowResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateFedcmFlowResponse{}
// CreateFedcmFlowResponse Contains a list of all available FedCM providers.
type CreateFedcmFlowResponse struct {
CsrfToken *string `json:"csrf_token,omitempty"`
Providers []Provider `json:"providers,omitempty"`
CsrfToken *string `json:"csrf_token,omitempty"`
Providers []Provider `json:"providers,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CreateFedcmFlowResponse CreateFedcmFlowResponse
// NewCreateFedcmFlowResponse instantiates a new CreateFedcmFlowResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewCreateFedcmFlowResponseWithDefaults() *CreateFedcmFlowResponse {
// GetCsrfToken returns the CsrfToken field value if set, zero value otherwise.
func (o *CreateFedcmFlowResponse) GetCsrfToken() string {
if o == nil || o.CsrfToken == nil {
if o == nil || IsNil(o.CsrfToken) {
var ret string
return ret
}
@ -50,7 +56,7 @@ func (o *CreateFedcmFlowResponse) GetCsrfToken() string {
// GetCsrfTokenOk returns a tuple with the CsrfToken field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateFedcmFlowResponse) GetCsrfTokenOk() (*string, bool) {
if o == nil || o.CsrfToken == nil {
if o == nil || IsNil(o.CsrfToken) {
return nil, false
}
return o.CsrfToken, true
@ -58,7 +64,7 @@ func (o *CreateFedcmFlowResponse) GetCsrfTokenOk() (*string, bool) {
// HasCsrfToken returns a boolean if a field has been set.
func (o *CreateFedcmFlowResponse) HasCsrfToken() bool {
if o != nil && o.CsrfToken != nil {
if o != nil && !IsNil(o.CsrfToken) {
return true
}
@ -72,7 +78,7 @@ func (o *CreateFedcmFlowResponse) SetCsrfToken(v string) {
// GetProviders returns the Providers field value if set, zero value otherwise.
func (o *CreateFedcmFlowResponse) GetProviders() []Provider {
if o == nil || o.Providers == nil {
if o == nil || IsNil(o.Providers) {
var ret []Provider
return ret
}
@ -82,7 +88,7 @@ func (o *CreateFedcmFlowResponse) GetProviders() []Provider {
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateFedcmFlowResponse) GetProvidersOk() ([]Provider, bool) {
if o == nil || o.Providers == nil {
if o == nil || IsNil(o.Providers) {
return nil, false
}
return o.Providers, true
@ -90,7 +96,7 @@ func (o *CreateFedcmFlowResponse) GetProvidersOk() ([]Provider, bool) {
// HasProviders returns a boolean if a field has been set.
func (o *CreateFedcmFlowResponse) HasProviders() bool {
if o != nil && o.Providers != nil {
if o != nil && !IsNil(o.Providers) {
return true
}
@ -103,16 +109,51 @@ func (o *CreateFedcmFlowResponse) SetProviders(v []Provider) {
}
func (o CreateFedcmFlowResponse) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CsrfToken != nil {
toSerialize["csrf_token"] = o.CsrfToken
}
if o.Providers != nil {
toSerialize["providers"] = o.Providers
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateFedcmFlowResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CsrfToken) {
toSerialize["csrf_token"] = o.CsrfToken
}
if !IsNil(o.Providers) {
toSerialize["providers"] = o.Providers
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CreateFedcmFlowResponse) UnmarshalJSON(data []byte) (err error) {
varCreateFedcmFlowResponse := _CreateFedcmFlowResponse{}
err = json.Unmarshal(data, &varCreateFedcmFlowResponse)
if err != nil {
return err
}
*o = CreateFedcmFlowResponse(varCreateFedcmFlowResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "csrf_token")
delete(additionalProperties, "providers")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCreateFedcmFlowResponse struct {
value *CreateFedcmFlowResponse
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,8 +13,12 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the CreateIdentityBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateIdentityBody{}
// CreateIdentityBody Create Identity Body
type CreateIdentityBody struct {
Credentials *IdentityWithCredentials `json:"credentials,omitempty"`
@ -32,9 +36,12 @@ type CreateIdentityBody struct {
// Traits represent an identity's traits. The identity is able to create, modify, and delete traits in a self-service manner. The input will always be validated against the JSON Schema defined in `schema_url`.
Traits map[string]interface{} `json:"traits"`
// VerifiableAddresses contains all the addresses that can be verified by the user. Use this structure to import verified addresses for an identity. Please keep in mind that the address needs to be represented in the Identity Schema or this field will be overwritten on the next identity update.
VerifiableAddresses []VerifiableIdentityAddress `json:"verifiable_addresses,omitempty"`
VerifiableAddresses []VerifiableIdentityAddress `json:"verifiable_addresses,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CreateIdentityBody CreateIdentityBody
// NewCreateIdentityBody instantiates a new CreateIdentityBody object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -56,7 +63,7 @@ func NewCreateIdentityBodyWithDefaults() *CreateIdentityBody {
// GetCredentials returns the Credentials field value if set, zero value otherwise.
func (o *CreateIdentityBody) GetCredentials() IdentityWithCredentials {
if o == nil || o.Credentials == nil {
if o == nil || IsNil(o.Credentials) {
var ret IdentityWithCredentials
return ret
}
@ -66,7 +73,7 @@ func (o *CreateIdentityBody) GetCredentials() IdentityWithCredentials {
// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateIdentityBody) GetCredentialsOk() (*IdentityWithCredentials, bool) {
if o == nil || o.Credentials == nil {
if o == nil || IsNil(o.Credentials) {
return nil, false
}
return o.Credentials, true
@ -74,7 +81,7 @@ func (o *CreateIdentityBody) GetCredentialsOk() (*IdentityWithCredentials, bool)
// HasCredentials returns a boolean if a field has been set.
func (o *CreateIdentityBody) HasCredentials() bool {
if o != nil && o.Credentials != nil {
if o != nil && !IsNil(o.Credentials) {
return true
}
@ -99,7 +106,7 @@ func (o *CreateIdentityBody) GetMetadataAdmin() interface{} {
// 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 *CreateIdentityBody) GetMetadataAdminOk() (*interface{}, bool) {
if o == nil || o.MetadataAdmin == nil {
if o == nil || IsNil(o.MetadataAdmin) {
return nil, false
}
return &o.MetadataAdmin, true
@ -107,7 +114,7 @@ func (o *CreateIdentityBody) GetMetadataAdminOk() (*interface{}, bool) {
// HasMetadataAdmin returns a boolean if a field has been set.
func (o *CreateIdentityBody) HasMetadataAdmin() bool {
if o != nil && o.MetadataAdmin != nil {
if o != nil && !IsNil(o.MetadataAdmin) {
return true
}
@ -132,7 +139,7 @@ func (o *CreateIdentityBody) GetMetadataPublic() interface{} {
// 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 *CreateIdentityBody) GetMetadataPublicOk() (*interface{}, bool) {
if o == nil || o.MetadataPublic == nil {
if o == nil || IsNil(o.MetadataPublic) {
return nil, false
}
return &o.MetadataPublic, true
@ -140,7 +147,7 @@ func (o *CreateIdentityBody) GetMetadataPublicOk() (*interface{}, bool) {
// HasMetadataPublic returns a boolean if a field has been set.
func (o *CreateIdentityBody) HasMetadataPublic() bool {
if o != nil && o.MetadataPublic != nil {
if o != nil && !IsNil(o.MetadataPublic) {
return true
}
@ -154,7 +161,7 @@ func (o *CreateIdentityBody) SetMetadataPublic(v interface{}) {
// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateIdentityBody) GetOrganizationId() string {
if o == nil || o.OrganizationId.Get() == nil {
if o == nil || IsNil(o.OrganizationId.Get()) {
var ret string
return ret
}
@ -197,7 +204,7 @@ func (o *CreateIdentityBody) UnsetOrganizationId() {
// GetRecoveryAddresses returns the RecoveryAddresses field value if set, zero value otherwise.
func (o *CreateIdentityBody) GetRecoveryAddresses() []RecoveryIdentityAddress {
if o == nil || o.RecoveryAddresses == nil {
if o == nil || IsNil(o.RecoveryAddresses) {
var ret []RecoveryIdentityAddress
return ret
}
@ -207,7 +214,7 @@ func (o *CreateIdentityBody) GetRecoveryAddresses() []RecoveryIdentityAddress {
// GetRecoveryAddressesOk returns a tuple with the RecoveryAddresses field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateIdentityBody) GetRecoveryAddressesOk() ([]RecoveryIdentityAddress, bool) {
if o == nil || o.RecoveryAddresses == nil {
if o == nil || IsNil(o.RecoveryAddresses) {
return nil, false
}
return o.RecoveryAddresses, true
@ -215,7 +222,7 @@ func (o *CreateIdentityBody) GetRecoveryAddressesOk() ([]RecoveryIdentityAddress
// HasRecoveryAddresses returns a boolean if a field has been set.
func (o *CreateIdentityBody) HasRecoveryAddresses() bool {
if o != nil && o.RecoveryAddresses != nil {
if o != nil && !IsNil(o.RecoveryAddresses) {
return true
}
@ -253,7 +260,7 @@ func (o *CreateIdentityBody) SetSchemaId(v string) {
// GetState returns the State field value if set, zero value otherwise.
func (o *CreateIdentityBody) GetState() string {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
@ -263,7 +270,7 @@ func (o *CreateIdentityBody) GetState() string {
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateIdentityBody) GetStateOk() (*string, bool) {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
@ -271,7 +278,7 @@ func (o *CreateIdentityBody) GetStateOk() (*string, bool) {
// HasState returns a boolean if a field has been set.
func (o *CreateIdentityBody) HasState() bool {
if o != nil && o.State != nil {
if o != nil && !IsNil(o.State) {
return true
}
@ -297,7 +304,7 @@ func (o *CreateIdentityBody) GetTraits() map[string]interface{} {
// and a boolean to check if the value has been set.
func (o *CreateIdentityBody) GetTraitsOk() (map[string]interface{}, bool) {
if o == nil {
return nil, false
return map[string]interface{}{}, false
}
return o.Traits, true
}
@ -309,7 +316,7 @@ func (o *CreateIdentityBody) SetTraits(v map[string]interface{}) {
// GetVerifiableAddresses returns the VerifiableAddresses field value if set, zero value otherwise.
func (o *CreateIdentityBody) GetVerifiableAddresses() []VerifiableIdentityAddress {
if o == nil || o.VerifiableAddresses == nil {
if o == nil || IsNil(o.VerifiableAddresses) {
var ret []VerifiableIdentityAddress
return ret
}
@ -319,7 +326,7 @@ func (o *CreateIdentityBody) GetVerifiableAddresses() []VerifiableIdentityAddres
// GetVerifiableAddressesOk returns a tuple with the VerifiableAddresses field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateIdentityBody) GetVerifiableAddressesOk() ([]VerifiableIdentityAddress, bool) {
if o == nil || o.VerifiableAddresses == nil {
if o == nil || IsNil(o.VerifiableAddresses) {
return nil, false
}
return o.VerifiableAddresses, true
@ -327,7 +334,7 @@ func (o *CreateIdentityBody) GetVerifiableAddressesOk() ([]VerifiableIdentityAdd
// HasVerifiableAddresses returns a boolean if a field has been set.
func (o *CreateIdentityBody) HasVerifiableAddresses() bool {
if o != nil && o.VerifiableAddresses != nil {
if o != nil && !IsNil(o.VerifiableAddresses) {
return true
}
@ -340,8 +347,16 @@ func (o *CreateIdentityBody) SetVerifiableAddresses(v []VerifiableIdentityAddres
}
func (o CreateIdentityBody) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateIdentityBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Credentials != nil {
if !IsNil(o.Credentials) {
toSerialize["credentials"] = o.Credentials
}
if o.MetadataAdmin != nil {
@ -353,22 +368,74 @@ func (o CreateIdentityBody) MarshalJSON() ([]byte, error) {
if o.OrganizationId.IsSet() {
toSerialize["organization_id"] = o.OrganizationId.Get()
}
if o.RecoveryAddresses != nil {
if !IsNil(o.RecoveryAddresses) {
toSerialize["recovery_addresses"] = o.RecoveryAddresses
}
if true {
toSerialize["schema_id"] = o.SchemaId
}
if o.State != nil {
toSerialize["schema_id"] = o.SchemaId
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if true {
toSerialize["traits"] = o.Traits
}
if o.VerifiableAddresses != nil {
toSerialize["traits"] = o.Traits
if !IsNil(o.VerifiableAddresses) {
toSerialize["verifiable_addresses"] = o.VerifiableAddresses
}
return json.Marshal(toSerialize)
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CreateIdentityBody) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"schema_id",
"traits",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateIdentityBody := _CreateIdentityBody{}
err = json.Unmarshal(data, &varCreateIdentityBody)
if err != nil {
return err
}
*o = CreateIdentityBody(varCreateIdentityBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "credentials")
delete(additionalProperties, "metadata_admin")
delete(additionalProperties, "metadata_public")
delete(additionalProperties, "organization_id")
delete(additionalProperties, "recovery_addresses")
delete(additionalProperties, "schema_id")
delete(additionalProperties, "state")
delete(additionalProperties, "traits")
delete(additionalProperties, "verifiable_addresses")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCreateIdentityBody struct {

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,18 +13,25 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the CreateRecoveryCodeForIdentityBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateRecoveryCodeForIdentityBody{}
// CreateRecoveryCodeForIdentityBody Create Recovery Code for Identity Request Body
type CreateRecoveryCodeForIdentityBody struct {
// Code Expires In The recovery code will expire after that amount of time has passed. Defaults to the configuration value of `selfservice.methods.code.config.lifespan`.
ExpiresIn *string `json:"expires_in,omitempty"`
ExpiresIn *string `json:"expires_in,omitempty" validate:"regexp=^([0-9]+(ns|us|ms|s|m|h))*$"`
// The flow type can either be `api` or `browser`.
FlowType *string `json:"flow_type,omitempty"`
// Identity to Recover The identity's ID you wish to recover.
IdentityId string `json:"identity_id"`
IdentityId string `json:"identity_id"`
AdditionalProperties map[string]interface{}
}
type _CreateRecoveryCodeForIdentityBody CreateRecoveryCodeForIdentityBody
// NewCreateRecoveryCodeForIdentityBody instantiates a new CreateRecoveryCodeForIdentityBody object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -45,7 +52,7 @@ func NewCreateRecoveryCodeForIdentityBodyWithDefaults() *CreateRecoveryCodeForId
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise.
func (o *CreateRecoveryCodeForIdentityBody) GetExpiresIn() string {
if o == nil || o.ExpiresIn == nil {
if o == nil || IsNil(o.ExpiresIn) {
var ret string
return ret
}
@ -55,7 +62,7 @@ func (o *CreateRecoveryCodeForIdentityBody) GetExpiresIn() string {
// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateRecoveryCodeForIdentityBody) GetExpiresInOk() (*string, bool) {
if o == nil || o.ExpiresIn == nil {
if o == nil || IsNil(o.ExpiresIn) {
return nil, false
}
return o.ExpiresIn, true
@ -63,7 +70,7 @@ func (o *CreateRecoveryCodeForIdentityBody) GetExpiresInOk() (*string, bool) {
// HasExpiresIn returns a boolean if a field has been set.
func (o *CreateRecoveryCodeForIdentityBody) HasExpiresIn() bool {
if o != nil && o.ExpiresIn != nil {
if o != nil && !IsNil(o.ExpiresIn) {
return true
}
@ -77,7 +84,7 @@ func (o *CreateRecoveryCodeForIdentityBody) SetExpiresIn(v string) {
// GetFlowType returns the FlowType field value if set, zero value otherwise.
func (o *CreateRecoveryCodeForIdentityBody) GetFlowType() string {
if o == nil || o.FlowType == nil {
if o == nil || IsNil(o.FlowType) {
var ret string
return ret
}
@ -87,7 +94,7 @@ func (o *CreateRecoveryCodeForIdentityBody) GetFlowType() string {
// GetFlowTypeOk returns a tuple with the FlowType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateRecoveryCodeForIdentityBody) GetFlowTypeOk() (*string, bool) {
if o == nil || o.FlowType == nil {
if o == nil || IsNil(o.FlowType) {
return nil, false
}
return o.FlowType, true
@ -95,7 +102,7 @@ func (o *CreateRecoveryCodeForIdentityBody) GetFlowTypeOk() (*string, bool) {
// HasFlowType returns a boolean if a field has been set.
func (o *CreateRecoveryCodeForIdentityBody) HasFlowType() bool {
if o != nil && o.FlowType != nil {
if o != nil && !IsNil(o.FlowType) {
return true
}
@ -132,19 +139,74 @@ func (o *CreateRecoveryCodeForIdentityBody) SetIdentityId(v string) {
}
func (o CreateRecoveryCodeForIdentityBody) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ExpiresIn != nil {
toSerialize["expires_in"] = o.ExpiresIn
}
if o.FlowType != nil {
toSerialize["flow_type"] = o.FlowType
}
if true {
toSerialize["identity_id"] = o.IdentityId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateRecoveryCodeForIdentityBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpiresIn) {
toSerialize["expires_in"] = o.ExpiresIn
}
if !IsNil(o.FlowType) {
toSerialize["flow_type"] = o.FlowType
}
toSerialize["identity_id"] = o.IdentityId
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CreateRecoveryCodeForIdentityBody) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"identity_id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateRecoveryCodeForIdentityBody := _CreateRecoveryCodeForIdentityBody{}
err = json.Unmarshal(data, &varCreateRecoveryCodeForIdentityBody)
if err != nil {
return err
}
*o = CreateRecoveryCodeForIdentityBody(varCreateRecoveryCodeForIdentityBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expires_in")
delete(additionalProperties, "flow_type")
delete(additionalProperties, "identity_id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCreateRecoveryCodeForIdentityBody struct {
value *CreateRecoveryCodeForIdentityBody
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,16 +13,23 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the CreateRecoveryLinkForIdentityBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateRecoveryLinkForIdentityBody{}
// CreateRecoveryLinkForIdentityBody Create Recovery Link for Identity Request Body
type CreateRecoveryLinkForIdentityBody struct {
// Link Expires In The recovery link will expire after that amount of time has passed. Defaults to the configuration value of `selfservice.methods.code.config.lifespan`.
ExpiresIn *string `json:"expires_in,omitempty"`
ExpiresIn *string `json:"expires_in,omitempty" validate:"regexp=^[0-9]+(ns|us|ms|s|m|h)$"`
// Identity to Recover The identity's ID you wish to recover.
IdentityId string `json:"identity_id"`
IdentityId string `json:"identity_id"`
AdditionalProperties map[string]interface{}
}
type _CreateRecoveryLinkForIdentityBody CreateRecoveryLinkForIdentityBody
// NewCreateRecoveryLinkForIdentityBody instantiates a new CreateRecoveryLinkForIdentityBody object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -43,7 +50,7 @@ func NewCreateRecoveryLinkForIdentityBodyWithDefaults() *CreateRecoveryLinkForId
// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise.
func (o *CreateRecoveryLinkForIdentityBody) GetExpiresIn() string {
if o == nil || o.ExpiresIn == nil {
if o == nil || IsNil(o.ExpiresIn) {
var ret string
return ret
}
@ -53,7 +60,7 @@ func (o *CreateRecoveryLinkForIdentityBody) GetExpiresIn() string {
// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateRecoveryLinkForIdentityBody) GetExpiresInOk() (*string, bool) {
if o == nil || o.ExpiresIn == nil {
if o == nil || IsNil(o.ExpiresIn) {
return nil, false
}
return o.ExpiresIn, true
@ -61,7 +68,7 @@ func (o *CreateRecoveryLinkForIdentityBody) GetExpiresInOk() (*string, bool) {
// HasExpiresIn returns a boolean if a field has been set.
func (o *CreateRecoveryLinkForIdentityBody) HasExpiresIn() bool {
if o != nil && o.ExpiresIn != nil {
if o != nil && !IsNil(o.ExpiresIn) {
return true
}
@ -98,16 +105,70 @@ func (o *CreateRecoveryLinkForIdentityBody) SetIdentityId(v string) {
}
func (o CreateRecoveryLinkForIdentityBody) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ExpiresIn != nil {
toSerialize["expires_in"] = o.ExpiresIn
}
if true {
toSerialize["identity_id"] = o.IdentityId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateRecoveryLinkForIdentityBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpiresIn) {
toSerialize["expires_in"] = o.ExpiresIn
}
toSerialize["identity_id"] = o.IdentityId
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CreateRecoveryLinkForIdentityBody) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"identity_id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateRecoveryLinkForIdentityBody := _CreateRecoveryLinkForIdentityBody{}
err = json.Unmarshal(data, &varCreateRecoveryLinkForIdentityBody)
if err != nil {
return err
}
*o = CreateRecoveryLinkForIdentityBody(varCreateRecoveryLinkForIdentityBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expires_in")
delete(additionalProperties, "identity_id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCreateRecoveryLinkForIdentityBody struct {
value *CreateRecoveryLinkForIdentityBody
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the DeleteMySessionsCount type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeleteMySessionsCount{}
// DeleteMySessionsCount Deleted Session Count
type DeleteMySessionsCount struct {
// The number of sessions that were revoked.
Count *int64 `json:"count,omitempty"`
Count *int64 `json:"count,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DeleteMySessionsCount DeleteMySessionsCount
// NewDeleteMySessionsCount instantiates a new DeleteMySessionsCount object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewDeleteMySessionsCountWithDefaults() *DeleteMySessionsCount {
// GetCount returns the Count field value if set, zero value otherwise.
func (o *DeleteMySessionsCount) GetCount() int64 {
if o == nil || o.Count == nil {
if o == nil || IsNil(o.Count) {
var ret int64
return ret
}
@ -50,7 +56,7 @@ func (o *DeleteMySessionsCount) GetCount() int64 {
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeleteMySessionsCount) GetCountOk() (*int64, bool) {
if o == nil || o.Count == nil {
if o == nil || IsNil(o.Count) {
return nil, false
}
return o.Count, true
@ -58,7 +64,7 @@ func (o *DeleteMySessionsCount) GetCountOk() (*int64, bool) {
// HasCount returns a boolean if a field has been set.
func (o *DeleteMySessionsCount) HasCount() bool {
if o != nil && o.Count != nil {
if o != nil && !IsNil(o.Count) {
return true
}
@ -71,13 +77,47 @@ func (o *DeleteMySessionsCount) SetCount(v int64) {
}
func (o DeleteMySessionsCount) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Count != nil {
toSerialize["count"] = o.Count
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DeleteMySessionsCount) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Count) {
toSerialize["count"] = o.Count
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DeleteMySessionsCount) UnmarshalJSON(data []byte) (err error) {
varDeleteMySessionsCount := _DeleteMySessionsCount{}
err = json.Unmarshal(data, &varDeleteMySessionsCount)
if err != nil {
return err
}
*o = DeleteMySessionsCount(varDeleteMySessionsCount)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "count")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDeleteMySessionsCount struct {
value *DeleteMySessionsCount
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,13 +15,19 @@ import (
"encoding/json"
)
// checks if the ErrorAuthenticatorAssuranceLevelNotSatisfied type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ErrorAuthenticatorAssuranceLevelNotSatisfied{}
// ErrorAuthenticatorAssuranceLevelNotSatisfied struct for ErrorAuthenticatorAssuranceLevelNotSatisfied
type ErrorAuthenticatorAssuranceLevelNotSatisfied struct {
Error *GenericError `json:"error,omitempty"`
// Points to where to redirect the user to next.
RedirectBrowserTo *string `json:"redirect_browser_to,omitempty"`
RedirectBrowserTo *string `json:"redirect_browser_to,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ErrorAuthenticatorAssuranceLevelNotSatisfied ErrorAuthenticatorAssuranceLevelNotSatisfied
// NewErrorAuthenticatorAssuranceLevelNotSatisfied instantiates a new ErrorAuthenticatorAssuranceLevelNotSatisfied object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -41,7 +47,7 @@ func NewErrorAuthenticatorAssuranceLevelNotSatisfiedWithDefaults() *ErrorAuthent
// GetError returns the Error field value if set, zero value otherwise.
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetError() GenericError {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
var ret GenericError
return ret
}
@ -51,7 +57,7 @@ func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetError() GenericError {
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetErrorOk() (*GenericError, bool) {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
@ -59,7 +65,7 @@ func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetErrorOk() (*GenericErr
// HasError returns a boolean if a field has been set.
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -73,7 +79,7 @@ func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) SetError(v GenericError)
// GetRedirectBrowserTo returns the RedirectBrowserTo field value if set, zero value otherwise.
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetRedirectBrowserTo() string {
if o == nil || o.RedirectBrowserTo == nil {
if o == nil || IsNil(o.RedirectBrowserTo) {
var ret string
return ret
}
@ -83,7 +89,7 @@ func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetRedirectBrowserTo() st
// GetRedirectBrowserToOk returns a tuple with the RedirectBrowserTo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetRedirectBrowserToOk() (*string, bool) {
if o == nil || o.RedirectBrowserTo == nil {
if o == nil || IsNil(o.RedirectBrowserTo) {
return nil, false
}
return o.RedirectBrowserTo, true
@ -91,7 +97,7 @@ func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) GetRedirectBrowserToOk()
// HasRedirectBrowserTo returns a boolean if a field has been set.
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) HasRedirectBrowserTo() bool {
if o != nil && o.RedirectBrowserTo != nil {
if o != nil && !IsNil(o.RedirectBrowserTo) {
return true
}
@ -104,16 +110,51 @@ func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) SetRedirectBrowserTo(v st
}
func (o ErrorAuthenticatorAssuranceLevelNotSatisfied) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if o.RedirectBrowserTo != nil {
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ErrorAuthenticatorAssuranceLevelNotSatisfied) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.RedirectBrowserTo) {
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ErrorAuthenticatorAssuranceLevelNotSatisfied) UnmarshalJSON(data []byte) (err error) {
varErrorAuthenticatorAssuranceLevelNotSatisfied := _ErrorAuthenticatorAssuranceLevelNotSatisfied{}
err = json.Unmarshal(data, &varErrorAuthenticatorAssuranceLevelNotSatisfied)
if err != nil {
return err
}
*o = ErrorAuthenticatorAssuranceLevelNotSatisfied(varErrorAuthenticatorAssuranceLevelNotSatisfied)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "redirect_browser_to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableErrorAuthenticatorAssuranceLevelNotSatisfied struct {
value *ErrorAuthenticatorAssuranceLevelNotSatisfied
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,13 +15,19 @@ import (
"encoding/json"
)
// checks if the ErrorBrowserLocationChangeRequired type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ErrorBrowserLocationChangeRequired{}
// ErrorBrowserLocationChangeRequired struct for ErrorBrowserLocationChangeRequired
type ErrorBrowserLocationChangeRequired struct {
Error *ErrorGeneric `json:"error,omitempty"`
// Points to where to redirect the user to next.
RedirectBrowserTo *string `json:"redirect_browser_to,omitempty"`
RedirectBrowserTo *string `json:"redirect_browser_to,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ErrorBrowserLocationChangeRequired ErrorBrowserLocationChangeRequired
// NewErrorBrowserLocationChangeRequired instantiates a new ErrorBrowserLocationChangeRequired object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -41,7 +47,7 @@ func NewErrorBrowserLocationChangeRequiredWithDefaults() *ErrorBrowserLocationCh
// GetError returns the Error field value if set, zero value otherwise.
func (o *ErrorBrowserLocationChangeRequired) GetError() ErrorGeneric {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
var ret ErrorGeneric
return ret
}
@ -51,7 +57,7 @@ func (o *ErrorBrowserLocationChangeRequired) GetError() ErrorGeneric {
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ErrorBrowserLocationChangeRequired) GetErrorOk() (*ErrorGeneric, bool) {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
@ -59,7 +65,7 @@ func (o *ErrorBrowserLocationChangeRequired) GetErrorOk() (*ErrorGeneric, bool)
// HasError returns a boolean if a field has been set.
func (o *ErrorBrowserLocationChangeRequired) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -73,7 +79,7 @@ func (o *ErrorBrowserLocationChangeRequired) SetError(v ErrorGeneric) {
// GetRedirectBrowserTo returns the RedirectBrowserTo field value if set, zero value otherwise.
func (o *ErrorBrowserLocationChangeRequired) GetRedirectBrowserTo() string {
if o == nil || o.RedirectBrowserTo == nil {
if o == nil || IsNil(o.RedirectBrowserTo) {
var ret string
return ret
}
@ -83,7 +89,7 @@ func (o *ErrorBrowserLocationChangeRequired) GetRedirectBrowserTo() string {
// GetRedirectBrowserToOk returns a tuple with the RedirectBrowserTo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ErrorBrowserLocationChangeRequired) GetRedirectBrowserToOk() (*string, bool) {
if o == nil || o.RedirectBrowserTo == nil {
if o == nil || IsNil(o.RedirectBrowserTo) {
return nil, false
}
return o.RedirectBrowserTo, true
@ -91,7 +97,7 @@ func (o *ErrorBrowserLocationChangeRequired) GetRedirectBrowserToOk() (*string,
// HasRedirectBrowserTo returns a boolean if a field has been set.
func (o *ErrorBrowserLocationChangeRequired) HasRedirectBrowserTo() bool {
if o != nil && o.RedirectBrowserTo != nil {
if o != nil && !IsNil(o.RedirectBrowserTo) {
return true
}
@ -104,16 +110,51 @@ func (o *ErrorBrowserLocationChangeRequired) SetRedirectBrowserTo(v string) {
}
func (o ErrorBrowserLocationChangeRequired) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if o.RedirectBrowserTo != nil {
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ErrorBrowserLocationChangeRequired) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.RedirectBrowserTo) {
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ErrorBrowserLocationChangeRequired) UnmarshalJSON(data []byte) (err error) {
varErrorBrowserLocationChangeRequired := _ErrorBrowserLocationChangeRequired{}
err = json.Unmarshal(data, &varErrorBrowserLocationChangeRequired)
if err != nil {
return err
}
*o = ErrorBrowserLocationChangeRequired(varErrorBrowserLocationChangeRequired)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "redirect_browser_to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableErrorBrowserLocationChangeRequired struct {
value *ErrorBrowserLocationChangeRequired
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,13 +15,19 @@ import (
"encoding/json"
)
// checks if the ErrorFlowReplaced type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ErrorFlowReplaced{}
// ErrorFlowReplaced Is sent when a flow is replaced by a different flow of the same class
type ErrorFlowReplaced struct {
Error *GenericError `json:"error,omitempty"`
// The flow ID that should be used for the new flow as it contains the correct messages.
UseFlowId *string `json:"use_flow_id,omitempty"`
UseFlowId *string `json:"use_flow_id,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ErrorFlowReplaced ErrorFlowReplaced
// NewErrorFlowReplaced instantiates a new ErrorFlowReplaced object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -41,7 +47,7 @@ func NewErrorFlowReplacedWithDefaults() *ErrorFlowReplaced {
// GetError returns the Error field value if set, zero value otherwise.
func (o *ErrorFlowReplaced) GetError() GenericError {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
var ret GenericError
return ret
}
@ -51,7 +57,7 @@ func (o *ErrorFlowReplaced) GetError() GenericError {
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ErrorFlowReplaced) GetErrorOk() (*GenericError, bool) {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
@ -59,7 +65,7 @@ func (o *ErrorFlowReplaced) GetErrorOk() (*GenericError, bool) {
// HasError returns a boolean if a field has been set.
func (o *ErrorFlowReplaced) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -73,7 +79,7 @@ func (o *ErrorFlowReplaced) SetError(v GenericError) {
// GetUseFlowId returns the UseFlowId field value if set, zero value otherwise.
func (o *ErrorFlowReplaced) GetUseFlowId() string {
if o == nil || o.UseFlowId == nil {
if o == nil || IsNil(o.UseFlowId) {
var ret string
return ret
}
@ -83,7 +89,7 @@ func (o *ErrorFlowReplaced) GetUseFlowId() string {
// GetUseFlowIdOk returns a tuple with the UseFlowId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ErrorFlowReplaced) GetUseFlowIdOk() (*string, bool) {
if o == nil || o.UseFlowId == nil {
if o == nil || IsNil(o.UseFlowId) {
return nil, false
}
return o.UseFlowId, true
@ -91,7 +97,7 @@ func (o *ErrorFlowReplaced) GetUseFlowIdOk() (*string, bool) {
// HasUseFlowId returns a boolean if a field has been set.
func (o *ErrorFlowReplaced) HasUseFlowId() bool {
if o != nil && o.UseFlowId != nil {
if o != nil && !IsNil(o.UseFlowId) {
return true
}
@ -104,16 +110,51 @@ func (o *ErrorFlowReplaced) SetUseFlowId(v string) {
}
func (o ErrorFlowReplaced) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if o.UseFlowId != nil {
toSerialize["use_flow_id"] = o.UseFlowId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ErrorFlowReplaced) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.UseFlowId) {
toSerialize["use_flow_id"] = o.UseFlowId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ErrorFlowReplaced) UnmarshalJSON(data []byte) (err error) {
varErrorFlowReplaced := _ErrorFlowReplaced{}
err = json.Unmarshal(data, &varErrorFlowReplaced)
if err != nil {
return err
}
*o = ErrorFlowReplaced(varErrorFlowReplaced)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "use_flow_id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableErrorFlowReplaced struct {
value *ErrorFlowReplaced
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,13 +13,20 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the ErrorGeneric type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ErrorGeneric{}
// ErrorGeneric The standard Ory JSON API error format.
type ErrorGeneric struct {
Error GenericError `json:"error"`
Error GenericError `json:"error"`
AdditionalProperties map[string]interface{}
}
type _ErrorGeneric ErrorGeneric
// NewErrorGeneric instantiates a new ErrorGeneric object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -63,13 +70,66 @@ func (o *ErrorGeneric) SetError(v GenericError) {
}
func (o ErrorGeneric) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["error"] = o.Error
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ErrorGeneric) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["error"] = o.Error
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ErrorGeneric) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"error",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varErrorGeneric := _ErrorGeneric{}
err = json.Unmarshal(data, &varErrorGeneric)
if err != nil {
return err
}
*o = ErrorGeneric(varErrorGeneric)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableErrorGeneric struct {
value *ErrorGeneric
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the FlowError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlowError{}
// FlowError struct for FlowError
type FlowError struct {
// CreatedAt is a helper struct field for gobuffalo.pop.
@ -24,9 +28,12 @@ type FlowError struct {
// ID of the error container.
Id string `json:"id"`
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FlowError FlowError
// NewFlowError instantiates a new FlowError object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -47,7 +54,7 @@ func NewFlowErrorWithDefaults() *FlowError {
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *FlowError) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
@ -57,7 +64,7 @@ func (o *FlowError) GetCreatedAt() time.Time {
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlowError) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
@ -65,7 +72,7 @@ func (o *FlowError) GetCreatedAtOk() (*time.Time, bool) {
// HasCreatedAt returns a boolean if a field has been set.
func (o *FlowError) HasCreatedAt() bool {
if o != nil && o.CreatedAt != nil {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
@ -79,7 +86,7 @@ func (o *FlowError) SetCreatedAt(v time.Time) {
// GetError returns the Error field value if set, zero value otherwise.
func (o *FlowError) GetError() map[string]interface{} {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
var ret map[string]interface{}
return ret
}
@ -89,15 +96,15 @@ func (o *FlowError) GetError() map[string]interface{} {
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlowError) GetErrorOk() (map[string]interface{}, bool) {
if o == nil || o.Error == nil {
return nil, false
if o == nil || IsNil(o.Error) {
return map[string]interface{}{}, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *FlowError) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -135,7 +142,7 @@ func (o *FlowError) SetId(v string) {
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *FlowError) GetUpdatedAt() time.Time {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
@ -145,7 +152,7 @@ func (o *FlowError) GetUpdatedAt() time.Time {
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlowError) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
@ -153,7 +160,7 @@ func (o *FlowError) GetUpdatedAtOk() (*time.Time, bool) {
// HasUpdatedAt returns a boolean if a field has been set.
func (o *FlowError) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt != nil {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
@ -166,22 +173,78 @@ func (o *FlowError) SetUpdatedAt(v time.Time) {
}
func (o FlowError) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreatedAt != nil {
toSerialize["created_at"] = o.CreatedAt
}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if true {
toSerialize["id"] = o.Id
}
if o.UpdatedAt != nil {
toSerialize["updated_at"] = o.UpdatedAt
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlowError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
toSerialize["id"] = o.Id
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FlowError) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varFlowError := _FlowError{}
err = json.Unmarshal(data, &varFlowError)
if err != nil {
return err
}
*o = FlowError(varFlowError)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created_at")
delete(additionalProperties, "error")
delete(additionalProperties, "id")
delete(additionalProperties, "updated_at")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFlowError struct {
value *FlowError
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,8 +13,12 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the GenericError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GenericError{}
// GenericError struct for GenericError
type GenericError struct {
// The status code
@ -32,9 +36,12 @@ type GenericError struct {
// The request ID The request ID is often exposed internally in order to trace errors across service architectures. This is often a UUID.
Request *string `json:"request,omitempty"`
// The status description
Status *string `json:"status,omitempty"`
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _GenericError GenericError
// NewGenericError instantiates a new GenericError object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -55,7 +62,7 @@ func NewGenericErrorWithDefaults() *GenericError {
// GetCode returns the Code field value if set, zero value otherwise.
func (o *GenericError) GetCode() int64 {
if o == nil || o.Code == nil {
if o == nil || IsNil(o.Code) {
var ret int64
return ret
}
@ -65,7 +72,7 @@ func (o *GenericError) GetCode() int64 {
// 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 *GenericError) GetCodeOk() (*int64, bool) {
if o == nil || o.Code == nil {
if o == nil || IsNil(o.Code) {
return nil, false
}
return o.Code, true
@ -73,7 +80,7 @@ func (o *GenericError) GetCodeOk() (*int64, bool) {
// HasCode returns a boolean if a field has been set.
func (o *GenericError) HasCode() bool {
if o != nil && o.Code != nil {
if o != nil && !IsNil(o.Code) {
return true
}
@ -87,7 +94,7 @@ func (o *GenericError) SetCode(v int64) {
// GetDebug returns the Debug field value if set, zero value otherwise.
func (o *GenericError) GetDebug() string {
if o == nil || o.Debug == nil {
if o == nil || IsNil(o.Debug) {
var ret string
return ret
}
@ -97,7 +104,7 @@ func (o *GenericError) GetDebug() string {
// GetDebugOk returns a tuple with the Debug field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GenericError) GetDebugOk() (*string, bool) {
if o == nil || o.Debug == nil {
if o == nil || IsNil(o.Debug) {
return nil, false
}
return o.Debug, true
@ -105,7 +112,7 @@ func (o *GenericError) GetDebugOk() (*string, bool) {
// HasDebug returns a boolean if a field has been set.
func (o *GenericError) HasDebug() bool {
if o != nil && o.Debug != nil {
if o != nil && !IsNil(o.Debug) {
return true
}
@ -119,7 +126,7 @@ func (o *GenericError) SetDebug(v string) {
// GetDetails returns the Details field value if set, zero value otherwise.
func (o *GenericError) GetDetails() map[string]interface{} {
if o == nil || o.Details == nil {
if o == nil || IsNil(o.Details) {
var ret map[string]interface{}
return ret
}
@ -129,15 +136,15 @@ func (o *GenericError) GetDetails() map[string]interface{} {
// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GenericError) GetDetailsOk() (map[string]interface{}, bool) {
if o == nil || o.Details == nil {
return nil, false
if o == nil || IsNil(o.Details) {
return map[string]interface{}{}, false
}
return o.Details, true
}
// HasDetails returns a boolean if a field has been set.
func (o *GenericError) HasDetails() bool {
if o != nil && o.Details != nil {
if o != nil && !IsNil(o.Details) {
return true
}
@ -151,7 +158,7 @@ func (o *GenericError) SetDetails(v map[string]interface{}) {
// GetId returns the Id field value if set, zero value otherwise.
func (o *GenericError) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@ -161,7 +168,7 @@ func (o *GenericError) GetId() string {
// 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 *GenericError) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@ -169,7 +176,7 @@ func (o *GenericError) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *GenericError) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@ -207,7 +214,7 @@ func (o *GenericError) SetMessage(v string) {
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *GenericError) GetReason() string {
if o == nil || o.Reason == nil {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
@ -217,7 +224,7 @@ func (o *GenericError) GetReason() string {
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GenericError) GetReasonOk() (*string, bool) {
if o == nil || o.Reason == nil {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
@ -225,7 +232,7 @@ func (o *GenericError) GetReasonOk() (*string, bool) {
// HasReason returns a boolean if a field has been set.
func (o *GenericError) HasReason() bool {
if o != nil && o.Reason != nil {
if o != nil && !IsNil(o.Reason) {
return true
}
@ -239,7 +246,7 @@ func (o *GenericError) SetReason(v string) {
// GetRequest returns the Request field value if set, zero value otherwise.
func (o *GenericError) GetRequest() string {
if o == nil || o.Request == nil {
if o == nil || IsNil(o.Request) {
var ret string
return ret
}
@ -249,7 +256,7 @@ func (o *GenericError) GetRequest() string {
// GetRequestOk returns a tuple with the Request field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GenericError) GetRequestOk() (*string, bool) {
if o == nil || o.Request == nil {
if o == nil || IsNil(o.Request) {
return nil, false
}
return o.Request, true
@ -257,7 +264,7 @@ func (o *GenericError) GetRequestOk() (*string, bool) {
// HasRequest returns a boolean if a field has been set.
func (o *GenericError) HasRequest() bool {
if o != nil && o.Request != nil {
if o != nil && !IsNil(o.Request) {
return true
}
@ -271,7 +278,7 @@ func (o *GenericError) SetRequest(v string) {
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *GenericError) GetStatus() string {
if o == nil || o.Status == nil {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
@ -281,7 +288,7 @@ func (o *GenericError) GetStatus() string {
// 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 *GenericError) GetStatusOk() (*string, bool) {
if o == nil || o.Status == nil {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
@ -289,7 +296,7 @@ func (o *GenericError) GetStatusOk() (*string, bool) {
// HasStatus returns a boolean if a field has been set.
func (o *GenericError) HasStatus() bool {
if o != nil && o.Status != nil {
if o != nil && !IsNil(o.Status) {
return true
}
@ -302,34 +309,94 @@ func (o *GenericError) SetStatus(v string) {
}
func (o GenericError) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Code != nil {
toSerialize["code"] = o.Code
}
if o.Debug != nil {
toSerialize["debug"] = o.Debug
}
if o.Details != nil {
toSerialize["details"] = o.Details
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if true {
toSerialize["message"] = o.Message
}
if o.Reason != nil {
toSerialize["reason"] = o.Reason
}
if o.Request != nil {
toSerialize["request"] = o.Request
}
if o.Status != nil {
toSerialize["status"] = o.Status
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GenericError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Code) {
toSerialize["code"] = o.Code
}
if !IsNil(o.Debug) {
toSerialize["debug"] = o.Debug
}
if !IsNil(o.Details) {
toSerialize["details"] = o.Details
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
toSerialize["message"] = o.Message
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.Request) {
toSerialize["request"] = o.Request
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GenericError) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"message",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varGenericError := _GenericError{}
err = json.Unmarshal(data, &varGenericError)
if err != nil {
return err
}
*o = GenericError(varGenericError)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "code")
delete(additionalProperties, "debug")
delete(additionalProperties, "details")
delete(additionalProperties, "id")
delete(additionalProperties, "message")
delete(additionalProperties, "reason")
delete(additionalProperties, "request")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGenericError struct {
value *GenericError
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,14 +13,21 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the GetVersion200Response type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GetVersion200Response{}
// GetVersion200Response struct for GetVersion200Response
type GetVersion200Response struct {
// The version of Ory Kratos.
Version string `json:"version"`
Version string `json:"version"`
AdditionalProperties map[string]interface{}
}
type _GetVersion200Response GetVersion200Response
// NewGetVersion200Response instantiates a new GetVersion200Response object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -64,13 +71,66 @@ func (o *GetVersion200Response) SetVersion(v string) {
}
func (o GetVersion200Response) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["version"] = o.Version
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GetVersion200Response) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["version"] = o.Version
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *GetVersion200Response) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"version",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varGetVersion200Response := _GetVersion200Response{}
err = json.Unmarshal(data, &varGetVersion200Response)
if err != nil {
return err
}
*o = GetVersion200Response(varGetVersion200Response)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableGetVersion200Response struct {
value *GetVersion200Response
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the HealthNotReadyStatus type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &HealthNotReadyStatus{}
// HealthNotReadyStatus struct for HealthNotReadyStatus
type HealthNotReadyStatus struct {
// Errors contains a list of errors that caused the not ready status.
Errors *map[string]string `json:"errors,omitempty"`
Errors *map[string]string `json:"errors,omitempty"`
AdditionalProperties map[string]interface{}
}
type _HealthNotReadyStatus HealthNotReadyStatus
// NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus {
// GetErrors returns the Errors field value if set, zero value otherwise.
func (o *HealthNotReadyStatus) GetErrors() map[string]string {
if o == nil || o.Errors == nil {
if o == nil || IsNil(o.Errors) {
var ret map[string]string
return ret
}
@ -50,7 +56,7 @@ func (o *HealthNotReadyStatus) GetErrors() map[string]string {
// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) {
if o == nil || o.Errors == nil {
if o == nil || IsNil(o.Errors) {
return nil, false
}
return o.Errors, true
@ -58,7 +64,7 @@ func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) {
// HasErrors returns a boolean if a field has been set.
func (o *HealthNotReadyStatus) HasErrors() bool {
if o != nil && o.Errors != nil {
if o != nil && !IsNil(o.Errors) {
return true
}
@ -71,13 +77,47 @@ func (o *HealthNotReadyStatus) SetErrors(v map[string]string) {
}
func (o HealthNotReadyStatus) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Errors != nil {
toSerialize["errors"] = o.Errors
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o HealthNotReadyStatus) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Errors) {
toSerialize["errors"] = o.Errors
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *HealthNotReadyStatus) UnmarshalJSON(data []byte) (err error) {
varHealthNotReadyStatus := _HealthNotReadyStatus{}
err = json.Unmarshal(data, &varHealthNotReadyStatus)
if err != nil {
return err
}
*o = HealthNotReadyStatus(varHealthNotReadyStatus)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "errors")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableHealthNotReadyStatus struct {
value *HealthNotReadyStatus
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the HealthStatus type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &HealthStatus{}
// HealthStatus struct for HealthStatus
type HealthStatus struct {
// Status always contains \"ok\".
Status *string `json:"status,omitempty"`
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _HealthStatus HealthStatus
// NewHealthStatus instantiates a new HealthStatus object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewHealthStatusWithDefaults() *HealthStatus {
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *HealthStatus) GetStatus() string {
if o == nil || o.Status == nil {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
@ -50,7 +56,7 @@ func (o *HealthStatus) GetStatus() string {
// 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 *HealthStatus) GetStatusOk() (*string, bool) {
if o == nil || o.Status == nil {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
@ -58,7 +64,7 @@ func (o *HealthStatus) GetStatusOk() (*string, bool) {
// HasStatus returns a boolean if a field has been set.
func (o *HealthStatus) HasStatus() bool {
if o != nil && o.Status != nil {
if o != nil && !IsNil(o.Status) {
return true
}
@ -71,13 +77,47 @@ func (o *HealthStatus) SetStatus(v string) {
}
func (o HealthStatus) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Status != nil {
toSerialize["status"] = o.Status
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o HealthStatus) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *HealthStatus) UnmarshalJSON(data []byte) (err error) {
varHealthStatus := _HealthStatus{}
err = json.Unmarshal(data, &varHealthStatus)
if err != nil {
return err
}
*o = HealthStatus(varHealthStatus)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableHealthStatus struct {
value *HealthStatus
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the Identity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Identity{}
// Identity An [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model) represents a (human) user in Ory.
type Identity struct {
// CreatedAt is a helper struct field for gobuffalo.pop.
@ -43,9 +47,12 @@ type Identity struct {
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
// VerifiableAddresses contains all the addresses that can be verified by the user.
VerifiableAddresses []VerifiableIdentityAddress `json:"verifiable_addresses,omitempty"`
VerifiableAddresses []VerifiableIdentityAddress `json:"verifiable_addresses,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Identity Identity
// NewIdentity instantiates a new Identity object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -69,7 +76,7 @@ func NewIdentityWithDefaults() *Identity {
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Identity) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
@ -79,7 +86,7 @@ func (o *Identity) GetCreatedAt() time.Time {
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
@ -87,7 +94,7 @@ func (o *Identity) GetCreatedAtOk() (*time.Time, bool) {
// HasCreatedAt returns a boolean if a field has been set.
func (o *Identity) HasCreatedAt() bool {
if o != nil && o.CreatedAt != nil {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
@ -101,7 +108,7 @@ func (o *Identity) SetCreatedAt(v time.Time) {
// GetCredentials returns the Credentials field value if set, zero value otherwise.
func (o *Identity) GetCredentials() map[string]IdentityCredentials {
if o == nil || o.Credentials == nil {
if o == nil || IsNil(o.Credentials) {
var ret map[string]IdentityCredentials
return ret
}
@ -111,7 +118,7 @@ func (o *Identity) GetCredentials() map[string]IdentityCredentials {
// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetCredentialsOk() (*map[string]IdentityCredentials, bool) {
if o == nil || o.Credentials == nil {
if o == nil || IsNil(o.Credentials) {
return nil, false
}
return o.Credentials, true
@ -119,7 +126,7 @@ func (o *Identity) GetCredentialsOk() (*map[string]IdentityCredentials, bool) {
// HasCredentials returns a boolean if a field has been set.
func (o *Identity) HasCredentials() bool {
if o != nil && o.Credentials != nil {
if o != nil && !IsNil(o.Credentials) {
return true
}
@ -168,7 +175,7 @@ func (o *Identity) GetMetadataAdmin() interface{} {
// 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 *Identity) GetMetadataAdminOk() (*interface{}, bool) {
if o == nil || o.MetadataAdmin == nil {
if o == nil || IsNil(o.MetadataAdmin) {
return nil, false
}
return &o.MetadataAdmin, true
@ -176,7 +183,7 @@ func (o *Identity) GetMetadataAdminOk() (*interface{}, bool) {
// HasMetadataAdmin returns a boolean if a field has been set.
func (o *Identity) HasMetadataAdmin() bool {
if o != nil && o.MetadataAdmin != nil {
if o != nil && !IsNil(o.MetadataAdmin) {
return true
}
@ -201,7 +208,7 @@ func (o *Identity) GetMetadataPublic() interface{} {
// 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 *Identity) GetMetadataPublicOk() (*interface{}, bool) {
if o == nil || o.MetadataPublic == nil {
if o == nil || IsNil(o.MetadataPublic) {
return nil, false
}
return &o.MetadataPublic, true
@ -209,7 +216,7 @@ func (o *Identity) GetMetadataPublicOk() (*interface{}, bool) {
// HasMetadataPublic returns a boolean if a field has been set.
func (o *Identity) HasMetadataPublic() bool {
if o != nil && o.MetadataPublic != nil {
if o != nil && !IsNil(o.MetadataPublic) {
return true
}
@ -223,7 +230,7 @@ func (o *Identity) SetMetadataPublic(v interface{}) {
// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Identity) GetOrganizationId() string {
if o == nil || o.OrganizationId.Get() == nil {
if o == nil || IsNil(o.OrganizationId.Get()) {
var ret string
return ret
}
@ -266,7 +273,7 @@ func (o *Identity) UnsetOrganizationId() {
// GetRecoveryAddresses returns the RecoveryAddresses field value if set, zero value otherwise.
func (o *Identity) GetRecoveryAddresses() []RecoveryIdentityAddress {
if o == nil || o.RecoveryAddresses == nil {
if o == nil || IsNil(o.RecoveryAddresses) {
var ret []RecoveryIdentityAddress
return ret
}
@ -276,7 +283,7 @@ func (o *Identity) GetRecoveryAddresses() []RecoveryIdentityAddress {
// GetRecoveryAddressesOk returns a tuple with the RecoveryAddresses field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetRecoveryAddressesOk() ([]RecoveryIdentityAddress, bool) {
if o == nil || o.RecoveryAddresses == nil {
if o == nil || IsNil(o.RecoveryAddresses) {
return nil, false
}
return o.RecoveryAddresses, true
@ -284,7 +291,7 @@ func (o *Identity) GetRecoveryAddressesOk() ([]RecoveryIdentityAddress, bool) {
// HasRecoveryAddresses returns a boolean if a field has been set.
func (o *Identity) HasRecoveryAddresses() bool {
if o != nil && o.RecoveryAddresses != nil {
if o != nil && !IsNil(o.RecoveryAddresses) {
return true
}
@ -346,7 +353,7 @@ func (o *Identity) SetSchemaUrl(v string) {
// GetState returns the State field value if set, zero value otherwise.
func (o *Identity) GetState() string {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
@ -356,7 +363,7 @@ func (o *Identity) GetState() string {
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetStateOk() (*string, bool) {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
@ -364,7 +371,7 @@ func (o *Identity) GetStateOk() (*string, bool) {
// HasState returns a boolean if a field has been set.
func (o *Identity) HasState() bool {
if o != nil && o.State != nil {
if o != nil && !IsNil(o.State) {
return true
}
@ -378,7 +385,7 @@ func (o *Identity) SetState(v string) {
// GetStateChangedAt returns the StateChangedAt field value if set, zero value otherwise.
func (o *Identity) GetStateChangedAt() time.Time {
if o == nil || o.StateChangedAt == nil {
if o == nil || IsNil(o.StateChangedAt) {
var ret time.Time
return ret
}
@ -388,7 +395,7 @@ func (o *Identity) GetStateChangedAt() time.Time {
// GetStateChangedAtOk returns a tuple with the StateChangedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetStateChangedAtOk() (*time.Time, bool) {
if o == nil || o.StateChangedAt == nil {
if o == nil || IsNil(o.StateChangedAt) {
return nil, false
}
return o.StateChangedAt, true
@ -396,7 +403,7 @@ func (o *Identity) GetStateChangedAtOk() (*time.Time, bool) {
// HasStateChangedAt returns a boolean if a field has been set.
func (o *Identity) HasStateChangedAt() bool {
if o != nil && o.StateChangedAt != nil {
if o != nil && !IsNil(o.StateChangedAt) {
return true
}
@ -423,7 +430,7 @@ func (o *Identity) GetTraits() interface{} {
// 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 *Identity) GetTraitsOk() (*interface{}, bool) {
if o == nil || o.Traits == nil {
if o == nil || IsNil(o.Traits) {
return nil, false
}
return &o.Traits, true
@ -436,7 +443,7 @@ func (o *Identity) SetTraits(v interface{}) {
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *Identity) GetUpdatedAt() time.Time {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
@ -446,7 +453,7 @@ func (o *Identity) GetUpdatedAt() time.Time {
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
@ -454,7 +461,7 @@ func (o *Identity) GetUpdatedAtOk() (*time.Time, bool) {
// HasUpdatedAt returns a boolean if a field has been set.
func (o *Identity) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt != nil {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
@ -468,7 +475,7 @@ func (o *Identity) SetUpdatedAt(v time.Time) {
// GetVerifiableAddresses returns the VerifiableAddresses field value if set, zero value otherwise.
func (o *Identity) GetVerifiableAddresses() []VerifiableIdentityAddress {
if o == nil || o.VerifiableAddresses == nil {
if o == nil || IsNil(o.VerifiableAddresses) {
var ret []VerifiableIdentityAddress
return ret
}
@ -478,7 +485,7 @@ func (o *Identity) GetVerifiableAddresses() []VerifiableIdentityAddress {
// GetVerifiableAddressesOk returns a tuple with the VerifiableAddresses field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetVerifiableAddressesOk() ([]VerifiableIdentityAddress, bool) {
if o == nil || o.VerifiableAddresses == nil {
if o == nil || IsNil(o.VerifiableAddresses) {
return nil, false
}
return o.VerifiableAddresses, true
@ -486,7 +493,7 @@ func (o *Identity) GetVerifiableAddressesOk() ([]VerifiableIdentityAddress, bool
// HasVerifiableAddresses returns a boolean if a field has been set.
func (o *Identity) HasVerifiableAddresses() bool {
if o != nil && o.VerifiableAddresses != nil {
if o != nil && !IsNil(o.VerifiableAddresses) {
return true
}
@ -499,16 +506,22 @@ func (o *Identity) SetVerifiableAddresses(v []VerifiableIdentityAddress) {
}
func (o Identity) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Identity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.CreatedAt != nil {
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if o.Credentials != nil {
if !IsNil(o.Credentials) {
toSerialize["credentials"] = o.Credentials
}
if true {
toSerialize["id"] = o.Id
}
toSerialize["id"] = o.Id
if o.MetadataAdmin != nil {
toSerialize["metadata_admin"] = o.MetadataAdmin
}
@ -518,31 +531,90 @@ func (o Identity) MarshalJSON() ([]byte, error) {
if o.OrganizationId.IsSet() {
toSerialize["organization_id"] = o.OrganizationId.Get()
}
if o.RecoveryAddresses != nil {
if !IsNil(o.RecoveryAddresses) {
toSerialize["recovery_addresses"] = o.RecoveryAddresses
}
if true {
toSerialize["schema_id"] = o.SchemaId
}
if true {
toSerialize["schema_url"] = o.SchemaUrl
}
if o.State != nil {
toSerialize["schema_id"] = o.SchemaId
toSerialize["schema_url"] = o.SchemaUrl
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if o.StateChangedAt != nil {
if !IsNil(o.StateChangedAt) {
toSerialize["state_changed_at"] = o.StateChangedAt
}
if o.Traits != nil {
toSerialize["traits"] = o.Traits
}
if o.UpdatedAt != nil {
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
if o.VerifiableAddresses != nil {
if !IsNil(o.VerifiableAddresses) {
toSerialize["verifiable_addresses"] = o.VerifiableAddresses
}
return json.Marshal(toSerialize)
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Identity) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"schema_id",
"schema_url",
"traits",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIdentity := _Identity{}
err = json.Unmarshal(data, &varIdentity)
if err != nil {
return err
}
*o = Identity(varIdentity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created_at")
delete(additionalProperties, "credentials")
delete(additionalProperties, "id")
delete(additionalProperties, "metadata_admin")
delete(additionalProperties, "metadata_public")
delete(additionalProperties, "organization_id")
delete(additionalProperties, "recovery_addresses")
delete(additionalProperties, "schema_id")
delete(additionalProperties, "schema_url")
delete(additionalProperties, "state")
delete(additionalProperties, "state_changed_at")
delete(additionalProperties, "traits")
delete(additionalProperties, "updated_at")
delete(additionalProperties, "verifiable_addresses")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentity struct {

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -16,6 +16,9 @@ import (
"time"
)
// checks if the IdentityCredentials type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityCredentials{}
// IdentityCredentials Credentials represents a specific credential type
type IdentityCredentials struct {
Config map[string]interface{} `json:"config,omitempty"`
@ -28,9 +31,12 @@ type IdentityCredentials struct {
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
// Version refers to the version of the credential. Useful when changing the config schema.
Version *int64 `json:"version,omitempty"`
Version *int64 `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityCredentials IdentityCredentials
// NewIdentityCredentials instantiates a new IdentityCredentials object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -50,7 +56,7 @@ func NewIdentityCredentialsWithDefaults() *IdentityCredentials {
// GetConfig returns the Config field value if set, zero value otherwise.
func (o *IdentityCredentials) GetConfig() map[string]interface{} {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
var ret map[string]interface{}
return ret
}
@ -60,15 +66,15 @@ func (o *IdentityCredentials) GetConfig() map[string]interface{} {
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentials) GetConfigOk() (map[string]interface{}, bool) {
if o == nil || o.Config == nil {
return nil, false
if o == nil || IsNil(o.Config) {
return map[string]interface{}{}, false
}
return o.Config, true
}
// HasConfig returns a boolean if a field has been set.
func (o *IdentityCredentials) HasConfig() bool {
if o != nil && o.Config != nil {
if o != nil && !IsNil(o.Config) {
return true
}
@ -82,7 +88,7 @@ func (o *IdentityCredentials) SetConfig(v map[string]interface{}) {
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *IdentityCredentials) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
@ -92,7 +98,7 @@ func (o *IdentityCredentials) GetCreatedAt() time.Time {
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentials) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
@ -100,7 +106,7 @@ func (o *IdentityCredentials) GetCreatedAtOk() (*time.Time, bool) {
// HasCreatedAt returns a boolean if a field has been set.
func (o *IdentityCredentials) HasCreatedAt() bool {
if o != nil && o.CreatedAt != nil {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
@ -114,7 +120,7 @@ func (o *IdentityCredentials) SetCreatedAt(v time.Time) {
// GetIdentifiers returns the Identifiers field value if set, zero value otherwise.
func (o *IdentityCredentials) GetIdentifiers() []string {
if o == nil || o.Identifiers == nil {
if o == nil || IsNil(o.Identifiers) {
var ret []string
return ret
}
@ -124,7 +130,7 @@ func (o *IdentityCredentials) GetIdentifiers() []string {
// GetIdentifiersOk returns a tuple with the Identifiers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentials) GetIdentifiersOk() ([]string, bool) {
if o == nil || o.Identifiers == nil {
if o == nil || IsNil(o.Identifiers) {
return nil, false
}
return o.Identifiers, true
@ -132,7 +138,7 @@ func (o *IdentityCredentials) GetIdentifiersOk() ([]string, bool) {
// HasIdentifiers returns a boolean if a field has been set.
func (o *IdentityCredentials) HasIdentifiers() bool {
if o != nil && o.Identifiers != nil {
if o != nil && !IsNil(o.Identifiers) {
return true
}
@ -146,7 +152,7 @@ func (o *IdentityCredentials) SetIdentifiers(v []string) {
// GetType returns the Type field value if set, zero value otherwise.
func (o *IdentityCredentials) GetType() string {
if o == nil || o.Type == nil {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
@ -156,7 +162,7 @@ func (o *IdentityCredentials) GetType() string {
// 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 *IdentityCredentials) GetTypeOk() (*string, bool) {
if o == nil || o.Type == nil {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
@ -164,7 +170,7 @@ func (o *IdentityCredentials) GetTypeOk() (*string, bool) {
// HasType returns a boolean if a field has been set.
func (o *IdentityCredentials) HasType() bool {
if o != nil && o.Type != nil {
if o != nil && !IsNil(o.Type) {
return true
}
@ -178,7 +184,7 @@ func (o *IdentityCredentials) SetType(v string) {
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *IdentityCredentials) GetUpdatedAt() time.Time {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
@ -188,7 +194,7 @@ func (o *IdentityCredentials) GetUpdatedAt() time.Time {
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentials) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
@ -196,7 +202,7 @@ func (o *IdentityCredentials) GetUpdatedAtOk() (*time.Time, bool) {
// HasUpdatedAt returns a boolean if a field has been set.
func (o *IdentityCredentials) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt != nil {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
@ -210,7 +216,7 @@ func (o *IdentityCredentials) SetUpdatedAt(v time.Time) {
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *IdentityCredentials) GetVersion() int64 {
if o == nil || o.Version == nil {
if o == nil || IsNil(o.Version) {
var ret int64
return ret
}
@ -220,7 +226,7 @@ func (o *IdentityCredentials) GetVersion() int64 {
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentials) GetVersionOk() (*int64, bool) {
if o == nil || o.Version == nil {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
@ -228,7 +234,7 @@ func (o *IdentityCredentials) GetVersionOk() (*int64, bool) {
// HasVersion returns a boolean if a field has been set.
func (o *IdentityCredentials) HasVersion() bool {
if o != nil && o.Version != nil {
if o != nil && !IsNil(o.Version) {
return true
}
@ -241,28 +247,67 @@ func (o *IdentityCredentials) SetVersion(v int64) {
}
func (o IdentityCredentials) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Config != nil {
toSerialize["config"] = o.Config
}
if o.CreatedAt != nil {
toSerialize["created_at"] = o.CreatedAt
}
if o.Identifiers != nil {
toSerialize["identifiers"] = o.Identifiers
}
if o.Type != nil {
toSerialize["type"] = o.Type
}
if o.UpdatedAt != nil {
toSerialize["updated_at"] = o.UpdatedAt
}
if o.Version != nil {
toSerialize["version"] = o.Version
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityCredentials) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Config) {
toSerialize["config"] = o.Config
}
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if !IsNil(o.Identifiers) {
toSerialize["identifiers"] = o.Identifiers
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityCredentials) UnmarshalJSON(data []byte) (err error) {
varIdentityCredentials := _IdentityCredentials{}
err = json.Unmarshal(data, &varIdentityCredentials)
if err != nil {
return err
}
*o = IdentityCredentials(varIdentityCredentials)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "config")
delete(additionalProperties, "created_at")
delete(additionalProperties, "identifiers")
delete(additionalProperties, "type")
delete(additionalProperties, "updated_at")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityCredentials struct {
value *IdentityCredentials
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,11 +15,17 @@ import (
"encoding/json"
)
// checks if the IdentityCredentialsCode type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityCredentialsCode{}
// IdentityCredentialsCode CredentialsCode represents a one time login/registration code
type IdentityCredentialsCode struct {
Addresses []IdentityCredentialsCodeAddress `json:"addresses,omitempty"`
Addresses []IdentityCredentialsCodeAddress `json:"addresses,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityCredentialsCode IdentityCredentialsCode
// NewIdentityCredentialsCode instantiates a new IdentityCredentialsCode object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -39,7 +45,7 @@ func NewIdentityCredentialsCodeWithDefaults() *IdentityCredentialsCode {
// GetAddresses returns the Addresses field value if set, zero value otherwise.
func (o *IdentityCredentialsCode) GetAddresses() []IdentityCredentialsCodeAddress {
if o == nil || o.Addresses == nil {
if o == nil || IsNil(o.Addresses) {
var ret []IdentityCredentialsCodeAddress
return ret
}
@ -49,7 +55,7 @@ func (o *IdentityCredentialsCode) GetAddresses() []IdentityCredentialsCodeAddres
// GetAddressesOk returns a tuple with the Addresses field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsCode) GetAddressesOk() ([]IdentityCredentialsCodeAddress, bool) {
if o == nil || o.Addresses == nil {
if o == nil || IsNil(o.Addresses) {
return nil, false
}
return o.Addresses, true
@ -57,7 +63,7 @@ func (o *IdentityCredentialsCode) GetAddressesOk() ([]IdentityCredentialsCodeAdd
// HasAddresses returns a boolean if a field has been set.
func (o *IdentityCredentialsCode) HasAddresses() bool {
if o != nil && o.Addresses != nil {
if o != nil && !IsNil(o.Addresses) {
return true
}
@ -70,13 +76,47 @@ func (o *IdentityCredentialsCode) SetAddresses(v []IdentityCredentialsCodeAddres
}
func (o IdentityCredentialsCode) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Addresses != nil {
toSerialize["addresses"] = o.Addresses
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityCredentialsCode) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Addresses) {
toSerialize["addresses"] = o.Addresses
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityCredentialsCode) UnmarshalJSON(data []byte) (err error) {
varIdentityCredentialsCode := _IdentityCredentialsCode{}
err = json.Unmarshal(data, &varIdentityCredentialsCode)
if err != nil {
return err
}
*o = IdentityCredentialsCode(varIdentityCredentialsCode)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "addresses")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityCredentialsCode struct {
value *IdentityCredentialsCode
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,13 +15,19 @@ import (
"encoding/json"
)
// checks if the IdentityCredentialsCodeAddress type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityCredentialsCodeAddress{}
// IdentityCredentialsCodeAddress struct for IdentityCredentialsCodeAddress
type IdentityCredentialsCodeAddress struct {
// The address for this code
Address *string `json:"address,omitempty"`
Channel *string `json:"channel,omitempty"`
Address *string `json:"address,omitempty"`
Channel *string `json:"channel,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityCredentialsCodeAddress IdentityCredentialsCodeAddress
// NewIdentityCredentialsCodeAddress instantiates a new IdentityCredentialsCodeAddress object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -41,7 +47,7 @@ func NewIdentityCredentialsCodeAddressWithDefaults() *IdentityCredentialsCodeAdd
// GetAddress returns the Address field value if set, zero value otherwise.
func (o *IdentityCredentialsCodeAddress) GetAddress() string {
if o == nil || o.Address == nil {
if o == nil || IsNil(o.Address) {
var ret string
return ret
}
@ -51,7 +57,7 @@ func (o *IdentityCredentialsCodeAddress) GetAddress() string {
// GetAddressOk returns a tuple with the Address field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsCodeAddress) GetAddressOk() (*string, bool) {
if o == nil || o.Address == nil {
if o == nil || IsNil(o.Address) {
return nil, false
}
return o.Address, true
@ -59,7 +65,7 @@ func (o *IdentityCredentialsCodeAddress) GetAddressOk() (*string, bool) {
// HasAddress returns a boolean if a field has been set.
func (o *IdentityCredentialsCodeAddress) HasAddress() bool {
if o != nil && o.Address != nil {
if o != nil && !IsNil(o.Address) {
return true
}
@ -73,7 +79,7 @@ func (o *IdentityCredentialsCodeAddress) SetAddress(v string) {
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *IdentityCredentialsCodeAddress) GetChannel() string {
if o == nil || o.Channel == nil {
if o == nil || IsNil(o.Channel) {
var ret string
return ret
}
@ -83,7 +89,7 @@ func (o *IdentityCredentialsCodeAddress) GetChannel() string {
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsCodeAddress) GetChannelOk() (*string, bool) {
if o == nil || o.Channel == nil {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
@ -91,7 +97,7 @@ func (o *IdentityCredentialsCodeAddress) GetChannelOk() (*string, bool) {
// HasChannel returns a boolean if a field has been set.
func (o *IdentityCredentialsCodeAddress) HasChannel() bool {
if o != nil && o.Channel != nil {
if o != nil && !IsNil(o.Channel) {
return true
}
@ -104,16 +110,51 @@ func (o *IdentityCredentialsCodeAddress) SetChannel(v string) {
}
func (o IdentityCredentialsCodeAddress) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Address != nil {
toSerialize["address"] = o.Address
}
if o.Channel != nil {
toSerialize["channel"] = o.Channel
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityCredentialsCodeAddress) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Address) {
toSerialize["address"] = o.Address
}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityCredentialsCodeAddress) UnmarshalJSON(data []byte) (err error) {
varIdentityCredentialsCodeAddress := _IdentityCredentialsCodeAddress{}
err = json.Unmarshal(data, &varIdentityCredentialsCodeAddress)
if err != nil {
return err
}
*o = IdentityCredentialsCodeAddress(varIdentityCredentialsCodeAddress)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "address")
delete(additionalProperties, "channel")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityCredentialsCodeAddress struct {
value *IdentityCredentialsCodeAddress
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,11 +15,17 @@ import (
"encoding/json"
)
// checks if the IdentityCredentialsOidc type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityCredentialsOidc{}
// IdentityCredentialsOidc struct for IdentityCredentialsOidc
type IdentityCredentialsOidc struct {
Providers []IdentityCredentialsOidcProvider `json:"providers,omitempty"`
Providers []IdentityCredentialsOidcProvider `json:"providers,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityCredentialsOidc IdentityCredentialsOidc
// NewIdentityCredentialsOidc instantiates a new IdentityCredentialsOidc object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -39,7 +45,7 @@ func NewIdentityCredentialsOidcWithDefaults() *IdentityCredentialsOidc {
// GetProviders returns the Providers field value if set, zero value otherwise.
func (o *IdentityCredentialsOidc) GetProviders() []IdentityCredentialsOidcProvider {
if o == nil || o.Providers == nil {
if o == nil || IsNil(o.Providers) {
var ret []IdentityCredentialsOidcProvider
return ret
}
@ -49,7 +55,7 @@ func (o *IdentityCredentialsOidc) GetProviders() []IdentityCredentialsOidcProvid
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidc) GetProvidersOk() ([]IdentityCredentialsOidcProvider, bool) {
if o == nil || o.Providers == nil {
if o == nil || IsNil(o.Providers) {
return nil, false
}
return o.Providers, true
@ -57,7 +63,7 @@ func (o *IdentityCredentialsOidc) GetProvidersOk() ([]IdentityCredentialsOidcPro
// HasProviders returns a boolean if a field has been set.
func (o *IdentityCredentialsOidc) HasProviders() bool {
if o != nil && o.Providers != nil {
if o != nil && !IsNil(o.Providers) {
return true
}
@ -70,13 +76,47 @@ func (o *IdentityCredentialsOidc) SetProviders(v []IdentityCredentialsOidcProvid
}
func (o IdentityCredentialsOidc) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Providers != nil {
toSerialize["providers"] = o.Providers
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityCredentialsOidc) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Providers) {
toSerialize["providers"] = o.Providers
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityCredentialsOidc) UnmarshalJSON(data []byte) (err error) {
varIdentityCredentialsOidc := _IdentityCredentialsOidc{}
err = json.Unmarshal(data, &varIdentityCredentialsOidc)
if err != nil {
return err
}
*o = IdentityCredentialsOidc(varIdentityCredentialsOidc)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "providers")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityCredentialsOidc struct {
value *IdentityCredentialsOidc
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,17 +15,23 @@ import (
"encoding/json"
)
// checks if the IdentityCredentialsOidcProvider type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityCredentialsOidcProvider{}
// IdentityCredentialsOidcProvider struct for IdentityCredentialsOidcProvider
type IdentityCredentialsOidcProvider struct {
InitialAccessToken *string `json:"initial_access_token,omitempty"`
InitialIdToken *string `json:"initial_id_token,omitempty"`
InitialRefreshToken *string `json:"initial_refresh_token,omitempty"`
Organization *string `json:"organization,omitempty"`
Provider *string `json:"provider,omitempty"`
Subject *string `json:"subject,omitempty"`
UseAutoLink *bool `json:"use_auto_link,omitempty"`
InitialAccessToken *string `json:"initial_access_token,omitempty"`
InitialIdToken *string `json:"initial_id_token,omitempty"`
InitialRefreshToken *string `json:"initial_refresh_token,omitempty"`
Organization *string `json:"organization,omitempty"`
Provider *string `json:"provider,omitempty"`
Subject *string `json:"subject,omitempty"`
UseAutoLink *bool `json:"use_auto_link,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityCredentialsOidcProvider IdentityCredentialsOidcProvider
// NewIdentityCredentialsOidcProvider instantiates a new IdentityCredentialsOidcProvider object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -45,7 +51,7 @@ func NewIdentityCredentialsOidcProviderWithDefaults() *IdentityCredentialsOidcPr
// GetInitialAccessToken returns the InitialAccessToken field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetInitialAccessToken() string {
if o == nil || o.InitialAccessToken == nil {
if o == nil || IsNil(o.InitialAccessToken) {
var ret string
return ret
}
@ -55,7 +61,7 @@ func (o *IdentityCredentialsOidcProvider) GetInitialAccessToken() string {
// GetInitialAccessTokenOk returns a tuple with the InitialAccessToken field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetInitialAccessTokenOk() (*string, bool) {
if o == nil || o.InitialAccessToken == nil {
if o == nil || IsNil(o.InitialAccessToken) {
return nil, false
}
return o.InitialAccessToken, true
@ -63,7 +69,7 @@ func (o *IdentityCredentialsOidcProvider) GetInitialAccessTokenOk() (*string, bo
// HasInitialAccessToken returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasInitialAccessToken() bool {
if o != nil && o.InitialAccessToken != nil {
if o != nil && !IsNil(o.InitialAccessToken) {
return true
}
@ -77,7 +83,7 @@ func (o *IdentityCredentialsOidcProvider) SetInitialAccessToken(v string) {
// GetInitialIdToken returns the InitialIdToken field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetInitialIdToken() string {
if o == nil || o.InitialIdToken == nil {
if o == nil || IsNil(o.InitialIdToken) {
var ret string
return ret
}
@ -87,7 +93,7 @@ func (o *IdentityCredentialsOidcProvider) GetInitialIdToken() string {
// GetInitialIdTokenOk returns a tuple with the InitialIdToken field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetInitialIdTokenOk() (*string, bool) {
if o == nil || o.InitialIdToken == nil {
if o == nil || IsNil(o.InitialIdToken) {
return nil, false
}
return o.InitialIdToken, true
@ -95,7 +101,7 @@ func (o *IdentityCredentialsOidcProvider) GetInitialIdTokenOk() (*string, bool)
// HasInitialIdToken returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasInitialIdToken() bool {
if o != nil && o.InitialIdToken != nil {
if o != nil && !IsNil(o.InitialIdToken) {
return true
}
@ -109,7 +115,7 @@ func (o *IdentityCredentialsOidcProvider) SetInitialIdToken(v string) {
// GetInitialRefreshToken returns the InitialRefreshToken field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetInitialRefreshToken() string {
if o == nil || o.InitialRefreshToken == nil {
if o == nil || IsNil(o.InitialRefreshToken) {
var ret string
return ret
}
@ -119,7 +125,7 @@ func (o *IdentityCredentialsOidcProvider) GetInitialRefreshToken() string {
// GetInitialRefreshTokenOk returns a tuple with the InitialRefreshToken field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetInitialRefreshTokenOk() (*string, bool) {
if o == nil || o.InitialRefreshToken == nil {
if o == nil || IsNil(o.InitialRefreshToken) {
return nil, false
}
return o.InitialRefreshToken, true
@ -127,7 +133,7 @@ func (o *IdentityCredentialsOidcProvider) GetInitialRefreshTokenOk() (*string, b
// HasInitialRefreshToken returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasInitialRefreshToken() bool {
if o != nil && o.InitialRefreshToken != nil {
if o != nil && !IsNil(o.InitialRefreshToken) {
return true
}
@ -141,7 +147,7 @@ func (o *IdentityCredentialsOidcProvider) SetInitialRefreshToken(v string) {
// GetOrganization returns the Organization field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetOrganization() string {
if o == nil || o.Organization == nil {
if o == nil || IsNil(o.Organization) {
var ret string
return ret
}
@ -151,7 +157,7 @@ func (o *IdentityCredentialsOidcProvider) GetOrganization() string {
// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetOrganizationOk() (*string, bool) {
if o == nil || o.Organization == nil {
if o == nil || IsNil(o.Organization) {
return nil, false
}
return o.Organization, true
@ -159,7 +165,7 @@ func (o *IdentityCredentialsOidcProvider) GetOrganizationOk() (*string, bool) {
// HasOrganization returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasOrganization() bool {
if o != nil && o.Organization != nil {
if o != nil && !IsNil(o.Organization) {
return true
}
@ -173,7 +179,7 @@ func (o *IdentityCredentialsOidcProvider) SetOrganization(v string) {
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetProvider() string {
if o == nil || o.Provider == nil {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
@ -183,7 +189,7 @@ func (o *IdentityCredentialsOidcProvider) GetProvider() string {
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetProviderOk() (*string, bool) {
if o == nil || o.Provider == nil {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
@ -191,7 +197,7 @@ func (o *IdentityCredentialsOidcProvider) GetProviderOk() (*string, bool) {
// HasProvider returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasProvider() bool {
if o != nil && o.Provider != nil {
if o != nil && !IsNil(o.Provider) {
return true
}
@ -205,7 +211,7 @@ func (o *IdentityCredentialsOidcProvider) SetProvider(v string) {
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetSubject() string {
if o == nil || o.Subject == nil {
if o == nil || IsNil(o.Subject) {
var ret string
return ret
}
@ -215,7 +221,7 @@ func (o *IdentityCredentialsOidcProvider) GetSubject() string {
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetSubjectOk() (*string, bool) {
if o == nil || o.Subject == nil {
if o == nil || IsNil(o.Subject) {
return nil, false
}
return o.Subject, true
@ -223,7 +229,7 @@ func (o *IdentityCredentialsOidcProvider) GetSubjectOk() (*string, bool) {
// HasSubject returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasSubject() bool {
if o != nil && o.Subject != nil {
if o != nil && !IsNil(o.Subject) {
return true
}
@ -237,7 +243,7 @@ func (o *IdentityCredentialsOidcProvider) SetSubject(v string) {
// GetUseAutoLink returns the UseAutoLink field value if set, zero value otherwise.
func (o *IdentityCredentialsOidcProvider) GetUseAutoLink() bool {
if o == nil || o.UseAutoLink == nil {
if o == nil || IsNil(o.UseAutoLink) {
var ret bool
return ret
}
@ -247,7 +253,7 @@ func (o *IdentityCredentialsOidcProvider) GetUseAutoLink() bool {
// GetUseAutoLinkOk returns a tuple with the UseAutoLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsOidcProvider) GetUseAutoLinkOk() (*bool, bool) {
if o == nil || o.UseAutoLink == nil {
if o == nil || IsNil(o.UseAutoLink) {
return nil, false
}
return o.UseAutoLink, true
@ -255,7 +261,7 @@ func (o *IdentityCredentialsOidcProvider) GetUseAutoLinkOk() (*bool, bool) {
// HasUseAutoLink returns a boolean if a field has been set.
func (o *IdentityCredentialsOidcProvider) HasUseAutoLink() bool {
if o != nil && o.UseAutoLink != nil {
if o != nil && !IsNil(o.UseAutoLink) {
return true
}
@ -268,31 +274,71 @@ func (o *IdentityCredentialsOidcProvider) SetUseAutoLink(v bool) {
}
func (o IdentityCredentialsOidcProvider) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.InitialAccessToken != nil {
toSerialize["initial_access_token"] = o.InitialAccessToken
}
if o.InitialIdToken != nil {
toSerialize["initial_id_token"] = o.InitialIdToken
}
if o.InitialRefreshToken != nil {
toSerialize["initial_refresh_token"] = o.InitialRefreshToken
}
if o.Organization != nil {
toSerialize["organization"] = o.Organization
}
if o.Provider != nil {
toSerialize["provider"] = o.Provider
}
if o.Subject != nil {
toSerialize["subject"] = o.Subject
}
if o.UseAutoLink != nil {
toSerialize["use_auto_link"] = o.UseAutoLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityCredentialsOidcProvider) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.InitialAccessToken) {
toSerialize["initial_access_token"] = o.InitialAccessToken
}
if !IsNil(o.InitialIdToken) {
toSerialize["initial_id_token"] = o.InitialIdToken
}
if !IsNil(o.InitialRefreshToken) {
toSerialize["initial_refresh_token"] = o.InitialRefreshToken
}
if !IsNil(o.Organization) {
toSerialize["organization"] = o.Organization
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Subject) {
toSerialize["subject"] = o.Subject
}
if !IsNil(o.UseAutoLink) {
toSerialize["use_auto_link"] = o.UseAutoLink
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityCredentialsOidcProvider) UnmarshalJSON(data []byte) (err error) {
varIdentityCredentialsOidcProvider := _IdentityCredentialsOidcProvider{}
err = json.Unmarshal(data, &varIdentityCredentialsOidcProvider)
if err != nil {
return err
}
*o = IdentityCredentialsOidcProvider(varIdentityCredentialsOidcProvider)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "initial_access_token")
delete(additionalProperties, "initial_id_token")
delete(additionalProperties, "initial_refresh_token")
delete(additionalProperties, "organization")
delete(additionalProperties, "provider")
delete(additionalProperties, "subject")
delete(additionalProperties, "use_auto_link")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityCredentialsOidcProvider struct {
value *IdentityCredentialsOidcProvider
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,14 +15,20 @@ import (
"encoding/json"
)
// checks if the IdentityCredentialsPassword type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityCredentialsPassword{}
// IdentityCredentialsPassword struct for IdentityCredentialsPassword
type IdentityCredentialsPassword struct {
// HashedPassword is a hash-representation of the password.
HashedPassword *string `json:"hashed_password,omitempty"`
// UsePasswordMigrationHook is set to true if the password should be migrated using the password migration hook. If set, and the HashedPassword is empty, a webhook will be called during login to migrate the password.
UsePasswordMigrationHook *bool `json:"use_password_migration_hook,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityCredentialsPassword IdentityCredentialsPassword
// NewIdentityCredentialsPassword instantiates a new IdentityCredentialsPassword object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -42,7 +48,7 @@ func NewIdentityCredentialsPasswordWithDefaults() *IdentityCredentialsPassword {
// GetHashedPassword returns the HashedPassword field value if set, zero value otherwise.
func (o *IdentityCredentialsPassword) GetHashedPassword() string {
if o == nil || o.HashedPassword == nil {
if o == nil || IsNil(o.HashedPassword) {
var ret string
return ret
}
@ -52,7 +58,7 @@ func (o *IdentityCredentialsPassword) GetHashedPassword() string {
// GetHashedPasswordOk returns a tuple with the HashedPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsPassword) GetHashedPasswordOk() (*string, bool) {
if o == nil || o.HashedPassword == nil {
if o == nil || IsNil(o.HashedPassword) {
return nil, false
}
return o.HashedPassword, true
@ -60,7 +66,7 @@ func (o *IdentityCredentialsPassword) GetHashedPasswordOk() (*string, bool) {
// HasHashedPassword returns a boolean if a field has been set.
func (o *IdentityCredentialsPassword) HasHashedPassword() bool {
if o != nil && o.HashedPassword != nil {
if o != nil && !IsNil(o.HashedPassword) {
return true
}
@ -74,7 +80,7 @@ func (o *IdentityCredentialsPassword) SetHashedPassword(v string) {
// GetUsePasswordMigrationHook returns the UsePasswordMigrationHook field value if set, zero value otherwise.
func (o *IdentityCredentialsPassword) GetUsePasswordMigrationHook() bool {
if o == nil || o.UsePasswordMigrationHook == nil {
if o == nil || IsNil(o.UsePasswordMigrationHook) {
var ret bool
return ret
}
@ -84,7 +90,7 @@ func (o *IdentityCredentialsPassword) GetUsePasswordMigrationHook() bool {
// GetUsePasswordMigrationHookOk returns a tuple with the UsePasswordMigrationHook field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityCredentialsPassword) GetUsePasswordMigrationHookOk() (*bool, bool) {
if o == nil || o.UsePasswordMigrationHook == nil {
if o == nil || IsNil(o.UsePasswordMigrationHook) {
return nil, false
}
return o.UsePasswordMigrationHook, true
@ -92,7 +98,7 @@ func (o *IdentityCredentialsPassword) GetUsePasswordMigrationHookOk() (*bool, bo
// HasUsePasswordMigrationHook returns a boolean if a field has been set.
func (o *IdentityCredentialsPassword) HasUsePasswordMigrationHook() bool {
if o != nil && o.UsePasswordMigrationHook != nil {
if o != nil && !IsNil(o.UsePasswordMigrationHook) {
return true
}
@ -105,16 +111,51 @@ func (o *IdentityCredentialsPassword) SetUsePasswordMigrationHook(v bool) {
}
func (o IdentityCredentialsPassword) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.HashedPassword != nil {
toSerialize["hashed_password"] = o.HashedPassword
}
if o.UsePasswordMigrationHook != nil {
toSerialize["use_password_migration_hook"] = o.UsePasswordMigrationHook
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityCredentialsPassword) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.HashedPassword) {
toSerialize["hashed_password"] = o.HashedPassword
}
if !IsNil(o.UsePasswordMigrationHook) {
toSerialize["use_password_migration_hook"] = o.UsePasswordMigrationHook
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityCredentialsPassword) UnmarshalJSON(data []byte) (err error) {
varIdentityCredentialsPassword := _IdentityCredentialsPassword{}
err = json.Unmarshal(data, &varIdentityCredentialsPassword)
if err != nil {
return err
}
*o = IdentityCredentialsPassword(varIdentityCredentialsPassword)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "hashed_password")
delete(additionalProperties, "use_password_migration_hook")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityCredentialsPassword struct {
value *IdentityCredentialsPassword
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,13 +15,19 @@ import (
"encoding/json"
)
// checks if the IdentityPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityPatch{}
// IdentityPatch Payload for patching an identity
type IdentityPatch struct {
Create *CreateIdentityBody `json:"create,omitempty"`
// The ID of this patch. The patch ID is optional. If specified, the ID will be returned in the response, so consumers of this API can correlate the response with the patch.
PatchId *string `json:"patch_id,omitempty"`
PatchId *string `json:"patch_id,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityPatch IdentityPatch
// NewIdentityPatch instantiates a new IdentityPatch object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -41,7 +47,7 @@ func NewIdentityPatchWithDefaults() *IdentityPatch {
// GetCreate returns the Create field value if set, zero value otherwise.
func (o *IdentityPatch) GetCreate() CreateIdentityBody {
if o == nil || o.Create == nil {
if o == nil || IsNil(o.Create) {
var ret CreateIdentityBody
return ret
}
@ -51,7 +57,7 @@ func (o *IdentityPatch) GetCreate() CreateIdentityBody {
// GetCreateOk returns a tuple with the Create field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityPatch) GetCreateOk() (*CreateIdentityBody, bool) {
if o == nil || o.Create == nil {
if o == nil || IsNil(o.Create) {
return nil, false
}
return o.Create, true
@ -59,7 +65,7 @@ func (o *IdentityPatch) GetCreateOk() (*CreateIdentityBody, bool) {
// HasCreate returns a boolean if a field has been set.
func (o *IdentityPatch) HasCreate() bool {
if o != nil && o.Create != nil {
if o != nil && !IsNil(o.Create) {
return true
}
@ -73,7 +79,7 @@ func (o *IdentityPatch) SetCreate(v CreateIdentityBody) {
// GetPatchId returns the PatchId field value if set, zero value otherwise.
func (o *IdentityPatch) GetPatchId() string {
if o == nil || o.PatchId == nil {
if o == nil || IsNil(o.PatchId) {
var ret string
return ret
}
@ -83,7 +89,7 @@ func (o *IdentityPatch) GetPatchId() string {
// GetPatchIdOk returns a tuple with the PatchId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityPatch) GetPatchIdOk() (*string, bool) {
if o == nil || o.PatchId == nil {
if o == nil || IsNil(o.PatchId) {
return nil, false
}
return o.PatchId, true
@ -91,7 +97,7 @@ func (o *IdentityPatch) GetPatchIdOk() (*string, bool) {
// HasPatchId returns a boolean if a field has been set.
func (o *IdentityPatch) HasPatchId() bool {
if o != nil && o.PatchId != nil {
if o != nil && !IsNil(o.PatchId) {
return true
}
@ -104,16 +110,51 @@ func (o *IdentityPatch) SetPatchId(v string) {
}
func (o IdentityPatch) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Create != nil {
toSerialize["create"] = o.Create
}
if o.PatchId != nil {
toSerialize["patch_id"] = o.PatchId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Create) {
toSerialize["create"] = o.Create
}
if !IsNil(o.PatchId) {
toSerialize["patch_id"] = o.PatchId
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityPatch) UnmarshalJSON(data []byte) (err error) {
varIdentityPatch := _IdentityPatch{}
err = json.Unmarshal(data, &varIdentityPatch)
if err != nil {
return err
}
*o = IdentityPatch(varIdentityPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "create")
delete(additionalProperties, "patch_id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityPatch struct {
value *IdentityPatch
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,6 +15,9 @@ import (
"encoding/json"
)
// checks if the IdentityPatchResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityPatchResponse{}
// IdentityPatchResponse Response for a single identity patch
type IdentityPatchResponse struct {
// The action for this specific patch create ActionCreate Create this identity. error ActionError Error indicates that the patch failed.
@ -23,9 +26,12 @@ type IdentityPatchResponse struct {
// The identity ID payload of this patch
Identity *string `json:"identity,omitempty"`
// The ID of this patch response, if an ID was specified in the patch.
PatchId *string `json:"patch_id,omitempty"`
PatchId *string `json:"patch_id,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityPatchResponse IdentityPatchResponse
// NewIdentityPatchResponse instantiates a new IdentityPatchResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -45,7 +51,7 @@ func NewIdentityPatchResponseWithDefaults() *IdentityPatchResponse {
// GetAction returns the Action field value if set, zero value otherwise.
func (o *IdentityPatchResponse) GetAction() string {
if o == nil || o.Action == nil {
if o == nil || IsNil(o.Action) {
var ret string
return ret
}
@ -55,7 +61,7 @@ func (o *IdentityPatchResponse) GetAction() string {
// GetActionOk returns a tuple with the Action field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityPatchResponse) GetActionOk() (*string, bool) {
if o == nil || o.Action == nil {
if o == nil || IsNil(o.Action) {
return nil, false
}
return o.Action, true
@ -63,7 +69,7 @@ func (o *IdentityPatchResponse) GetActionOk() (*string, bool) {
// HasAction returns a boolean if a field has been set.
func (o *IdentityPatchResponse) HasAction() bool {
if o != nil && o.Action != nil {
if o != nil && !IsNil(o.Action) {
return true
}
@ -88,7 +94,7 @@ func (o *IdentityPatchResponse) GetError() interface{} {
// 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 *IdentityPatchResponse) GetErrorOk() (*interface{}, bool) {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
return nil, false
}
return &o.Error, true
@ -96,7 +102,7 @@ func (o *IdentityPatchResponse) GetErrorOk() (*interface{}, bool) {
// HasError returns a boolean if a field has been set.
func (o *IdentityPatchResponse) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -110,7 +116,7 @@ func (o *IdentityPatchResponse) SetError(v interface{}) {
// GetIdentity returns the Identity field value if set, zero value otherwise.
func (o *IdentityPatchResponse) GetIdentity() string {
if o == nil || o.Identity == nil {
if o == nil || IsNil(o.Identity) {
var ret string
return ret
}
@ -120,7 +126,7 @@ func (o *IdentityPatchResponse) GetIdentity() string {
// GetIdentityOk returns a tuple with the Identity field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityPatchResponse) GetIdentityOk() (*string, bool) {
if o == nil || o.Identity == nil {
if o == nil || IsNil(o.Identity) {
return nil, false
}
return o.Identity, true
@ -128,7 +134,7 @@ func (o *IdentityPatchResponse) GetIdentityOk() (*string, bool) {
// HasIdentity returns a boolean if a field has been set.
func (o *IdentityPatchResponse) HasIdentity() bool {
if o != nil && o.Identity != nil {
if o != nil && !IsNil(o.Identity) {
return true
}
@ -142,7 +148,7 @@ func (o *IdentityPatchResponse) SetIdentity(v string) {
// GetPatchId returns the PatchId field value if set, zero value otherwise.
func (o *IdentityPatchResponse) GetPatchId() string {
if o == nil || o.PatchId == nil {
if o == nil || IsNil(o.PatchId) {
var ret string
return ret
}
@ -152,7 +158,7 @@ func (o *IdentityPatchResponse) GetPatchId() string {
// GetPatchIdOk returns a tuple with the PatchId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityPatchResponse) GetPatchIdOk() (*string, bool) {
if o == nil || o.PatchId == nil {
if o == nil || IsNil(o.PatchId) {
return nil, false
}
return o.PatchId, true
@ -160,7 +166,7 @@ func (o *IdentityPatchResponse) GetPatchIdOk() (*string, bool) {
// HasPatchId returns a boolean if a field has been set.
func (o *IdentityPatchResponse) HasPatchId() bool {
if o != nil && o.PatchId != nil {
if o != nil && !IsNil(o.PatchId) {
return true
}
@ -173,20 +179,57 @@ func (o *IdentityPatchResponse) SetPatchId(v string) {
}
func (o IdentityPatchResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityPatchResponse) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Action != nil {
if !IsNil(o.Action) {
toSerialize["action"] = o.Action
}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if o.Identity != nil {
if !IsNil(o.Identity) {
toSerialize["identity"] = o.Identity
}
if o.PatchId != nil {
if !IsNil(o.PatchId) {
toSerialize["patch_id"] = o.PatchId
}
return json.Marshal(toSerialize)
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityPatchResponse) UnmarshalJSON(data []byte) (err error) {
varIdentityPatchResponse := _IdentityPatchResponse{}
err = json.Unmarshal(data, &varIdentityPatchResponse)
if err != nil {
return err
}
*o = IdentityPatchResponse(varIdentityPatchResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "action")
delete(additionalProperties, "error")
delete(additionalProperties, "identity")
delete(additionalProperties, "patch_id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityPatchResponse struct {

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,14 +15,20 @@ import (
"encoding/json"
)
// checks if the IdentitySchemaContainer type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentitySchemaContainer{}
// IdentitySchemaContainer An Identity JSON Schema Container
type IdentitySchemaContainer struct {
// The ID of the Identity JSON Schema
Id *string `json:"id,omitempty"`
// The actual Identity JSON Schema
Schema map[string]interface{} `json:"schema,omitempty"`
Schema map[string]interface{} `json:"schema,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentitySchemaContainer IdentitySchemaContainer
// NewIdentitySchemaContainer instantiates a new IdentitySchemaContainer object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -42,7 +48,7 @@ func NewIdentitySchemaContainerWithDefaults() *IdentitySchemaContainer {
// GetId returns the Id field value if set, zero value otherwise.
func (o *IdentitySchemaContainer) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@ -52,7 +58,7 @@ func (o *IdentitySchemaContainer) GetId() string {
// 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 *IdentitySchemaContainer) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@ -60,7 +66,7 @@ func (o *IdentitySchemaContainer) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *IdentitySchemaContainer) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@ -74,7 +80,7 @@ func (o *IdentitySchemaContainer) SetId(v string) {
// GetSchema returns the Schema field value if set, zero value otherwise.
func (o *IdentitySchemaContainer) GetSchema() map[string]interface{} {
if o == nil || o.Schema == nil {
if o == nil || IsNil(o.Schema) {
var ret map[string]interface{}
return ret
}
@ -84,15 +90,15 @@ func (o *IdentitySchemaContainer) GetSchema() map[string]interface{} {
// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentitySchemaContainer) GetSchemaOk() (map[string]interface{}, bool) {
if o == nil || o.Schema == nil {
return nil, false
if o == nil || IsNil(o.Schema) {
return map[string]interface{}{}, false
}
return o.Schema, true
}
// HasSchema returns a boolean if a field has been set.
func (o *IdentitySchemaContainer) HasSchema() bool {
if o != nil && o.Schema != nil {
if o != nil && !IsNil(o.Schema) {
return true
}
@ -105,16 +111,51 @@ func (o *IdentitySchemaContainer) SetSchema(v map[string]interface{}) {
}
func (o IdentitySchemaContainer) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Schema != nil {
toSerialize["schema"] = o.Schema
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentitySchemaContainer) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Schema) {
toSerialize["schema"] = o.Schema
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentitySchemaContainer) UnmarshalJSON(data []byte) (err error) {
varIdentitySchemaContainer := _IdentitySchemaContainer{}
err = json.Unmarshal(data, &varIdentitySchemaContainer)
if err != nil {
return err
}
*o = IdentitySchemaContainer(varIdentitySchemaContainer)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "schema")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentitySchemaContainer struct {
value *IdentitySchemaContainer
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the IdentityWithCredentials type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityWithCredentials{}
// IdentityWithCredentials Create Identity and Import Credentials
type IdentityWithCredentials struct {
Oidc *IdentityWithCredentialsOidc `json:"oidc,omitempty"`
Password *IdentityWithCredentialsPassword `json:"password,omitempty"`
Oidc *IdentityWithCredentialsOidc `json:"oidc,omitempty"`
Password *IdentityWithCredentialsPassword `json:"password,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityWithCredentials IdentityWithCredentials
// NewIdentityWithCredentials instantiates a new IdentityWithCredentials object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewIdentityWithCredentialsWithDefaults() *IdentityWithCredentials {
// GetOidc returns the Oidc field value if set, zero value otherwise.
func (o *IdentityWithCredentials) GetOidc() IdentityWithCredentialsOidc {
if o == nil || o.Oidc == nil {
if o == nil || IsNil(o.Oidc) {
var ret IdentityWithCredentialsOidc
return ret
}
@ -50,7 +56,7 @@ func (o *IdentityWithCredentials) GetOidc() IdentityWithCredentialsOidc {
// GetOidcOk returns a tuple with the Oidc field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentials) GetOidcOk() (*IdentityWithCredentialsOidc, bool) {
if o == nil || o.Oidc == nil {
if o == nil || IsNil(o.Oidc) {
return nil, false
}
return o.Oidc, true
@ -58,7 +64,7 @@ func (o *IdentityWithCredentials) GetOidcOk() (*IdentityWithCredentialsOidc, boo
// HasOidc returns a boolean if a field has been set.
func (o *IdentityWithCredentials) HasOidc() bool {
if o != nil && o.Oidc != nil {
if o != nil && !IsNil(o.Oidc) {
return true
}
@ -72,7 +78,7 @@ func (o *IdentityWithCredentials) SetOidc(v IdentityWithCredentialsOidc) {
// GetPassword returns the Password field value if set, zero value otherwise.
func (o *IdentityWithCredentials) GetPassword() IdentityWithCredentialsPassword {
if o == nil || o.Password == nil {
if o == nil || IsNil(o.Password) {
var ret IdentityWithCredentialsPassword
return ret
}
@ -82,7 +88,7 @@ func (o *IdentityWithCredentials) GetPassword() IdentityWithCredentialsPassword
// 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 *IdentityWithCredentials) GetPasswordOk() (*IdentityWithCredentialsPassword, bool) {
if o == nil || o.Password == nil {
if o == nil || IsNil(o.Password) {
return nil, false
}
return o.Password, true
@ -90,7 +96,7 @@ func (o *IdentityWithCredentials) GetPasswordOk() (*IdentityWithCredentialsPassw
// HasPassword returns a boolean if a field has been set.
func (o *IdentityWithCredentials) HasPassword() bool {
if o != nil && o.Password != nil {
if o != nil && !IsNil(o.Password) {
return true
}
@ -103,16 +109,51 @@ func (o *IdentityWithCredentials) SetPassword(v IdentityWithCredentialsPassword)
}
func (o IdentityWithCredentials) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Oidc != nil {
toSerialize["oidc"] = o.Oidc
}
if o.Password != nil {
toSerialize["password"] = o.Password
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityWithCredentials) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Oidc) {
toSerialize["oidc"] = o.Oidc
}
if !IsNil(o.Password) {
toSerialize["password"] = o.Password
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityWithCredentials) UnmarshalJSON(data []byte) (err error) {
varIdentityWithCredentials := _IdentityWithCredentials{}
err = json.Unmarshal(data, &varIdentityWithCredentials)
if err != nil {
return err
}
*o = IdentityWithCredentials(varIdentityWithCredentials)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "oidc")
delete(additionalProperties, "password")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityWithCredentials struct {
value *IdentityWithCredentials
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,11 +15,17 @@ import (
"encoding/json"
)
// checks if the IdentityWithCredentialsOidc type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityWithCredentialsOidc{}
// IdentityWithCredentialsOidc Create Identity and Import Social Sign In Credentials
type IdentityWithCredentialsOidc struct {
Config *IdentityWithCredentialsOidcConfig `json:"config,omitempty"`
Config *IdentityWithCredentialsOidcConfig `json:"config,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityWithCredentialsOidc IdentityWithCredentialsOidc
// NewIdentityWithCredentialsOidc instantiates a new IdentityWithCredentialsOidc object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -39,7 +45,7 @@ func NewIdentityWithCredentialsOidcWithDefaults() *IdentityWithCredentialsOidc {
// GetConfig returns the Config field value if set, zero value otherwise.
func (o *IdentityWithCredentialsOidc) GetConfig() IdentityWithCredentialsOidcConfig {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
var ret IdentityWithCredentialsOidcConfig
return ret
}
@ -49,7 +55,7 @@ func (o *IdentityWithCredentialsOidc) GetConfig() IdentityWithCredentialsOidcCon
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsOidc) GetConfigOk() (*IdentityWithCredentialsOidcConfig, bool) {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
return nil, false
}
return o.Config, true
@ -57,7 +63,7 @@ func (o *IdentityWithCredentialsOidc) GetConfigOk() (*IdentityWithCredentialsOid
// HasConfig returns a boolean if a field has been set.
func (o *IdentityWithCredentialsOidc) HasConfig() bool {
if o != nil && o.Config != nil {
if o != nil && !IsNil(o.Config) {
return true
}
@ -70,13 +76,47 @@ func (o *IdentityWithCredentialsOidc) SetConfig(v IdentityWithCredentialsOidcCon
}
func (o IdentityWithCredentialsOidc) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Config != nil {
toSerialize["config"] = o.Config
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityWithCredentialsOidc) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Config) {
toSerialize["config"] = o.Config
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityWithCredentialsOidc) UnmarshalJSON(data []byte) (err error) {
varIdentityWithCredentialsOidc := _IdentityWithCredentialsOidc{}
err = json.Unmarshal(data, &varIdentityWithCredentialsOidc)
if err != nil {
return err
}
*o = IdentityWithCredentialsOidc(varIdentityWithCredentialsOidc)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "config")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityWithCredentialsOidc struct {
value *IdentityWithCredentialsOidc
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,13 +15,19 @@ import (
"encoding/json"
)
// checks if the IdentityWithCredentialsOidcConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityWithCredentialsOidcConfig{}
// IdentityWithCredentialsOidcConfig struct for IdentityWithCredentialsOidcConfig
type IdentityWithCredentialsOidcConfig struct {
Config *IdentityWithCredentialsPasswordConfig `json:"config,omitempty"`
// A list of OpenID Connect Providers
Providers []IdentityWithCredentialsOidcConfigProvider `json:"providers,omitempty"`
Providers []IdentityWithCredentialsOidcConfigProvider `json:"providers,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityWithCredentialsOidcConfig IdentityWithCredentialsOidcConfig
// NewIdentityWithCredentialsOidcConfig instantiates a new IdentityWithCredentialsOidcConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -41,7 +47,7 @@ func NewIdentityWithCredentialsOidcConfigWithDefaults() *IdentityWithCredentials
// GetConfig returns the Config field value if set, zero value otherwise.
func (o *IdentityWithCredentialsOidcConfig) GetConfig() IdentityWithCredentialsPasswordConfig {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
var ret IdentityWithCredentialsPasswordConfig
return ret
}
@ -51,7 +57,7 @@ func (o *IdentityWithCredentialsOidcConfig) GetConfig() IdentityWithCredentialsP
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsOidcConfig) GetConfigOk() (*IdentityWithCredentialsPasswordConfig, bool) {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
return nil, false
}
return o.Config, true
@ -59,7 +65,7 @@ func (o *IdentityWithCredentialsOidcConfig) GetConfigOk() (*IdentityWithCredenti
// HasConfig returns a boolean if a field has been set.
func (o *IdentityWithCredentialsOidcConfig) HasConfig() bool {
if o != nil && o.Config != nil {
if o != nil && !IsNil(o.Config) {
return true
}
@ -73,7 +79,7 @@ func (o *IdentityWithCredentialsOidcConfig) SetConfig(v IdentityWithCredentialsP
// GetProviders returns the Providers field value if set, zero value otherwise.
func (o *IdentityWithCredentialsOidcConfig) GetProviders() []IdentityWithCredentialsOidcConfigProvider {
if o == nil || o.Providers == nil {
if o == nil || IsNil(o.Providers) {
var ret []IdentityWithCredentialsOidcConfigProvider
return ret
}
@ -83,7 +89,7 @@ func (o *IdentityWithCredentialsOidcConfig) GetProviders() []IdentityWithCredent
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsOidcConfig) GetProvidersOk() ([]IdentityWithCredentialsOidcConfigProvider, bool) {
if o == nil || o.Providers == nil {
if o == nil || IsNil(o.Providers) {
return nil, false
}
return o.Providers, true
@ -91,7 +97,7 @@ func (o *IdentityWithCredentialsOidcConfig) GetProvidersOk() ([]IdentityWithCred
// HasProviders returns a boolean if a field has been set.
func (o *IdentityWithCredentialsOidcConfig) HasProviders() bool {
if o != nil && o.Providers != nil {
if o != nil && !IsNil(o.Providers) {
return true
}
@ -104,16 +110,51 @@ func (o *IdentityWithCredentialsOidcConfig) SetProviders(v []IdentityWithCredent
}
func (o IdentityWithCredentialsOidcConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Config != nil {
toSerialize["config"] = o.Config
}
if o.Providers != nil {
toSerialize["providers"] = o.Providers
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityWithCredentialsOidcConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Config) {
toSerialize["config"] = o.Config
}
if !IsNil(o.Providers) {
toSerialize["providers"] = o.Providers
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityWithCredentialsOidcConfig) UnmarshalJSON(data []byte) (err error) {
varIdentityWithCredentialsOidcConfig := _IdentityWithCredentialsOidcConfig{}
err = json.Unmarshal(data, &varIdentityWithCredentialsOidcConfig)
if err != nil {
return err
}
*o = IdentityWithCredentialsOidcConfig(varIdentityWithCredentialsOidcConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "config")
delete(additionalProperties, "providers")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityWithCredentialsOidcConfig struct {
value *IdentityWithCredentialsOidcConfig
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,8 +13,12 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the IdentityWithCredentialsOidcConfigProvider type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityWithCredentialsOidcConfigProvider{}
// IdentityWithCredentialsOidcConfigProvider Create Identity and Import Social Sign In Credentials Configuration
type IdentityWithCredentialsOidcConfigProvider struct {
// The OpenID Connect provider to link the subject to. Usually something like `google` or `github`.
@ -22,9 +26,12 @@ type IdentityWithCredentialsOidcConfigProvider struct {
// The subject (`sub`) of the OpenID Connect connection. Usually the `sub` field of the ID Token.
Subject string `json:"subject"`
// If set, this credential allows the user to sign in using the OpenID Connect provider without setting the subject first.
UseAutoLink *bool `json:"use_auto_link,omitempty"`
UseAutoLink *bool `json:"use_auto_link,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityWithCredentialsOidcConfigProvider IdentityWithCredentialsOidcConfigProvider
// NewIdentityWithCredentialsOidcConfigProvider instantiates a new IdentityWithCredentialsOidcConfigProvider object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -94,7 +101,7 @@ func (o *IdentityWithCredentialsOidcConfigProvider) SetSubject(v string) {
// GetUseAutoLink returns the UseAutoLink field value if set, zero value otherwise.
func (o *IdentityWithCredentialsOidcConfigProvider) GetUseAutoLink() bool {
if o == nil || o.UseAutoLink == nil {
if o == nil || IsNil(o.UseAutoLink) {
var ret bool
return ret
}
@ -104,7 +111,7 @@ func (o *IdentityWithCredentialsOidcConfigProvider) GetUseAutoLink() bool {
// GetUseAutoLinkOk returns a tuple with the UseAutoLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsOidcConfigProvider) GetUseAutoLinkOk() (*bool, bool) {
if o == nil || o.UseAutoLink == nil {
if o == nil || IsNil(o.UseAutoLink) {
return nil, false
}
return o.UseAutoLink, true
@ -112,7 +119,7 @@ func (o *IdentityWithCredentialsOidcConfigProvider) GetUseAutoLinkOk() (*bool, b
// HasUseAutoLink returns a boolean if a field has been set.
func (o *IdentityWithCredentialsOidcConfigProvider) HasUseAutoLink() bool {
if o != nil && o.UseAutoLink != nil {
if o != nil && !IsNil(o.UseAutoLink) {
return true
}
@ -125,19 +132,73 @@ func (o *IdentityWithCredentialsOidcConfigProvider) SetUseAutoLink(v bool) {
}
func (o IdentityWithCredentialsOidcConfigProvider) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["provider"] = o.Provider
}
if true {
toSerialize["subject"] = o.Subject
}
if o.UseAutoLink != nil {
toSerialize["use_auto_link"] = o.UseAutoLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityWithCredentialsOidcConfigProvider) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["provider"] = o.Provider
toSerialize["subject"] = o.Subject
if !IsNil(o.UseAutoLink) {
toSerialize["use_auto_link"] = o.UseAutoLink
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityWithCredentialsOidcConfigProvider) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"provider",
"subject",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIdentityWithCredentialsOidcConfigProvider := _IdentityWithCredentialsOidcConfigProvider{}
err = json.Unmarshal(data, &varIdentityWithCredentialsOidcConfigProvider)
if err != nil {
return err
}
*o = IdentityWithCredentialsOidcConfigProvider(varIdentityWithCredentialsOidcConfigProvider)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "provider")
delete(additionalProperties, "subject")
delete(additionalProperties, "use_auto_link")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityWithCredentialsOidcConfigProvider struct {
value *IdentityWithCredentialsOidcConfigProvider
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,11 +15,17 @@ import (
"encoding/json"
)
// checks if the IdentityWithCredentialsPassword type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityWithCredentialsPassword{}
// IdentityWithCredentialsPassword Create Identity and Import Password Credentials
type IdentityWithCredentialsPassword struct {
Config *IdentityWithCredentialsPasswordConfig `json:"config,omitempty"`
Config *IdentityWithCredentialsPasswordConfig `json:"config,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityWithCredentialsPassword IdentityWithCredentialsPassword
// NewIdentityWithCredentialsPassword instantiates a new IdentityWithCredentialsPassword object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -39,7 +45,7 @@ func NewIdentityWithCredentialsPasswordWithDefaults() *IdentityWithCredentialsPa
// GetConfig returns the Config field value if set, zero value otherwise.
func (o *IdentityWithCredentialsPassword) GetConfig() IdentityWithCredentialsPasswordConfig {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
var ret IdentityWithCredentialsPasswordConfig
return ret
}
@ -49,7 +55,7 @@ func (o *IdentityWithCredentialsPassword) GetConfig() IdentityWithCredentialsPas
// GetConfigOk returns a tuple with the Config field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsPassword) GetConfigOk() (*IdentityWithCredentialsPasswordConfig, bool) {
if o == nil || o.Config == nil {
if o == nil || IsNil(o.Config) {
return nil, false
}
return o.Config, true
@ -57,7 +63,7 @@ func (o *IdentityWithCredentialsPassword) GetConfigOk() (*IdentityWithCredential
// HasConfig returns a boolean if a field has been set.
func (o *IdentityWithCredentialsPassword) HasConfig() bool {
if o != nil && o.Config != nil {
if o != nil && !IsNil(o.Config) {
return true
}
@ -70,13 +76,47 @@ func (o *IdentityWithCredentialsPassword) SetConfig(v IdentityWithCredentialsPas
}
func (o IdentityWithCredentialsPassword) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Config != nil {
toSerialize["config"] = o.Config
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityWithCredentialsPassword) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Config) {
toSerialize["config"] = o.Config
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityWithCredentialsPassword) UnmarshalJSON(data []byte) (err error) {
varIdentityWithCredentialsPassword := _IdentityWithCredentialsPassword{}
err = json.Unmarshal(data, &varIdentityWithCredentialsPassword)
if err != nil {
return err
}
*o = IdentityWithCredentialsPassword(varIdentityWithCredentialsPassword)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "config")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityWithCredentialsPassword struct {
value *IdentityWithCredentialsPassword
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,6 +15,9 @@ import (
"encoding/json"
)
// checks if the IdentityWithCredentialsPasswordConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentityWithCredentialsPasswordConfig{}
// IdentityWithCredentialsPasswordConfig Create Identity and Import Password Credentials Configuration
type IdentityWithCredentialsPasswordConfig struct {
// The hashed password in [PHC format](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#hashed-passwords)
@ -23,8 +26,11 @@ type IdentityWithCredentialsPasswordConfig struct {
Password *string `json:"password,omitempty"`
// If set to true, the password will be migrated using the password migration hook.
UsePasswordMigrationHook *bool `json:"use_password_migration_hook,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IdentityWithCredentialsPasswordConfig IdentityWithCredentialsPasswordConfig
// NewIdentityWithCredentialsPasswordConfig instantiates a new IdentityWithCredentialsPasswordConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -44,7 +50,7 @@ func NewIdentityWithCredentialsPasswordConfigWithDefaults() *IdentityWithCredent
// GetHashedPassword returns the HashedPassword field value if set, zero value otherwise.
func (o *IdentityWithCredentialsPasswordConfig) GetHashedPassword() string {
if o == nil || o.HashedPassword == nil {
if o == nil || IsNil(o.HashedPassword) {
var ret string
return ret
}
@ -54,7 +60,7 @@ func (o *IdentityWithCredentialsPasswordConfig) GetHashedPassword() string {
// GetHashedPasswordOk returns a tuple with the HashedPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsPasswordConfig) GetHashedPasswordOk() (*string, bool) {
if o == nil || o.HashedPassword == nil {
if o == nil || IsNil(o.HashedPassword) {
return nil, false
}
return o.HashedPassword, true
@ -62,7 +68,7 @@ func (o *IdentityWithCredentialsPasswordConfig) GetHashedPasswordOk() (*string,
// HasHashedPassword returns a boolean if a field has been set.
func (o *IdentityWithCredentialsPasswordConfig) HasHashedPassword() bool {
if o != nil && o.HashedPassword != nil {
if o != nil && !IsNil(o.HashedPassword) {
return true
}
@ -76,7 +82,7 @@ func (o *IdentityWithCredentialsPasswordConfig) SetHashedPassword(v string) {
// GetPassword returns the Password field value if set, zero value otherwise.
func (o *IdentityWithCredentialsPasswordConfig) GetPassword() string {
if o == nil || o.Password == nil {
if o == nil || IsNil(o.Password) {
var ret string
return ret
}
@ -86,7 +92,7 @@ func (o *IdentityWithCredentialsPasswordConfig) GetPassword() string {
// 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 *IdentityWithCredentialsPasswordConfig) GetPasswordOk() (*string, bool) {
if o == nil || o.Password == nil {
if o == nil || IsNil(o.Password) {
return nil, false
}
return o.Password, true
@ -94,7 +100,7 @@ func (o *IdentityWithCredentialsPasswordConfig) GetPasswordOk() (*string, bool)
// HasPassword returns a boolean if a field has been set.
func (o *IdentityWithCredentialsPasswordConfig) HasPassword() bool {
if o != nil && o.Password != nil {
if o != nil && !IsNil(o.Password) {
return true
}
@ -108,7 +114,7 @@ func (o *IdentityWithCredentialsPasswordConfig) SetPassword(v string) {
// GetUsePasswordMigrationHook returns the UsePasswordMigrationHook field value if set, zero value otherwise.
func (o *IdentityWithCredentialsPasswordConfig) GetUsePasswordMigrationHook() bool {
if o == nil || o.UsePasswordMigrationHook == nil {
if o == nil || IsNil(o.UsePasswordMigrationHook) {
var ret bool
return ret
}
@ -118,7 +124,7 @@ func (o *IdentityWithCredentialsPasswordConfig) GetUsePasswordMigrationHook() bo
// GetUsePasswordMigrationHookOk returns a tuple with the UsePasswordMigrationHook field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentityWithCredentialsPasswordConfig) GetUsePasswordMigrationHookOk() (*bool, bool) {
if o == nil || o.UsePasswordMigrationHook == nil {
if o == nil || IsNil(o.UsePasswordMigrationHook) {
return nil, false
}
return o.UsePasswordMigrationHook, true
@ -126,7 +132,7 @@ func (o *IdentityWithCredentialsPasswordConfig) GetUsePasswordMigrationHookOk()
// HasUsePasswordMigrationHook returns a boolean if a field has been set.
func (o *IdentityWithCredentialsPasswordConfig) HasUsePasswordMigrationHook() bool {
if o != nil && o.UsePasswordMigrationHook != nil {
if o != nil && !IsNil(o.UsePasswordMigrationHook) {
return true
}
@ -139,19 +145,55 @@ func (o *IdentityWithCredentialsPasswordConfig) SetUsePasswordMigrationHook(v bo
}
func (o IdentityWithCredentialsPasswordConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.HashedPassword != nil {
toSerialize["hashed_password"] = o.HashedPassword
}
if o.Password != nil {
toSerialize["password"] = o.Password
}
if o.UsePasswordMigrationHook != nil {
toSerialize["use_password_migration_hook"] = o.UsePasswordMigrationHook
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentityWithCredentialsPasswordConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.HashedPassword) {
toSerialize["hashed_password"] = o.HashedPassword
}
if !IsNil(o.Password) {
toSerialize["password"] = o.Password
}
if !IsNil(o.UsePasswordMigrationHook) {
toSerialize["use_password_migration_hook"] = o.UsePasswordMigrationHook
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IdentityWithCredentialsPasswordConfig) UnmarshalJSON(data []byte) (err error) {
varIdentityWithCredentialsPasswordConfig := _IdentityWithCredentialsPasswordConfig{}
err = json.Unmarshal(data, &varIdentityWithCredentialsPasswordConfig)
if err != nil {
return err
}
*o = IdentityWithCredentialsPasswordConfig(varIdentityWithCredentialsPasswordConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "hashed_password")
delete(additionalProperties, "password")
delete(additionalProperties, "use_password_migration_hook")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentityWithCredentialsPasswordConfig struct {
value *IdentityWithCredentialsPasswordConfig
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,14 +13,21 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the IsAlive200Response type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IsAlive200Response{}
// IsAlive200Response struct for IsAlive200Response
type IsAlive200Response struct {
// Always \"ok\".
Status string `json:"status"`
Status string `json:"status"`
AdditionalProperties map[string]interface{}
}
type _IsAlive200Response IsAlive200Response
// NewIsAlive200Response instantiates a new IsAlive200Response object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -64,13 +71,66 @@ func (o *IsAlive200Response) SetStatus(v string) {
}
func (o IsAlive200Response) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["status"] = o.Status
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IsAlive200Response) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["status"] = o.Status
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IsAlive200Response) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"status",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIsAlive200Response := _IsAlive200Response{}
err = json.Unmarshal(data, &varIsAlive200Response)
if err != nil {
return err
}
*o = IsAlive200Response(varIsAlive200Response)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIsAlive200Response struct {
value *IsAlive200Response
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,14 +13,21 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the IsReady503Response type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IsReady503Response{}
// IsReady503Response struct for IsReady503Response
type IsReady503Response struct {
// Errors contains a list of errors that caused the not ready status.
Errors map[string]string `json:"errors"`
Errors map[string]string `json:"errors"`
AdditionalProperties map[string]interface{}
}
type _IsReady503Response IsReady503Response
// NewIsReady503Response instantiates a new IsReady503Response object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -64,13 +71,66 @@ func (o *IsReady503Response) SetErrors(v map[string]string) {
}
func (o IsReady503Response) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["errors"] = o.Errors
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IsReady503Response) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["errors"] = o.Errors
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IsReady503Response) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"errors",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIsReady503Response := _IsReady503Response{}
err = json.Unmarshal(data, &varIsReady503Response)
if err != nil {
return err
}
*o = IsReady503Response(varIsReady503Response)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "errors")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIsReady503Response struct {
value *IsReady503Response
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,8 +13,12 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the JsonPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &JsonPatch{}
// JsonPatch A JSONPatch document as defined by RFC 6902
type JsonPatch struct {
// This field is used together with operation \"move\" and uses JSON Pointer notation. Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5).
@ -24,9 +28,12 @@ type JsonPatch struct {
// The path to the target path. Uses JSON pointer notation. Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5).
Path string `json:"path"`
// The value to be used within the operations. Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5).
Value interface{} `json:"value,omitempty"`
Value interface{} `json:"value,omitempty"`
AdditionalProperties map[string]interface{}
}
type _JsonPatch JsonPatch
// NewJsonPatch instantiates a new JsonPatch object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -48,7 +55,7 @@ func NewJsonPatchWithDefaults() *JsonPatch {
// GetFrom returns the From field value if set, zero value otherwise.
func (o *JsonPatch) GetFrom() string {
if o == nil || o.From == nil {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
@ -58,7 +65,7 @@ func (o *JsonPatch) GetFrom() string {
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JsonPatch) GetFromOk() (*string, bool) {
if o == nil || o.From == nil {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
@ -66,7 +73,7 @@ func (o *JsonPatch) GetFromOk() (*string, bool) {
// HasFrom returns a boolean if a field has been set.
func (o *JsonPatch) HasFrom() bool {
if o != nil && o.From != nil {
if o != nil && !IsNil(o.From) {
return true
}
@ -139,7 +146,7 @@ func (o *JsonPatch) GetValue() interface{} {
// 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 *JsonPatch) GetValueOk() (*interface{}, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return &o.Value, true
@ -147,7 +154,7 @@ func (o *JsonPatch) GetValueOk() (*interface{}, bool) {
// HasValue returns a boolean if a field has been set.
func (o *JsonPatch) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@ -160,20 +167,75 @@ func (o *JsonPatch) SetValue(v interface{}) {
}
func (o JsonPatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o JsonPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.From != nil {
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if true {
toSerialize["op"] = o.Op
}
if true {
toSerialize["path"] = o.Path
}
toSerialize["op"] = o.Op
toSerialize["path"] = o.Path
if o.Value != nil {
toSerialize["value"] = o.Value
}
return json.Marshal(toSerialize)
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *JsonPatch) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"op",
"path",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varJsonPatch := _JsonPatch{}
err = json.Unmarshal(data, &varJsonPatch)
if err != nil {
return err
}
*o = JsonPatch(varJsonPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "from")
delete(additionalProperties, "op")
delete(additionalProperties, "path")
delete(additionalProperties, "value")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableJsonPatch struct {

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the LoginFlow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LoginFlow{}
// LoginFlow This object represents a login flow. A login flow is initiated at the \"Initiate Login API / Browser Flow\" endpoint by a client. Once a login flow is completed successfully, a session cookie or session token will be issued.
type LoginFlow struct {
// The active login method If set contains the login method used. If the flow is new, it is unset. password CredentialsTypePassword oidc CredentialsTypeOIDC totp CredentialsTypeTOTP lookup_secret CredentialsTypeLookup webauthn CredentialsTypeWebAuthn code CredentialsTypeCodeAuth passkey CredentialsTypePasskey profile CredentialsTypeProfile saml CredentialsTypeSAML link_recovery CredentialsTypeRecoveryLink CredentialsTypeRecoveryLink is a special credential type linked to the link strategy (recovery flow). It is not used within the credentials object itself. code_recovery CredentialsTypeRecoveryCode
@ -49,9 +53,12 @@ type LoginFlow struct {
Type string `json:"type"`
Ui UiContainer `json:"ui"`
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LoginFlow LoginFlow
// NewLoginFlow instantiates a new LoginFlow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -78,7 +85,7 @@ func NewLoginFlowWithDefaults() *LoginFlow {
// GetActive returns the Active field value if set, zero value otherwise.
func (o *LoginFlow) GetActive() string {
if o == nil || o.Active == nil {
if o == nil || IsNil(o.Active) {
var ret string
return ret
}
@ -88,7 +95,7 @@ func (o *LoginFlow) GetActive() string {
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetActiveOk() (*string, bool) {
if o == nil || o.Active == nil {
if o == nil || IsNil(o.Active) {
return nil, false
}
return o.Active, true
@ -96,7 +103,7 @@ func (o *LoginFlow) GetActiveOk() (*string, bool) {
// HasActive returns a boolean if a field has been set.
func (o *LoginFlow) HasActive() bool {
if o != nil && o.Active != nil {
if o != nil && !IsNil(o.Active) {
return true
}
@ -110,7 +117,7 @@ func (o *LoginFlow) SetActive(v string) {
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *LoginFlow) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
@ -120,7 +127,7 @@ func (o *LoginFlow) GetCreatedAt() time.Time {
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
@ -128,7 +135,7 @@ func (o *LoginFlow) GetCreatedAtOk() (*time.Time, bool) {
// HasCreatedAt returns a boolean if a field has been set.
func (o *LoginFlow) HasCreatedAt() bool {
if o != nil && o.CreatedAt != nil {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
@ -214,7 +221,7 @@ func (o *LoginFlow) SetIssuedAt(v time.Time) {
// GetOauth2LoginChallenge returns the Oauth2LoginChallenge field value if set, zero value otherwise.
func (o *LoginFlow) GetOauth2LoginChallenge() string {
if o == nil || o.Oauth2LoginChallenge == nil {
if o == nil || IsNil(o.Oauth2LoginChallenge) {
var ret string
return ret
}
@ -224,7 +231,7 @@ func (o *LoginFlow) GetOauth2LoginChallenge() string {
// GetOauth2LoginChallengeOk returns a tuple with the Oauth2LoginChallenge field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetOauth2LoginChallengeOk() (*string, bool) {
if o == nil || o.Oauth2LoginChallenge == nil {
if o == nil || IsNil(o.Oauth2LoginChallenge) {
return nil, false
}
return o.Oauth2LoginChallenge, true
@ -232,7 +239,7 @@ func (o *LoginFlow) GetOauth2LoginChallengeOk() (*string, bool) {
// HasOauth2LoginChallenge returns a boolean if a field has been set.
func (o *LoginFlow) HasOauth2LoginChallenge() bool {
if o != nil && o.Oauth2LoginChallenge != nil {
if o != nil && !IsNil(o.Oauth2LoginChallenge) {
return true
}
@ -246,7 +253,7 @@ func (o *LoginFlow) SetOauth2LoginChallenge(v string) {
// GetOauth2LoginRequest returns the Oauth2LoginRequest field value if set, zero value otherwise.
func (o *LoginFlow) GetOauth2LoginRequest() OAuth2LoginRequest {
if o == nil || o.Oauth2LoginRequest == nil {
if o == nil || IsNil(o.Oauth2LoginRequest) {
var ret OAuth2LoginRequest
return ret
}
@ -256,7 +263,7 @@ func (o *LoginFlow) GetOauth2LoginRequest() OAuth2LoginRequest {
// GetOauth2LoginRequestOk returns a tuple with the Oauth2LoginRequest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetOauth2LoginRequestOk() (*OAuth2LoginRequest, bool) {
if o == nil || o.Oauth2LoginRequest == nil {
if o == nil || IsNil(o.Oauth2LoginRequest) {
return nil, false
}
return o.Oauth2LoginRequest, true
@ -264,7 +271,7 @@ func (o *LoginFlow) GetOauth2LoginRequestOk() (*OAuth2LoginRequest, bool) {
// HasOauth2LoginRequest returns a boolean if a field has been set.
func (o *LoginFlow) HasOauth2LoginRequest() bool {
if o != nil && o.Oauth2LoginRequest != nil {
if o != nil && !IsNil(o.Oauth2LoginRequest) {
return true
}
@ -278,7 +285,7 @@ func (o *LoginFlow) SetOauth2LoginRequest(v OAuth2LoginRequest) {
// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *LoginFlow) GetOrganizationId() string {
if o == nil || o.OrganizationId.Get() == nil {
if o == nil || IsNil(o.OrganizationId.Get()) {
var ret string
return ret
}
@ -321,7 +328,7 @@ func (o *LoginFlow) UnsetOrganizationId() {
// GetRefresh returns the Refresh field value if set, zero value otherwise.
func (o *LoginFlow) GetRefresh() bool {
if o == nil || o.Refresh == nil {
if o == nil || IsNil(o.Refresh) {
var ret bool
return ret
}
@ -331,7 +338,7 @@ func (o *LoginFlow) GetRefresh() bool {
// GetRefreshOk returns a tuple with the Refresh field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetRefreshOk() (*bool, bool) {
if o == nil || o.Refresh == nil {
if o == nil || IsNil(o.Refresh) {
return nil, false
}
return o.Refresh, true
@ -339,7 +346,7 @@ func (o *LoginFlow) GetRefreshOk() (*bool, bool) {
// HasRefresh returns a boolean if a field has been set.
func (o *LoginFlow) HasRefresh() bool {
if o != nil && o.Refresh != nil {
if o != nil && !IsNil(o.Refresh) {
return true
}
@ -377,7 +384,7 @@ func (o *LoginFlow) SetRequestUrl(v string) {
// GetRequestedAal returns the RequestedAal field value if set, zero value otherwise.
func (o *LoginFlow) GetRequestedAal() AuthenticatorAssuranceLevel {
if o == nil || o.RequestedAal == nil {
if o == nil || IsNil(o.RequestedAal) {
var ret AuthenticatorAssuranceLevel
return ret
}
@ -387,7 +394,7 @@ func (o *LoginFlow) GetRequestedAal() AuthenticatorAssuranceLevel {
// GetRequestedAalOk returns a tuple with the RequestedAal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetRequestedAalOk() (*AuthenticatorAssuranceLevel, bool) {
if o == nil || o.RequestedAal == nil {
if o == nil || IsNil(o.RequestedAal) {
return nil, false
}
return o.RequestedAal, true
@ -395,7 +402,7 @@ func (o *LoginFlow) GetRequestedAalOk() (*AuthenticatorAssuranceLevel, bool) {
// HasRequestedAal returns a boolean if a field has been set.
func (o *LoginFlow) HasRequestedAal() bool {
if o != nil && o.RequestedAal != nil {
if o != nil && !IsNil(o.RequestedAal) {
return true
}
@ -409,7 +416,7 @@ func (o *LoginFlow) SetRequestedAal(v AuthenticatorAssuranceLevel) {
// GetReturnTo returns the ReturnTo field value if set, zero value otherwise.
func (o *LoginFlow) GetReturnTo() string {
if o == nil || o.ReturnTo == nil {
if o == nil || IsNil(o.ReturnTo) {
var ret string
return ret
}
@ -419,7 +426,7 @@ func (o *LoginFlow) GetReturnTo() string {
// GetReturnToOk returns a tuple with the ReturnTo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetReturnToOk() (*string, bool) {
if o == nil || o.ReturnTo == nil {
if o == nil || IsNil(o.ReturnTo) {
return nil, false
}
return o.ReturnTo, true
@ -427,7 +434,7 @@ func (o *LoginFlow) GetReturnToOk() (*string, bool) {
// HasReturnTo returns a boolean if a field has been set.
func (o *LoginFlow) HasReturnTo() bool {
if o != nil && o.ReturnTo != nil {
if o != nil && !IsNil(o.ReturnTo) {
return true
}
@ -441,7 +448,7 @@ func (o *LoginFlow) SetReturnTo(v string) {
// GetSessionTokenExchangeCode returns the SessionTokenExchangeCode field value if set, zero value otherwise.
func (o *LoginFlow) GetSessionTokenExchangeCode() string {
if o == nil || o.SessionTokenExchangeCode == nil {
if o == nil || IsNil(o.SessionTokenExchangeCode) {
var ret string
return ret
}
@ -451,7 +458,7 @@ func (o *LoginFlow) GetSessionTokenExchangeCode() string {
// GetSessionTokenExchangeCodeOk returns a tuple with the SessionTokenExchangeCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetSessionTokenExchangeCodeOk() (*string, bool) {
if o == nil || o.SessionTokenExchangeCode == nil {
if o == nil || IsNil(o.SessionTokenExchangeCode) {
return nil, false
}
return o.SessionTokenExchangeCode, true
@ -459,7 +466,7 @@ func (o *LoginFlow) GetSessionTokenExchangeCodeOk() (*string, bool) {
// HasSessionTokenExchangeCode returns a boolean if a field has been set.
func (o *LoginFlow) HasSessionTokenExchangeCode() bool {
if o != nil && o.SessionTokenExchangeCode != nil {
if o != nil && !IsNil(o.SessionTokenExchangeCode) {
return true
}
@ -486,7 +493,7 @@ func (o *LoginFlow) GetState() interface{} {
// 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 *LoginFlow) GetStateOk() (*interface{}, bool) {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
return nil, false
}
return &o.State, true
@ -499,7 +506,7 @@ func (o *LoginFlow) SetState(v interface{}) {
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *LoginFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
if o == nil || IsNil(o.TransientPayload) {
var ret map[string]interface{}
return ret
}
@ -509,15 +516,15 @@ func (o *LoginFlow) GetTransientPayload() map[string]interface{} {
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
if o == nil || IsNil(o.TransientPayload) {
return map[string]interface{}{}, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *LoginFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
if o != nil && !IsNil(o.TransientPayload) {
return true
}
@ -579,7 +586,7 @@ func (o *LoginFlow) SetUi(v UiContainer) {
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *LoginFlow) GetUpdatedAt() time.Time {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
@ -589,7 +596,7 @@ func (o *LoginFlow) GetUpdatedAt() time.Time {
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LoginFlow) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
@ -597,7 +604,7 @@ func (o *LoginFlow) GetUpdatedAtOk() (*time.Time, bool) {
// HasUpdatedAt returns a boolean if a field has been set.
func (o *LoginFlow) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt != nil {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
@ -610,62 +617,128 @@ func (o *LoginFlow) SetUpdatedAt(v time.Time) {
}
func (o LoginFlow) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LoginFlow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Active != nil {
if !IsNil(o.Active) {
toSerialize["active"] = o.Active
}
if o.CreatedAt != nil {
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if true {
toSerialize["expires_at"] = o.ExpiresAt
}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["issued_at"] = o.IssuedAt
}
if o.Oauth2LoginChallenge != nil {
toSerialize["expires_at"] = o.ExpiresAt
toSerialize["id"] = o.Id
toSerialize["issued_at"] = o.IssuedAt
if !IsNil(o.Oauth2LoginChallenge) {
toSerialize["oauth2_login_challenge"] = o.Oauth2LoginChallenge
}
if o.Oauth2LoginRequest != nil {
if !IsNil(o.Oauth2LoginRequest) {
toSerialize["oauth2_login_request"] = o.Oauth2LoginRequest
}
if o.OrganizationId.IsSet() {
toSerialize["organization_id"] = o.OrganizationId.Get()
}
if o.Refresh != nil {
if !IsNil(o.Refresh) {
toSerialize["refresh"] = o.Refresh
}
if true {
toSerialize["request_url"] = o.RequestUrl
}
if o.RequestedAal != nil {
toSerialize["request_url"] = o.RequestUrl
if !IsNil(o.RequestedAal) {
toSerialize["requested_aal"] = o.RequestedAal
}
if o.ReturnTo != nil {
if !IsNil(o.ReturnTo) {
toSerialize["return_to"] = o.ReturnTo
}
if o.SessionTokenExchangeCode != nil {
if !IsNil(o.SessionTokenExchangeCode) {
toSerialize["session_token_exchange_code"] = o.SessionTokenExchangeCode
}
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
if !IsNil(o.TransientPayload) {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
}
if true {
toSerialize["ui"] = o.Ui
}
if o.UpdatedAt != nil {
toSerialize["type"] = o.Type
toSerialize["ui"] = o.Ui
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
return json.Marshal(toSerialize)
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LoginFlow) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"expires_at",
"id",
"issued_at",
"request_url",
"state",
"type",
"ui",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varLoginFlow := _LoginFlow{}
err = json.Unmarshal(data, &varLoginFlow)
if err != nil {
return err
}
*o = LoginFlow(varLoginFlow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "active")
delete(additionalProperties, "created_at")
delete(additionalProperties, "expires_at")
delete(additionalProperties, "id")
delete(additionalProperties, "issued_at")
delete(additionalProperties, "oauth2_login_challenge")
delete(additionalProperties, "oauth2_login_request")
delete(additionalProperties, "organization_id")
delete(additionalProperties, "refresh")
delete(additionalProperties, "request_url")
delete(additionalProperties, "requested_aal")
delete(additionalProperties, "return_to")
delete(additionalProperties, "session_token_exchange_code")
delete(additionalProperties, "state")
delete(additionalProperties, "transient_payload")
delete(additionalProperties, "type")
delete(additionalProperties, "ui")
delete(additionalProperties, "updated_at")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLoginFlow struct {

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -26,6 +26,13 @@ const (
LOGINFLOWSTATE_PASSED_CHALLENGE LoginFlowState = "passed_challenge"
)
// All allowed values of LoginFlowState enum
var AllowedLoginFlowStateEnumValues = []LoginFlowState{
"choose_method",
"sent_email",
"passed_challenge",
}
func (v *LoginFlowState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
@ -33,7 +40,7 @@ func (v *LoginFlowState) UnmarshalJSON(src []byte) error {
return err
}
enumTypeValue := LoginFlowState(value)
for _, existing := range []LoginFlowState{"choose_method", "sent_email", "passed_challenge"} {
for _, existing := range AllowedLoginFlowStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
@ -43,6 +50,27 @@ func (v *LoginFlowState) UnmarshalJSON(src []byte) error {
return fmt.Errorf("%+v is not a valid LoginFlowState", value)
}
// NewLoginFlowStateFromValue returns a pointer to a valid LoginFlowState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewLoginFlowStateFromValue(v string) (*LoginFlowState, error) {
ev := LoginFlowState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for LoginFlowState: valid values are %v", v, AllowedLoginFlowStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v LoginFlowState) IsValid() bool {
for _, existing := range AllowedLoginFlowStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to loginFlowState value
func (v LoginFlowState) Ptr() *LoginFlowState {
return &v

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,16 +13,23 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the LogoutFlow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LogoutFlow{}
// LogoutFlow Logout Flow
type LogoutFlow struct {
// LogoutToken can be used to perform logout using AJAX.
LogoutToken string `json:"logout_token"`
// LogoutURL can be opened in a browser to sign the user out. format: uri
LogoutUrl string `json:"logout_url"`
LogoutUrl string `json:"logout_url"`
AdditionalProperties map[string]interface{}
}
type _LogoutFlow LogoutFlow
// NewLogoutFlow instantiates a new LogoutFlow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -91,16 +98,69 @@ func (o *LogoutFlow) SetLogoutUrl(v string) {
}
func (o LogoutFlow) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["logout_token"] = o.LogoutToken
}
if true {
toSerialize["logout_url"] = o.LogoutUrl
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LogoutFlow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["logout_token"] = o.LogoutToken
toSerialize["logout_url"] = o.LogoutUrl
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LogoutFlow) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"logout_token",
"logout_url",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varLogoutFlow := _LogoutFlow{}
err = json.Unmarshal(data, &varLogoutFlow)
if err != nil {
return err
}
*o = LogoutFlow(varLogoutFlow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "logout_token")
delete(additionalProperties, "logout_url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLogoutFlow struct {
value *LogoutFlow
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the Message type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Message{}
// Message struct for Message
type Message struct {
Body string `json:"body"`
@ -33,9 +37,12 @@ type Message struct {
TemplateType string `json:"template_type"`
Type CourierMessageType `json:"type"`
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt time.Time `json:"updated_at"`
AdditionalProperties map[string]interface{}
}
type _Message Message
// NewMessage instantiates a new Message object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -89,7 +96,7 @@ func (o *Message) SetBody(v string) {
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *Message) GetChannel() string {
if o == nil || o.Channel == nil {
if o == nil || IsNil(o.Channel) {
var ret string
return ret
}
@ -99,7 +106,7 @@ func (o *Message) GetChannel() string {
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Message) GetChannelOk() (*string, bool) {
if o == nil || o.Channel == nil {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
@ -107,7 +114,7 @@ func (o *Message) GetChannelOk() (*string, bool) {
// HasChannel returns a boolean if a field has been set.
func (o *Message) HasChannel() bool {
if o != nil && o.Channel != nil {
if o != nil && !IsNil(o.Channel) {
return true
}
@ -145,7 +152,7 @@ func (o *Message) SetCreatedAt(v time.Time) {
// GetDispatches returns the Dispatches field value if set, zero value otherwise.
func (o *Message) GetDispatches() []MessageDispatch {
if o == nil || o.Dispatches == nil {
if o == nil || IsNil(o.Dispatches) {
var ret []MessageDispatch
return ret
}
@ -155,7 +162,7 @@ func (o *Message) GetDispatches() []MessageDispatch {
// GetDispatchesOk returns a tuple with the Dispatches field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Message) GetDispatchesOk() ([]MessageDispatch, bool) {
if o == nil || o.Dispatches == nil {
if o == nil || IsNil(o.Dispatches) {
return nil, false
}
return o.Dispatches, true
@ -163,7 +170,7 @@ func (o *Message) GetDispatchesOk() ([]MessageDispatch, bool) {
// HasDispatches returns a boolean if a field has been set.
func (o *Message) HasDispatches() bool {
if o != nil && o.Dispatches != nil {
if o != nil && !IsNil(o.Dispatches) {
return true
}
@ -368,46 +375,101 @@ func (o *Message) SetUpdatedAt(v time.Time) {
}
func (o Message) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["body"] = o.Body
}
if o.Channel != nil {
toSerialize["channel"] = o.Channel
}
if true {
toSerialize["created_at"] = o.CreatedAt
}
if o.Dispatches != nil {
toSerialize["dispatches"] = o.Dispatches
}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["recipient"] = o.Recipient
}
if true {
toSerialize["send_count"] = o.SendCount
}
if true {
toSerialize["status"] = o.Status
}
if true {
toSerialize["subject"] = o.Subject
}
if true {
toSerialize["template_type"] = o.TemplateType
}
if true {
toSerialize["type"] = o.Type
}
if true {
toSerialize["updated_at"] = o.UpdatedAt
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Message) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["body"] = o.Body
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
toSerialize["created_at"] = o.CreatedAt
if !IsNil(o.Dispatches) {
toSerialize["dispatches"] = o.Dispatches
}
toSerialize["id"] = o.Id
toSerialize["recipient"] = o.Recipient
toSerialize["send_count"] = o.SendCount
toSerialize["status"] = o.Status
toSerialize["subject"] = o.Subject
toSerialize["template_type"] = o.TemplateType
toSerialize["type"] = o.Type
toSerialize["updated_at"] = o.UpdatedAt
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Message) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"body",
"created_at",
"id",
"recipient",
"send_count",
"status",
"subject",
"template_type",
"type",
"updated_at",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varMessage := _Message{}
err = json.Unmarshal(data, &varMessage)
if err != nil {
return err
}
*o = Message(varMessage)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "body")
delete(additionalProperties, "channel")
delete(additionalProperties, "created_at")
delete(additionalProperties, "dispatches")
delete(additionalProperties, "id")
delete(additionalProperties, "recipient")
delete(additionalProperties, "send_count")
delete(additionalProperties, "status")
delete(additionalProperties, "subject")
delete(additionalProperties, "template_type")
delete(additionalProperties, "type")
delete(additionalProperties, "updated_at")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMessage struct {
value *Message
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the MessageDispatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MessageDispatch{}
// MessageDispatch MessageDispatch represents an attempt of sending a courier message It contains the status of the attempt (failed or successful) and the error if any occured
type MessageDispatch struct {
// CreatedAt is a helper struct field for gobuffalo.pop.
@ -28,9 +32,12 @@ type MessageDispatch struct {
// The status of this dispatch Either \"failed\" or \"success\" failed CourierMessageDispatchStatusFailed success CourierMessageDispatchStatusSuccess
Status string `json:"status"`
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt time.Time `json:"updated_at"`
UpdatedAt time.Time `json:"updated_at"`
AdditionalProperties map[string]interface{}
}
type _MessageDispatch MessageDispatch
// NewMessageDispatch instantiates a new MessageDispatch object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -79,7 +86,7 @@ func (o *MessageDispatch) SetCreatedAt(v time.Time) {
// GetError returns the Error field value if set, zero value otherwise.
func (o *MessageDispatch) GetError() map[string]interface{} {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
var ret map[string]interface{}
return ret
}
@ -89,15 +96,15 @@ func (o *MessageDispatch) GetError() map[string]interface{} {
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MessageDispatch) GetErrorOk() (map[string]interface{}, bool) {
if o == nil || o.Error == nil {
return nil, false
if o == nil || IsNil(o.Error) {
return map[string]interface{}{}, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *MessageDispatch) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -206,28 +213,82 @@ func (o *MessageDispatch) SetUpdatedAt(v time.Time) {
}
func (o MessageDispatch) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["created_at"] = o.CreatedAt
}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["message_id"] = o.MessageId
}
if true {
toSerialize["status"] = o.Status
}
if true {
toSerialize["updated_at"] = o.UpdatedAt
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MessageDispatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["created_at"] = o.CreatedAt
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
toSerialize["id"] = o.Id
toSerialize["message_id"] = o.MessageId
toSerialize["status"] = o.Status
toSerialize["updated_at"] = o.UpdatedAt
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *MessageDispatch) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"created_at",
"id",
"message_id",
"status",
"updated_at",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varMessageDispatch := _MessageDispatch{}
err = json.Unmarshal(data, &varMessageDispatch)
if err != nil {
return err
}
*o = MessageDispatch(varMessageDispatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created_at")
delete(additionalProperties, "error")
delete(additionalProperties, "id")
delete(additionalProperties, "message_id")
delete(additionalProperties, "status")
delete(additionalProperties, "updated_at")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableMessageDispatch struct {
value *MessageDispatch
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,15 +13,22 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the NeedsPrivilegedSessionError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NeedsPrivilegedSessionError{}
// NeedsPrivilegedSessionError struct for NeedsPrivilegedSessionError
type NeedsPrivilegedSessionError struct {
Error *GenericError `json:"error,omitempty"`
// Points to where to redirect the user to next.
RedirectBrowserTo string `json:"redirect_browser_to"`
RedirectBrowserTo string `json:"redirect_browser_to"`
AdditionalProperties map[string]interface{}
}
type _NeedsPrivilegedSessionError NeedsPrivilegedSessionError
// NewNeedsPrivilegedSessionError instantiates a new NeedsPrivilegedSessionError object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -42,7 +49,7 @@ func NewNeedsPrivilegedSessionErrorWithDefaults() *NeedsPrivilegedSessionError {
// GetError returns the Error field value if set, zero value otherwise.
func (o *NeedsPrivilegedSessionError) GetError() GenericError {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
var ret GenericError
return ret
}
@ -52,7 +59,7 @@ func (o *NeedsPrivilegedSessionError) GetError() GenericError {
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NeedsPrivilegedSessionError) GetErrorOk() (*GenericError, bool) {
if o == nil || o.Error == nil {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
@ -60,7 +67,7 @@ func (o *NeedsPrivilegedSessionError) GetErrorOk() (*GenericError, bool) {
// HasError returns a boolean if a field has been set.
func (o *NeedsPrivilegedSessionError) HasError() bool {
if o != nil && o.Error != nil {
if o != nil && !IsNil(o.Error) {
return true
}
@ -97,16 +104,70 @@ func (o *NeedsPrivilegedSessionError) SetRedirectBrowserTo(v string) {
}
func (o NeedsPrivilegedSessionError) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Error != nil {
toSerialize["error"] = o.Error
}
if true {
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NeedsPrivilegedSessionError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
toSerialize["redirect_browser_to"] = o.RedirectBrowserTo
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NeedsPrivilegedSessionError) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"redirect_browser_to",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varNeedsPrivilegedSessionError := _NeedsPrivilegedSessionError{}
err = json.Unmarshal(data, &varNeedsPrivilegedSessionError)
if err != nil {
return err
}
*o = NeedsPrivilegedSessionError(varNeedsPrivilegedSessionError)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "error")
delete(additionalProperties, "redirect_browser_to")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNeedsPrivilegedSessionError struct {
value *NeedsPrivilegedSessionError
isSet bool

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,6 +15,9 @@ import (
"encoding/json"
)
// checks if the OAuth2ConsentRequestOpenIDConnectContext type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OAuth2ConsentRequestOpenIDConnectContext{}
// OAuth2ConsentRequestOpenIDConnectContext OAuth2ConsentRequestOpenIDConnectContext struct for OAuth2ConsentRequestOpenIDConnectContext
type OAuth2ConsentRequestOpenIDConnectContext struct {
// ACRValues is the Authentication AuthorizationContext Class Reference requested in the OAuth 2.0 Authorization request. It is a parameter defined by OpenID Connect and expresses which level of authentication (e.g. 2FA) is required. OpenID Connect defines it as follows: > Requested Authentication AuthorizationContext Class Reference values. Space-separated string that specifies the acr values that the Authorization Server is being requested to use for processing this Authentication Request, with the values appearing in order of preference. The Authentication AuthorizationContext Class satisfied by the authentication performed is returned as the acr Claim Value, as specified in Section 2. The acr Claim is requested as a Voluntary Claim by this parameter.
@ -26,9 +29,12 @@ type OAuth2ConsentRequestOpenIDConnectContext struct {
// LoginHint hints about the login identifier the End-User might use to log in (if necessary). This hint can be used by an RP if it first asks the End-User for their e-mail address (or other identifier) and then wants to pass that value as a hint to the discovered authorization service. This value MAY also be a phone number in the format specified for the phone_number Claim. The use of this parameter is optional.
LoginHint *string `json:"login_hint,omitempty"`
// UILocales is the End-User'id preferred languages and scripts for the user interface, represented as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value \\\"fr-CA fr en\\\" represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported by the OpenID Provider.
UiLocales []string `json:"ui_locales,omitempty"`
UiLocales []string `json:"ui_locales,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OAuth2ConsentRequestOpenIDConnectContext OAuth2ConsentRequestOpenIDConnectContext
// NewOAuth2ConsentRequestOpenIDConnectContext instantiates a new OAuth2ConsentRequestOpenIDConnectContext object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -48,7 +54,7 @@ func NewOAuth2ConsentRequestOpenIDConnectContextWithDefaults() *OAuth2ConsentReq
// GetAcrValues returns the AcrValues field value if set, zero value otherwise.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValues() []string {
if o == nil || o.AcrValues == nil {
if o == nil || IsNil(o.AcrValues) {
var ret []string
return ret
}
@ -58,7 +64,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValues() []string {
// GetAcrValuesOk returns a tuple with the AcrValues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValuesOk() ([]string, bool) {
if o == nil || o.AcrValues == nil {
if o == nil || IsNil(o.AcrValues) {
return nil, false
}
return o.AcrValues, true
@ -66,7 +72,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetAcrValuesOk() ([]string, b
// HasAcrValues returns a boolean if a field has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) HasAcrValues() bool {
if o != nil && o.AcrValues != nil {
if o != nil && !IsNil(o.AcrValues) {
return true
}
@ -80,7 +86,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetAcrValues(v []string) {
// GetDisplay returns the Display field value if set, zero value otherwise.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplay() string {
if o == nil || o.Display == nil {
if o == nil || IsNil(o.Display) {
var ret string
return ret
}
@ -90,7 +96,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplay() string {
// GetDisplayOk returns a tuple with the Display field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplayOk() (*string, bool) {
if o == nil || o.Display == nil {
if o == nil || IsNil(o.Display) {
return nil, false
}
return o.Display, true
@ -98,7 +104,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetDisplayOk() (*string, bool
// HasDisplay returns a boolean if a field has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) HasDisplay() bool {
if o != nil && o.Display != nil {
if o != nil && !IsNil(o.Display) {
return true
}
@ -112,7 +118,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetDisplay(v string) {
// GetIdTokenHintClaims returns the IdTokenHintClaims field value if set, zero value otherwise.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetIdTokenHintClaims() map[string]interface{} {
if o == nil || o.IdTokenHintClaims == nil {
if o == nil || IsNil(o.IdTokenHintClaims) {
var ret map[string]interface{}
return ret
}
@ -122,15 +128,15 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetIdTokenHintClaims() map[st
// GetIdTokenHintClaimsOk returns a tuple with the IdTokenHintClaims field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetIdTokenHintClaimsOk() (map[string]interface{}, bool) {
if o == nil || o.IdTokenHintClaims == nil {
return nil, false
if o == nil || IsNil(o.IdTokenHintClaims) {
return map[string]interface{}{}, false
}
return o.IdTokenHintClaims, true
}
// HasIdTokenHintClaims returns a boolean if a field has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) HasIdTokenHintClaims() bool {
if o != nil && o.IdTokenHintClaims != nil {
if o != nil && !IsNil(o.IdTokenHintClaims) {
return true
}
@ -144,7 +150,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetIdTokenHintClaims(v map[st
// GetLoginHint returns the LoginHint field value if set, zero value otherwise.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHint() string {
if o == nil || o.LoginHint == nil {
if o == nil || IsNil(o.LoginHint) {
var ret string
return ret
}
@ -154,7 +160,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHint() string {
// GetLoginHintOk returns a tuple with the LoginHint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHintOk() (*string, bool) {
if o == nil || o.LoginHint == nil {
if o == nil || IsNil(o.LoginHint) {
return nil, false
}
return o.LoginHint, true
@ -162,7 +168,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetLoginHintOk() (*string, bo
// HasLoginHint returns a boolean if a field has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) HasLoginHint() bool {
if o != nil && o.LoginHint != nil {
if o != nil && !IsNil(o.LoginHint) {
return true
}
@ -176,7 +182,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetLoginHint(v string) {
// GetUiLocales returns the UiLocales field value if set, zero value otherwise.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocales() []string {
if o == nil || o.UiLocales == nil {
if o == nil || IsNil(o.UiLocales) {
var ret []string
return ret
}
@ -186,7 +192,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocales() []string {
// GetUiLocalesOk returns a tuple with the UiLocales field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocalesOk() ([]string, bool) {
if o == nil || o.UiLocales == nil {
if o == nil || IsNil(o.UiLocales) {
return nil, false
}
return o.UiLocales, true
@ -194,7 +200,7 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) GetUiLocalesOk() ([]string, b
// HasUiLocales returns a boolean if a field has been set.
func (o *OAuth2ConsentRequestOpenIDConnectContext) HasUiLocales() bool {
if o != nil && o.UiLocales != nil {
if o != nil && !IsNil(o.UiLocales) {
return true
}
@ -207,25 +213,63 @@ func (o *OAuth2ConsentRequestOpenIDConnectContext) SetUiLocales(v []string) {
}
func (o OAuth2ConsentRequestOpenIDConnectContext) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.AcrValues != nil {
toSerialize["acr_values"] = o.AcrValues
}
if o.Display != nil {
toSerialize["display"] = o.Display
}
if o.IdTokenHintClaims != nil {
toSerialize["id_token_hint_claims"] = o.IdTokenHintClaims
}
if o.LoginHint != nil {
toSerialize["login_hint"] = o.LoginHint
}
if o.UiLocales != nil {
toSerialize["ui_locales"] = o.UiLocales
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OAuth2ConsentRequestOpenIDConnectContext) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AcrValues) {
toSerialize["acr_values"] = o.AcrValues
}
if !IsNil(o.Display) {
toSerialize["display"] = o.Display
}
if !IsNil(o.IdTokenHintClaims) {
toSerialize["id_token_hint_claims"] = o.IdTokenHintClaims
}
if !IsNil(o.LoginHint) {
toSerialize["login_hint"] = o.LoginHint
}
if !IsNil(o.UiLocales) {
toSerialize["ui_locales"] = o.UiLocales
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OAuth2ConsentRequestOpenIDConnectContext) UnmarshalJSON(data []byte) (err error) {
varOAuth2ConsentRequestOpenIDConnectContext := _OAuth2ConsentRequestOpenIDConnectContext{}
err = json.Unmarshal(data, &varOAuth2ConsentRequestOpenIDConnectContext)
if err != nil {
return err
}
*o = OAuth2ConsentRequestOpenIDConnectContext(varOAuth2ConsentRequestOpenIDConnectContext)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "acr_values")
delete(additionalProperties, "display")
delete(additionalProperties, "id_token_hint_claims")
delete(additionalProperties, "login_hint")
delete(additionalProperties, "ui_locales")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOAuth2ConsentRequestOpenIDConnectContext struct {
value *OAuth2ConsentRequestOpenIDConnectContext
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,6 +15,9 @@ import (
"encoding/json"
)
// checks if the OAuth2LoginRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OAuth2LoginRequest{}
// OAuth2LoginRequest OAuth2LoginRequest struct for OAuth2LoginRequest
type OAuth2LoginRequest struct {
// ID is the identifier (\\\"login challenge\\\") of the login request. It is used to identify the session.
@ -30,9 +33,12 @@ type OAuth2LoginRequest struct {
// Skip, if true, implies that the client has requested the same scopes from the same user previously. If true, you can skip asking the user to grant the requested scopes, and simply forward the user to the redirect URL. This feature allows you to update / set session information.
Skip *bool `json:"skip,omitempty"`
// Subject is the user ID of the end-user that authenticated. Now, that end user needs to grant or deny the scope requested by the OAuth 2.0 client. If this value is set and `skip` is true, you MUST include this subject type when accepting the login request, or the request will fail.
Subject *string `json:"subject,omitempty"`
Subject *string `json:"subject,omitempty"`
AdditionalProperties map[string]interface{}
}
type _OAuth2LoginRequest OAuth2LoginRequest
// NewOAuth2LoginRequest instantiates a new OAuth2LoginRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -52,7 +58,7 @@ func NewOAuth2LoginRequestWithDefaults() *OAuth2LoginRequest {
// GetChallenge returns the Challenge field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetChallenge() string {
if o == nil || o.Challenge == nil {
if o == nil || IsNil(o.Challenge) {
var ret string
return ret
}
@ -62,7 +68,7 @@ func (o *OAuth2LoginRequest) GetChallenge() string {
// GetChallengeOk returns a tuple with the Challenge field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetChallengeOk() (*string, bool) {
if o == nil || o.Challenge == nil {
if o == nil || IsNil(o.Challenge) {
return nil, false
}
return o.Challenge, true
@ -70,7 +76,7 @@ func (o *OAuth2LoginRequest) GetChallengeOk() (*string, bool) {
// HasChallenge returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasChallenge() bool {
if o != nil && o.Challenge != nil {
if o != nil && !IsNil(o.Challenge) {
return true
}
@ -84,7 +90,7 @@ func (o *OAuth2LoginRequest) SetChallenge(v string) {
// GetClient returns the Client field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetClient() OAuth2Client {
if o == nil || o.Client == nil {
if o == nil || IsNil(o.Client) {
var ret OAuth2Client
return ret
}
@ -94,7 +100,7 @@ func (o *OAuth2LoginRequest) GetClient() OAuth2Client {
// 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 *OAuth2LoginRequest) GetClientOk() (*OAuth2Client, bool) {
if o == nil || o.Client == nil {
if o == nil || IsNil(o.Client) {
return nil, false
}
return o.Client, true
@ -102,7 +108,7 @@ func (o *OAuth2LoginRequest) GetClientOk() (*OAuth2Client, bool) {
// HasClient returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasClient() bool {
if o != nil && o.Client != nil {
if o != nil && !IsNil(o.Client) {
return true
}
@ -116,7 +122,7 @@ func (o *OAuth2LoginRequest) SetClient(v OAuth2Client) {
// GetOidcContext returns the OidcContext field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetOidcContext() OAuth2ConsentRequestOpenIDConnectContext {
if o == nil || o.OidcContext == nil {
if o == nil || IsNil(o.OidcContext) {
var ret OAuth2ConsentRequestOpenIDConnectContext
return ret
}
@ -126,7 +132,7 @@ func (o *OAuth2LoginRequest) GetOidcContext() OAuth2ConsentRequestOpenIDConnectC
// GetOidcContextOk returns a tuple with the OidcContext field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetOidcContextOk() (*OAuth2ConsentRequestOpenIDConnectContext, bool) {
if o == nil || o.OidcContext == nil {
if o == nil || IsNil(o.OidcContext) {
return nil, false
}
return o.OidcContext, true
@ -134,7 +140,7 @@ func (o *OAuth2LoginRequest) GetOidcContextOk() (*OAuth2ConsentRequestOpenIDConn
// HasOidcContext returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasOidcContext() bool {
if o != nil && o.OidcContext != nil {
if o != nil && !IsNil(o.OidcContext) {
return true
}
@ -148,7 +154,7 @@ func (o *OAuth2LoginRequest) SetOidcContext(v OAuth2ConsentRequestOpenIDConnectC
// GetRequestUrl returns the RequestUrl field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetRequestUrl() string {
if o == nil || o.RequestUrl == nil {
if o == nil || IsNil(o.RequestUrl) {
var ret string
return ret
}
@ -158,7 +164,7 @@ func (o *OAuth2LoginRequest) GetRequestUrl() string {
// GetRequestUrlOk returns a tuple with the RequestUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetRequestUrlOk() (*string, bool) {
if o == nil || o.RequestUrl == nil {
if o == nil || IsNil(o.RequestUrl) {
return nil, false
}
return o.RequestUrl, true
@ -166,7 +172,7 @@ func (o *OAuth2LoginRequest) GetRequestUrlOk() (*string, bool) {
// HasRequestUrl returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasRequestUrl() bool {
if o != nil && o.RequestUrl != nil {
if o != nil && !IsNil(o.RequestUrl) {
return true
}
@ -180,7 +186,7 @@ func (o *OAuth2LoginRequest) SetRequestUrl(v string) {
// GetRequestedAccessTokenAudience returns the RequestedAccessTokenAudience field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudience() []string {
if o == nil || o.RequestedAccessTokenAudience == nil {
if o == nil || IsNil(o.RequestedAccessTokenAudience) {
var ret []string
return ret
}
@ -190,7 +196,7 @@ func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudience() []string {
// GetRequestedAccessTokenAudienceOk returns a tuple with the RequestedAccessTokenAudience field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudienceOk() ([]string, bool) {
if o == nil || o.RequestedAccessTokenAudience == nil {
if o == nil || IsNil(o.RequestedAccessTokenAudience) {
return nil, false
}
return o.RequestedAccessTokenAudience, true
@ -198,7 +204,7 @@ func (o *OAuth2LoginRequest) GetRequestedAccessTokenAudienceOk() ([]string, bool
// HasRequestedAccessTokenAudience returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasRequestedAccessTokenAudience() bool {
if o != nil && o.RequestedAccessTokenAudience != nil {
if o != nil && !IsNil(o.RequestedAccessTokenAudience) {
return true
}
@ -212,7 +218,7 @@ func (o *OAuth2LoginRequest) SetRequestedAccessTokenAudience(v []string) {
// GetRequestedScope returns the RequestedScope field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetRequestedScope() []string {
if o == nil || o.RequestedScope == nil {
if o == nil || IsNil(o.RequestedScope) {
var ret []string
return ret
}
@ -222,7 +228,7 @@ func (o *OAuth2LoginRequest) GetRequestedScope() []string {
// GetRequestedScopeOk returns a tuple with the RequestedScope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetRequestedScopeOk() ([]string, bool) {
if o == nil || o.RequestedScope == nil {
if o == nil || IsNil(o.RequestedScope) {
return nil, false
}
return o.RequestedScope, true
@ -230,7 +236,7 @@ func (o *OAuth2LoginRequest) GetRequestedScopeOk() ([]string, bool) {
// HasRequestedScope returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasRequestedScope() bool {
if o != nil && o.RequestedScope != nil {
if o != nil && !IsNil(o.RequestedScope) {
return true
}
@ -244,7 +250,7 @@ func (o *OAuth2LoginRequest) SetRequestedScope(v []string) {
// GetSessionId returns the SessionId field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetSessionId() string {
if o == nil || o.SessionId == nil {
if o == nil || IsNil(o.SessionId) {
var ret string
return ret
}
@ -254,7 +260,7 @@ func (o *OAuth2LoginRequest) GetSessionId() string {
// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetSessionIdOk() (*string, bool) {
if o == nil || o.SessionId == nil {
if o == nil || IsNil(o.SessionId) {
return nil, false
}
return o.SessionId, true
@ -262,7 +268,7 @@ func (o *OAuth2LoginRequest) GetSessionIdOk() (*string, bool) {
// HasSessionId returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasSessionId() bool {
if o != nil && o.SessionId != nil {
if o != nil && !IsNil(o.SessionId) {
return true
}
@ -276,7 +282,7 @@ func (o *OAuth2LoginRequest) SetSessionId(v string) {
// GetSkip returns the Skip field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetSkip() bool {
if o == nil || o.Skip == nil {
if o == nil || IsNil(o.Skip) {
var ret bool
return ret
}
@ -286,7 +292,7 @@ func (o *OAuth2LoginRequest) GetSkip() bool {
// GetSkipOk returns a tuple with the Skip field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetSkipOk() (*bool, bool) {
if o == nil || o.Skip == nil {
if o == nil || IsNil(o.Skip) {
return nil, false
}
return o.Skip, true
@ -294,7 +300,7 @@ func (o *OAuth2LoginRequest) GetSkipOk() (*bool, bool) {
// HasSkip returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasSkip() bool {
if o != nil && o.Skip != nil {
if o != nil && !IsNil(o.Skip) {
return true
}
@ -308,7 +314,7 @@ func (o *OAuth2LoginRequest) SetSkip(v bool) {
// GetSubject returns the Subject field value if set, zero value otherwise.
func (o *OAuth2LoginRequest) GetSubject() string {
if o == nil || o.Subject == nil {
if o == nil || IsNil(o.Subject) {
var ret string
return ret
}
@ -318,7 +324,7 @@ func (o *OAuth2LoginRequest) GetSubject() string {
// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OAuth2LoginRequest) GetSubjectOk() (*string, bool) {
if o == nil || o.Subject == nil {
if o == nil || IsNil(o.Subject) {
return nil, false
}
return o.Subject, true
@ -326,7 +332,7 @@ func (o *OAuth2LoginRequest) GetSubjectOk() (*string, bool) {
// HasSubject returns a boolean if a field has been set.
func (o *OAuth2LoginRequest) HasSubject() bool {
if o != nil && o.Subject != nil {
if o != nil && !IsNil(o.Subject) {
return true
}
@ -339,37 +345,79 @@ func (o *OAuth2LoginRequest) SetSubject(v string) {
}
func (o OAuth2LoginRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Challenge != nil {
toSerialize["challenge"] = o.Challenge
}
if o.Client != nil {
toSerialize["client"] = o.Client
}
if o.OidcContext != nil {
toSerialize["oidc_context"] = o.OidcContext
}
if o.RequestUrl != nil {
toSerialize["request_url"] = o.RequestUrl
}
if o.RequestedAccessTokenAudience != nil {
toSerialize["requested_access_token_audience"] = o.RequestedAccessTokenAudience
}
if o.RequestedScope != nil {
toSerialize["requested_scope"] = o.RequestedScope
}
if o.SessionId != nil {
toSerialize["session_id"] = o.SessionId
}
if o.Skip != nil {
toSerialize["skip"] = o.Skip
}
if o.Subject != nil {
toSerialize["subject"] = o.Subject
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OAuth2LoginRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Challenge) {
toSerialize["challenge"] = o.Challenge
}
if !IsNil(o.Client) {
toSerialize["client"] = o.Client
}
if !IsNil(o.OidcContext) {
toSerialize["oidc_context"] = o.OidcContext
}
if !IsNil(o.RequestUrl) {
toSerialize["request_url"] = o.RequestUrl
}
if !IsNil(o.RequestedAccessTokenAudience) {
toSerialize["requested_access_token_audience"] = o.RequestedAccessTokenAudience
}
if !IsNil(o.RequestedScope) {
toSerialize["requested_scope"] = o.RequestedScope
}
if !IsNil(o.SessionId) {
toSerialize["session_id"] = o.SessionId
}
if !IsNil(o.Skip) {
toSerialize["skip"] = o.Skip
}
if !IsNil(o.Subject) {
toSerialize["subject"] = o.Subject
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *OAuth2LoginRequest) UnmarshalJSON(data []byte) (err error) {
varOAuth2LoginRequest := _OAuth2LoginRequest{}
err = json.Unmarshal(data, &varOAuth2LoginRequest)
if err != nil {
return err
}
*o = OAuth2LoginRequest(varOAuth2LoginRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "challenge")
delete(additionalProperties, "client")
delete(additionalProperties, "oidc_context")
delete(additionalProperties, "request_url")
delete(additionalProperties, "requested_access_token_audience")
delete(additionalProperties, "requested_scope")
delete(additionalProperties, "session_id")
delete(additionalProperties, "skip")
delete(additionalProperties, "subject")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableOAuth2LoginRequest struct {
value *OAuth2LoginRequest
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,12 +15,18 @@ import (
"encoding/json"
)
// checks if the PatchIdentitiesBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PatchIdentitiesBody{}
// PatchIdentitiesBody Patch Identities Body
type PatchIdentitiesBody struct {
// Identities holds the list of patches to apply required
Identities []IdentityPatch `json:"identities,omitempty"`
Identities []IdentityPatch `json:"identities,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PatchIdentitiesBody PatchIdentitiesBody
// NewPatchIdentitiesBody instantiates a new PatchIdentitiesBody object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -40,7 +46,7 @@ func NewPatchIdentitiesBodyWithDefaults() *PatchIdentitiesBody {
// GetIdentities returns the Identities field value if set, zero value otherwise.
func (o *PatchIdentitiesBody) GetIdentities() []IdentityPatch {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
var ret []IdentityPatch
return ret
}
@ -50,7 +56,7 @@ func (o *PatchIdentitiesBody) GetIdentities() []IdentityPatch {
// GetIdentitiesOk returns a tuple with the Identities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PatchIdentitiesBody) GetIdentitiesOk() ([]IdentityPatch, bool) {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
return nil, false
}
return o.Identities, true
@ -58,7 +64,7 @@ func (o *PatchIdentitiesBody) GetIdentitiesOk() ([]IdentityPatch, bool) {
// HasIdentities returns a boolean if a field has been set.
func (o *PatchIdentitiesBody) HasIdentities() bool {
if o != nil && o.Identities != nil {
if o != nil && !IsNil(o.Identities) {
return true
}
@ -71,13 +77,47 @@ func (o *PatchIdentitiesBody) SetIdentities(v []IdentityPatch) {
}
func (o PatchIdentitiesBody) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Identities != nil {
toSerialize["identities"] = o.Identities
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PatchIdentitiesBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Identities) {
toSerialize["identities"] = o.Identities
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PatchIdentitiesBody) UnmarshalJSON(data []byte) (err error) {
varPatchIdentitiesBody := _PatchIdentitiesBody{}
err = json.Unmarshal(data, &varPatchIdentitiesBody)
if err != nil {
return err
}
*o = PatchIdentitiesBody(varPatchIdentitiesBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "identities")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePatchIdentitiesBody struct {
value *PatchIdentitiesBody
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,14 +13,21 @@ package client
import (
"encoding/json"
"fmt"
)
// checks if the PerformNativeLogoutBody type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PerformNativeLogoutBody{}
// PerformNativeLogoutBody Perform Native Logout Request Body
type PerformNativeLogoutBody struct {
// The Session Token Invalidate this session token.
SessionToken string `json:"session_token"`
SessionToken string `json:"session_token"`
AdditionalProperties map[string]interface{}
}
type _PerformNativeLogoutBody PerformNativeLogoutBody
// NewPerformNativeLogoutBody instantiates a new PerformNativeLogoutBody object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -64,13 +71,66 @@ func (o *PerformNativeLogoutBody) SetSessionToken(v string) {
}
func (o PerformNativeLogoutBody) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["session_token"] = o.SessionToken
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PerformNativeLogoutBody) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["session_token"] = o.SessionToken
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PerformNativeLogoutBody) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"session_token",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varPerformNativeLogoutBody := _PerformNativeLogoutBody{}
err = json.Unmarshal(data, &varPerformNativeLogoutBody)
if err != nil {
return err
}
*o = PerformNativeLogoutBody(varPerformNativeLogoutBody)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "session_token")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePerformNativeLogoutBody struct {
value *PerformNativeLogoutBody
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -15,6 +15,9 @@ import (
"encoding/json"
)
// checks if the Provider type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Provider{}
// Provider struct for Provider
type Provider struct {
// The RP's client identifier, issued by the IdP.
@ -30,9 +33,12 @@ type Provider struct {
// A random string to ensure the response is issued for this specific request. Prevents replay attacks.
Nonce *string `json:"nonce,omitempty"`
// Custom object that allows to specify additional key-value parameters: scope: A string value containing additional permissions that RP needs to request, for example \" drive.readonly calendar.readonly\" nonce: A random string to ensure the response is issued for this specific request. Prevents replay attacks. Other custom key-value parameters. Note: parameters is supported from Chrome 132.
Parameters *map[string]string `json:"parameters,omitempty"`
Parameters *map[string]string `json:"parameters,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Provider Provider
// NewProvider instantiates a new Provider object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -52,7 +58,7 @@ func NewProviderWithDefaults() *Provider {
// GetClientId returns the ClientId field value if set, zero value otherwise.
func (o *Provider) GetClientId() string {
if o == nil || o.ClientId == nil {
if o == nil || IsNil(o.ClientId) {
var ret string
return ret
}
@ -62,7 +68,7 @@ func (o *Provider) GetClientId() string {
// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetClientIdOk() (*string, bool) {
if o == nil || o.ClientId == nil {
if o == nil || IsNil(o.ClientId) {
return nil, false
}
return o.ClientId, true
@ -70,7 +76,7 @@ func (o *Provider) GetClientIdOk() (*string, bool) {
// HasClientId returns a boolean if a field has been set.
func (o *Provider) HasClientId() bool {
if o != nil && o.ClientId != nil {
if o != nil && !IsNil(o.ClientId) {
return true
}
@ -84,7 +90,7 @@ func (o *Provider) SetClientId(v string) {
// GetConfigUrl returns the ConfigUrl field value if set, zero value otherwise.
func (o *Provider) GetConfigUrl() string {
if o == nil || o.ConfigUrl == nil {
if o == nil || IsNil(o.ConfigUrl) {
var ret string
return ret
}
@ -94,7 +100,7 @@ func (o *Provider) GetConfigUrl() string {
// GetConfigUrlOk returns a tuple with the ConfigUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetConfigUrlOk() (*string, bool) {
if o == nil || o.ConfigUrl == nil {
if o == nil || IsNil(o.ConfigUrl) {
return nil, false
}
return o.ConfigUrl, true
@ -102,7 +108,7 @@ func (o *Provider) GetConfigUrlOk() (*string, bool) {
// HasConfigUrl returns a boolean if a field has been set.
func (o *Provider) HasConfigUrl() bool {
if o != nil && o.ConfigUrl != nil {
if o != nil && !IsNil(o.ConfigUrl) {
return true
}
@ -116,7 +122,7 @@ func (o *Provider) SetConfigUrl(v string) {
// GetDomainHint returns the DomainHint field value if set, zero value otherwise.
func (o *Provider) GetDomainHint() string {
if o == nil || o.DomainHint == nil {
if o == nil || IsNil(o.DomainHint) {
var ret string
return ret
}
@ -126,7 +132,7 @@ func (o *Provider) GetDomainHint() string {
// GetDomainHintOk returns a tuple with the DomainHint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetDomainHintOk() (*string, bool) {
if o == nil || o.DomainHint == nil {
if o == nil || IsNil(o.DomainHint) {
return nil, false
}
return o.DomainHint, true
@ -134,7 +140,7 @@ func (o *Provider) GetDomainHintOk() (*string, bool) {
// HasDomainHint returns a boolean if a field has been set.
func (o *Provider) HasDomainHint() bool {
if o != nil && o.DomainHint != nil {
if o != nil && !IsNil(o.DomainHint) {
return true
}
@ -148,7 +154,7 @@ func (o *Provider) SetDomainHint(v string) {
// GetFields returns the Fields field value if set, zero value otherwise.
func (o *Provider) GetFields() []string {
if o == nil || o.Fields == nil {
if o == nil || IsNil(o.Fields) {
var ret []string
return ret
}
@ -158,7 +164,7 @@ func (o *Provider) GetFields() []string {
// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetFieldsOk() ([]string, bool) {
if o == nil || o.Fields == nil {
if o == nil || IsNil(o.Fields) {
return nil, false
}
return o.Fields, true
@ -166,7 +172,7 @@ func (o *Provider) GetFieldsOk() ([]string, bool) {
// HasFields returns a boolean if a field has been set.
func (o *Provider) HasFields() bool {
if o != nil && o.Fields != nil {
if o != nil && !IsNil(o.Fields) {
return true
}
@ -180,7 +186,7 @@ func (o *Provider) SetFields(v []string) {
// GetLoginHint returns the LoginHint field value if set, zero value otherwise.
func (o *Provider) GetLoginHint() string {
if o == nil || o.LoginHint == nil {
if o == nil || IsNil(o.LoginHint) {
var ret string
return ret
}
@ -190,7 +196,7 @@ func (o *Provider) GetLoginHint() string {
// GetLoginHintOk returns a tuple with the LoginHint field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetLoginHintOk() (*string, bool) {
if o == nil || o.LoginHint == nil {
if o == nil || IsNil(o.LoginHint) {
return nil, false
}
return o.LoginHint, true
@ -198,7 +204,7 @@ func (o *Provider) GetLoginHintOk() (*string, bool) {
// HasLoginHint returns a boolean if a field has been set.
func (o *Provider) HasLoginHint() bool {
if o != nil && o.LoginHint != nil {
if o != nil && !IsNil(o.LoginHint) {
return true
}
@ -212,7 +218,7 @@ func (o *Provider) SetLoginHint(v string) {
// GetNonce returns the Nonce field value if set, zero value otherwise.
func (o *Provider) GetNonce() string {
if o == nil || o.Nonce == nil {
if o == nil || IsNil(o.Nonce) {
var ret string
return ret
}
@ -222,7 +228,7 @@ func (o *Provider) GetNonce() string {
// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetNonceOk() (*string, bool) {
if o == nil || o.Nonce == nil {
if o == nil || IsNil(o.Nonce) {
return nil, false
}
return o.Nonce, true
@ -230,7 +236,7 @@ func (o *Provider) GetNonceOk() (*string, bool) {
// HasNonce returns a boolean if a field has been set.
func (o *Provider) HasNonce() bool {
if o != nil && o.Nonce != nil {
if o != nil && !IsNil(o.Nonce) {
return true
}
@ -244,7 +250,7 @@ func (o *Provider) SetNonce(v string) {
// GetParameters returns the Parameters field value if set, zero value otherwise.
func (o *Provider) GetParameters() map[string]string {
if o == nil || o.Parameters == nil {
if o == nil || IsNil(o.Parameters) {
var ret map[string]string
return ret
}
@ -254,7 +260,7 @@ func (o *Provider) GetParameters() map[string]string {
// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Provider) GetParametersOk() (*map[string]string, bool) {
if o == nil || o.Parameters == nil {
if o == nil || IsNil(o.Parameters) {
return nil, false
}
return o.Parameters, true
@ -262,7 +268,7 @@ func (o *Provider) GetParametersOk() (*map[string]string, bool) {
// HasParameters returns a boolean if a field has been set.
func (o *Provider) HasParameters() bool {
if o != nil && o.Parameters != nil {
if o != nil && !IsNil(o.Parameters) {
return true
}
@ -275,31 +281,71 @@ func (o *Provider) SetParameters(v map[string]string) {
}
func (o Provider) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ClientId != nil {
toSerialize["client_id"] = o.ClientId
}
if o.ConfigUrl != nil {
toSerialize["config_url"] = o.ConfigUrl
}
if o.DomainHint != nil {
toSerialize["domain_hint"] = o.DomainHint
}
if o.Fields != nil {
toSerialize["fields"] = o.Fields
}
if o.LoginHint != nil {
toSerialize["login_hint"] = o.LoginHint
}
if o.Nonce != nil {
toSerialize["nonce"] = o.Nonce
}
if o.Parameters != nil {
toSerialize["parameters"] = o.Parameters
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Provider) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ClientId) {
toSerialize["client_id"] = o.ClientId
}
if !IsNil(o.ConfigUrl) {
toSerialize["config_url"] = o.ConfigUrl
}
if !IsNil(o.DomainHint) {
toSerialize["domain_hint"] = o.DomainHint
}
if !IsNil(o.Fields) {
toSerialize["fields"] = o.Fields
}
if !IsNil(o.LoginHint) {
toSerialize["login_hint"] = o.LoginHint
}
if !IsNil(o.Nonce) {
toSerialize["nonce"] = o.Nonce
}
if !IsNil(o.Parameters) {
toSerialize["parameters"] = o.Parameters
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Provider) UnmarshalJSON(data []byte) (err error) {
varProvider := _Provider{}
err = json.Unmarshal(data, &varProvider)
if err != nil {
return err
}
*o = Provider(varProvider)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "client_id")
delete(additionalProperties, "config_url")
delete(additionalProperties, "domain_hint")
delete(additionalProperties, "fields")
delete(additionalProperties, "login_hint")
delete(additionalProperties, "nonce")
delete(additionalProperties, "parameters")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProvider struct {
value *Provider
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the RecoveryCodeForIdentity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RecoveryCodeForIdentity{}
// RecoveryCodeForIdentity Used when an administrator creates a recovery code for an identity.
type RecoveryCodeForIdentity struct {
// Expires At is the timestamp of when the recovery flow expires The timestamp when the recovery code expires.
@ -23,9 +27,12 @@ type RecoveryCodeForIdentity struct {
// RecoveryCode is the code that can be used to recover the account
RecoveryCode string `json:"recovery_code"`
// RecoveryLink with flow This link opens the recovery UI with an empty `code` field.
RecoveryLink string `json:"recovery_link"`
RecoveryLink string `json:"recovery_link"`
AdditionalProperties map[string]interface{}
}
type _RecoveryCodeForIdentity RecoveryCodeForIdentity
// NewRecoveryCodeForIdentity instantiates a new RecoveryCodeForIdentity object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -47,7 +54,7 @@ func NewRecoveryCodeForIdentityWithDefaults() *RecoveryCodeForIdentity {
// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
func (o *RecoveryCodeForIdentity) GetExpiresAt() time.Time {
if o == nil || o.ExpiresAt == nil {
if o == nil || IsNil(o.ExpiresAt) {
var ret time.Time
return ret
}
@ -57,7 +64,7 @@ func (o *RecoveryCodeForIdentity) GetExpiresAt() time.Time {
// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryCodeForIdentity) GetExpiresAtOk() (*time.Time, bool) {
if o == nil || o.ExpiresAt == nil {
if o == nil || IsNil(o.ExpiresAt) {
return nil, false
}
return o.ExpiresAt, true
@ -65,7 +72,7 @@ func (o *RecoveryCodeForIdentity) GetExpiresAtOk() (*time.Time, bool) {
// HasExpiresAt returns a boolean if a field has been set.
func (o *RecoveryCodeForIdentity) HasExpiresAt() bool {
if o != nil && o.ExpiresAt != nil {
if o != nil && !IsNil(o.ExpiresAt) {
return true
}
@ -126,19 +133,73 @@ func (o *RecoveryCodeForIdentity) SetRecoveryLink(v string) {
}
func (o RecoveryCodeForIdentity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ExpiresAt != nil {
toSerialize["expires_at"] = o.ExpiresAt
}
if true {
toSerialize["recovery_code"] = o.RecoveryCode
}
if true {
toSerialize["recovery_link"] = o.RecoveryLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RecoveryCodeForIdentity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ExpiresAt) {
toSerialize["expires_at"] = o.ExpiresAt
}
toSerialize["recovery_code"] = o.RecoveryCode
toSerialize["recovery_link"] = o.RecoveryLink
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RecoveryCodeForIdentity) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"recovery_code",
"recovery_link",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRecoveryCodeForIdentity := _RecoveryCodeForIdentity{}
err = json.Unmarshal(data, &varRecoveryCodeForIdentity)
if err != nil {
return err
}
*o = RecoveryCodeForIdentity(varRecoveryCodeForIdentity)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "expires_at")
delete(additionalProperties, "recovery_code")
delete(additionalProperties, "recovery_link")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRecoveryCodeForIdentity struct {
value *RecoveryCodeForIdentity
isSet bool

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,9 +13,13 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the RecoveryFlow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RecoveryFlow{}
// RecoveryFlow This request is used when an identity wants to recover their account. We recommend reading the [Account Recovery Documentation](../self-service/flows/password-reset-account-recovery)
type RecoveryFlow struct {
// Active, if set, contains the recovery method that is being used. It is initially not set.
@ -37,10 +41,13 @@ type RecoveryFlow struct {
// TransientPayload is used to pass data from the recovery flow to hooks and email templates
TransientPayload map[string]interface{} `json:"transient_payload,omitempty"`
// The flow type can either be `api` or `browser`.
Type string `json:"type"`
Ui UiContainer `json:"ui"`
Type string `json:"type"`
Ui UiContainer `json:"ui"`
AdditionalProperties map[string]interface{}
}
type _RecoveryFlow RecoveryFlow
// NewRecoveryFlow instantiates a new RecoveryFlow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -67,7 +74,7 @@ func NewRecoveryFlowWithDefaults() *RecoveryFlow {
// GetActive returns the Active field value if set, zero value otherwise.
func (o *RecoveryFlow) GetActive() string {
if o == nil || o.Active == nil {
if o == nil || IsNil(o.Active) {
var ret string
return ret
}
@ -77,7 +84,7 @@ func (o *RecoveryFlow) GetActive() string {
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryFlow) GetActiveOk() (*string, bool) {
if o == nil || o.Active == nil {
if o == nil || IsNil(o.Active) {
return nil, false
}
return o.Active, true
@ -85,7 +92,7 @@ func (o *RecoveryFlow) GetActiveOk() (*string, bool) {
// HasActive returns a boolean if a field has been set.
func (o *RecoveryFlow) HasActive() bool {
if o != nil && o.Active != nil {
if o != nil && !IsNil(o.Active) {
return true
}
@ -99,7 +106,7 @@ func (o *RecoveryFlow) SetActive(v string) {
// GetContinueWith returns the ContinueWith field value if set, zero value otherwise.
func (o *RecoveryFlow) GetContinueWith() []ContinueWith {
if o == nil || o.ContinueWith == nil {
if o == nil || IsNil(o.ContinueWith) {
var ret []ContinueWith
return ret
}
@ -109,7 +116,7 @@ func (o *RecoveryFlow) GetContinueWith() []ContinueWith {
// GetContinueWithOk returns a tuple with the ContinueWith field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryFlow) GetContinueWithOk() ([]ContinueWith, bool) {
if o == nil || o.ContinueWith == nil {
if o == nil || IsNil(o.ContinueWith) {
return nil, false
}
return o.ContinueWith, true
@ -117,7 +124,7 @@ func (o *RecoveryFlow) GetContinueWithOk() ([]ContinueWith, bool) {
// HasContinueWith returns a boolean if a field has been set.
func (o *RecoveryFlow) HasContinueWith() bool {
if o != nil && o.ContinueWith != nil {
if o != nil && !IsNil(o.ContinueWith) {
return true
}
@ -227,7 +234,7 @@ func (o *RecoveryFlow) SetRequestUrl(v string) {
// GetReturnTo returns the ReturnTo field value if set, zero value otherwise.
func (o *RecoveryFlow) GetReturnTo() string {
if o == nil || o.ReturnTo == nil {
if o == nil || IsNil(o.ReturnTo) {
var ret string
return ret
}
@ -237,7 +244,7 @@ func (o *RecoveryFlow) GetReturnTo() string {
// GetReturnToOk returns a tuple with the ReturnTo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryFlow) GetReturnToOk() (*string, bool) {
if o == nil || o.ReturnTo == nil {
if o == nil || IsNil(o.ReturnTo) {
return nil, false
}
return o.ReturnTo, true
@ -245,7 +252,7 @@ func (o *RecoveryFlow) GetReturnToOk() (*string, bool) {
// HasReturnTo returns a boolean if a field has been set.
func (o *RecoveryFlow) HasReturnTo() bool {
if o != nil && o.ReturnTo != nil {
if o != nil && !IsNil(o.ReturnTo) {
return true
}
@ -272,7 +279,7 @@ func (o *RecoveryFlow) GetState() interface{} {
// 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 *RecoveryFlow) GetStateOk() (*interface{}, bool) {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
return nil, false
}
return &o.State, true
@ -285,7 +292,7 @@ func (o *RecoveryFlow) SetState(v interface{}) {
// GetTransientPayload returns the TransientPayload field value if set, zero value otherwise.
func (o *RecoveryFlow) GetTransientPayload() map[string]interface{} {
if o == nil || o.TransientPayload == nil {
if o == nil || IsNil(o.TransientPayload) {
var ret map[string]interface{}
return ret
}
@ -295,15 +302,15 @@ func (o *RecoveryFlow) GetTransientPayload() map[string]interface{} {
// GetTransientPayloadOk returns a tuple with the TransientPayload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryFlow) GetTransientPayloadOk() (map[string]interface{}, bool) {
if o == nil || o.TransientPayload == nil {
return nil, false
if o == nil || IsNil(o.TransientPayload) {
return map[string]interface{}{}, false
}
return o.TransientPayload, true
}
// HasTransientPayload returns a boolean if a field has been set.
func (o *RecoveryFlow) HasTransientPayload() bool {
if o != nil && o.TransientPayload != nil {
if o != nil && !IsNil(o.TransientPayload) {
return true
}
@ -364,41 +371,100 @@ func (o *RecoveryFlow) SetUi(v UiContainer) {
}
func (o RecoveryFlow) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RecoveryFlow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Active != nil {
if !IsNil(o.Active) {
toSerialize["active"] = o.Active
}
if o.ContinueWith != nil {
if !IsNil(o.ContinueWith) {
toSerialize["continue_with"] = o.ContinueWith
}
if true {
toSerialize["expires_at"] = o.ExpiresAt
}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["issued_at"] = o.IssuedAt
}
if true {
toSerialize["request_url"] = o.RequestUrl
}
if o.ReturnTo != nil {
toSerialize["expires_at"] = o.ExpiresAt
toSerialize["id"] = o.Id
toSerialize["issued_at"] = o.IssuedAt
toSerialize["request_url"] = o.RequestUrl
if !IsNil(o.ReturnTo) {
toSerialize["return_to"] = o.ReturnTo
}
if o.State != nil {
toSerialize["state"] = o.State
}
if o.TransientPayload != nil {
if !IsNil(o.TransientPayload) {
toSerialize["transient_payload"] = o.TransientPayload
}
if true {
toSerialize["type"] = o.Type
toSerialize["type"] = o.Type
toSerialize["ui"] = o.Ui
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
if true {
toSerialize["ui"] = o.Ui
return toSerialize, nil
}
func (o *RecoveryFlow) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"expires_at",
"id",
"issued_at",
"request_url",
"state",
"type",
"ui",
}
return json.Marshal(toSerialize)
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRecoveryFlow := _RecoveryFlow{}
err = json.Unmarshal(data, &varRecoveryFlow)
if err != nil {
return err
}
*o = RecoveryFlow(varRecoveryFlow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "active")
delete(additionalProperties, "continue_with")
delete(additionalProperties, "expires_at")
delete(additionalProperties, "id")
delete(additionalProperties, "issued_at")
delete(additionalProperties, "request_url")
delete(additionalProperties, "return_to")
delete(additionalProperties, "state")
delete(additionalProperties, "transient_payload")
delete(additionalProperties, "type")
delete(additionalProperties, "ui")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRecoveryFlow struct {

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -26,6 +26,13 @@ const (
RECOVERYFLOWSTATE_PASSED_CHALLENGE RecoveryFlowState = "passed_challenge"
)
// All allowed values of RecoveryFlowState enum
var AllowedRecoveryFlowStateEnumValues = []RecoveryFlowState{
"choose_method",
"sent_email",
"passed_challenge",
}
func (v *RecoveryFlowState) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
@ -33,7 +40,7 @@ func (v *RecoveryFlowState) UnmarshalJSON(src []byte) error {
return err
}
enumTypeValue := RecoveryFlowState(value)
for _, existing := range []RecoveryFlowState{"choose_method", "sent_email", "passed_challenge"} {
for _, existing := range AllowedRecoveryFlowStateEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
@ -43,6 +50,27 @@ func (v *RecoveryFlowState) UnmarshalJSON(src []byte) error {
return fmt.Errorf("%+v is not a valid RecoveryFlowState", value)
}
// NewRecoveryFlowStateFromValue returns a pointer to a valid RecoveryFlowState
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewRecoveryFlowStateFromValue(v string) (*RecoveryFlowState, error) {
ev := RecoveryFlowState(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for RecoveryFlowState: valid values are %v", v, AllowedRecoveryFlowStateEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v RecoveryFlowState) IsValid() bool {
for _, existing := range AllowedRecoveryFlowStateEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to recoveryFlowState value
func (v RecoveryFlowState) Ptr() *RecoveryFlowState {
return &v

View File

@ -1,11 +1,11 @@
/*
* Ory Identities API
*
* This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
*
* API version:
* Contact: office@ory.sh
*/
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
@ -13,20 +13,27 @@ package client
import (
"encoding/json"
"fmt"
"time"
)
// checks if the RecoveryIdentityAddress type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RecoveryIdentityAddress{}
// RecoveryIdentityAddress struct for RecoveryIdentityAddress
type RecoveryIdentityAddress struct {
// CreatedAt is a helper struct field for gobuffalo.pop.
CreatedAt *time.Time `json:"created_at,omitempty"`
Id string `json:"id"`
// UpdatedAt is a helper struct field for gobuffalo.pop.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Value string `json:"value"`
Via string `json:"via"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Value string `json:"value"`
Via string `json:"via"`
AdditionalProperties map[string]interface{}
}
type _RecoveryIdentityAddress RecoveryIdentityAddress
// NewRecoveryIdentityAddress instantiates a new RecoveryIdentityAddress object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
@ -49,7 +56,7 @@ func NewRecoveryIdentityAddressWithDefaults() *RecoveryIdentityAddress {
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *RecoveryIdentityAddress) GetCreatedAt() time.Time {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
@ -59,7 +66,7 @@ func (o *RecoveryIdentityAddress) GetCreatedAt() time.Time {
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryIdentityAddress) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || o.CreatedAt == nil {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
@ -67,7 +74,7 @@ func (o *RecoveryIdentityAddress) GetCreatedAtOk() (*time.Time, bool) {
// HasCreatedAt returns a boolean if a field has been set.
func (o *RecoveryIdentityAddress) HasCreatedAt() bool {
if o != nil && o.CreatedAt != nil {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
@ -105,7 +112,7 @@ func (o *RecoveryIdentityAddress) SetId(v string) {
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *RecoveryIdentityAddress) GetUpdatedAt() time.Time {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
@ -115,7 +122,7 @@ func (o *RecoveryIdentityAddress) GetUpdatedAt() time.Time {
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RecoveryIdentityAddress) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || o.UpdatedAt == nil {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
@ -123,7 +130,7 @@ func (o *RecoveryIdentityAddress) GetUpdatedAtOk() (*time.Time, bool) {
// HasUpdatedAt returns a boolean if a field has been set.
func (o *RecoveryIdentityAddress) HasUpdatedAt() bool {
if o != nil && o.UpdatedAt != nil {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
@ -184,25 +191,80 @@ func (o *RecoveryIdentityAddress) SetVia(v string) {
}
func (o RecoveryIdentityAddress) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreatedAt != nil {
toSerialize["created_at"] = o.CreatedAt
}
if true {
toSerialize["id"] = o.Id
}
if o.UpdatedAt != nil {
toSerialize["updated_at"] = o.UpdatedAt
}
if true {
toSerialize["value"] = o.Value
}
if true {
toSerialize["via"] = o.Via
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RecoveryIdentityAddress) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
toSerialize["id"] = o.Id
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
toSerialize["value"] = o.Value
toSerialize["via"] = o.Via
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *RecoveryIdentityAddress) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"id",
"value",
"via",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varRecoveryIdentityAddress := _RecoveryIdentityAddress{}
err = json.Unmarshal(data, &varRecoveryIdentityAddress)
if err != nil {
return err
}
*o = RecoveryIdentityAddress(varRecoveryIdentityAddress)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created_at")
delete(additionalProperties, "id")
delete(additionalProperties, "updated_at")
delete(additionalProperties, "value")
delete(additionalProperties, "via")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableRecoveryIdentityAddress struct {
value *RecoveryIdentityAddress
isSet bool

Some files were not shown because too many files have changed in this diff Show More